|
demingm Beginner
Joined: 27 May 2005 Posts: 23
|
Posted: Sat May 28, 2005 12:44 pm
Spellup script |
Ok, another simple script question (I hope). I'm looking to create a very simple spellup script. Basically, I have a list of spells that I'd like to cast upon myself before I do anything else. Its about a list of ten spells, and I'd just like to make a sort of loop that starts casting the spells, and doesn't finish until I cast all of the spells on myself. I'm thinking this should be easy, I'm just having a hard time determining how I want to make the loop work. The only sort of special thing I need to incorporate with this is that every once in awhile when you try to cast a spell you lose concentration and fail to cast the spell. So, if this happens, I'd like to try and recast that spell until successful and then move on to the next.
So, I'm guessing I have to create a variable of sorts to hold my list of spells, create an alias that starts the loop, and write a few triggers that keep the loop going and handle the loss of concentration thing. But how I actually do that I don't know. Any guidance would be appreciated. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sat May 28, 2005 3:52 pm |
#VAR spelllist {thisspell|thatspell|otherspell|ect|ect}
#ALIAS spellup {#VAR numspells {%numitems(@spelllist)};nextspell}
#ALIAS nextspell {cast %item( @spelllist, 1)}
#TR {You lose concentration} {nextspell}
#TR {you succesfully cast {@spellist}} {#var spelllist {%additem(%item( @spelllist, 1), @spelllist)};#DELN spelllist 1;#var numspells {%eval(@numspells-1)};#IF (0<@numspells) {nextspell}} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
demingm Beginner
Joined: 27 May 2005 Posts: 23
|
Posted: Sat May 28, 2005 4:08 pm |
Ok, so you're triggering off the message for a successful cast. So how would I handle it if there are different success messages? Also, a few spells have the same success message, so that was why I was trying to avoid it. This is definitely a great start though, thanks.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sat May 28, 2005 6:55 pm |
make an array to hold all the end messages
#VAR spellupsucess {thisend|thatend|ect}
then trigger off of
#TR {{@spellupsucess}} {blah blah blah} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
demingm Beginner
Joined: 27 May 2005 Posts: 23
|
Posted: Sat May 28, 2005 8:24 pm |
Sorry, one last question. Like I said, there are like 4 spells that have the same exact success message. Is there anyway I could manipulate the data coming from the mud to differentiate these and then use these new messages in my list of successful messages?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sat May 28, 2005 10:43 pm |
it shouldnt matter since the same trigger would fire off all the end messages, if you stick them in the array like i said
It IS possible i suppose, but its beyond the scope of this problem |
|
_________________ Discord: Shalimarwildcat |
|
|
|
demingm Beginner
Joined: 27 May 2005 Posts: 23
|
Posted: Sat May 28, 2005 10:55 pm |
Ok, I think I see why. At the triggers do is move the loop onto the next spell in the array, regardless of which success message triggers it. Thanks.
|
|
|
|
demingm Beginner
Joined: 27 May 2005 Posts: 23
|
Posted: Sat May 28, 2005 11:22 pm |
Got it working, but now I want to make it a class so these triggers only work when I am spelling up, then turns off when I'm done. I'm going to try and figure it out, but if someone would like to help me that would be great too.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sun May 29, 2005 4:28 am |
just make the class folder in the settings editor and click and drag
that would be the easiest method since the are already made |
|
_________________ Discord: Shalimarwildcat |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sun May 29, 2005 4:34 am |
#CLASS SpellUpClass
#CLASS 0
#BUTTON 1 {Spell Up Time} {#T- SpellUpClass;spellup} {Done Spelling Up} {#T+ SpellUpClass} {} {1} {} {Size} {70} {23} {Pos} {1} {795} {} {} {} {} "" {} {} {} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|