alias/trigger/script question

Posted by Dradicus on Sun 07 Nov 2004 07:46 AM — 7 posts, 21,850 views.

#0
I want to create an alias called detect that does this:

memorize detect invis
c detect
memorize detect good
c detect
memorize detect evil
c detect
memorize detect magic
c detect


there is a chnace that the memorization fails
if it does it outputs the text: "You failed to memorize it."

however, any single one of these can fail. I want it to on a fail retype in "memorize detect <which ever it failed on>" before it outputs out the "c detect"

can someone help me with this
#1
what would be REALLY awesome is if it was a trigger or script that would for any spell I fail to memorize it would automatically memorize the correct spell (even if multiple memorizes were put in at one time)
#2
I really know nothing about how to script with mushclient. I know the basics to aliasing and triggering, and I even know a little C++ code. If someone could at least help me get started, I might be able to figure out more from there.
USA #3
Youll have to have a trigger for the memorization failed, do you get a success message?

If you do, have an alias to start it, then trigger for failure/success, on success you move onto the next thing (cast it, and then memorize the next spell) if you fail, send it again.

You'll have to keep track of 'where' you are (either have a trigger for each that you toggle on off, so 8(?) total) or you can have a variable that keeps track (1,2,3,4).
Or you can use the command history, and get the last command (which would be the spell) and then recast it. You'd still need some way to keep track of where you were though, so you'd know what to move onto next.
Australia Forum Administrator #4
Do you get a message when you *have* memorized it? If so, what?
#5
the failed message is generic for all spells
the success message is "Spell memorized." which is generic for all spells

I kinda see where you are going with that flannel, but I have no idea how one would do it using the mushclient scripting code
USA #6
Well, since you have a success message, you'll need a trigger for that, and a trigger for a failure message.

If youre comfortable with scripting, pick up the VBscript Doc (its on the scripting download page). And go ahead and use that.

If youre not, (unless you plan on learning to script using this snippet) I suggest you use a daisychain of triggers.

You'll need two (failure, success) per spell, as well as an alias to kick off the whole thing.

Your alias sends the memorize message, and turns on the first round of triggers (youll need to name them, and then use the MC inbuilt script function EnableTrigger to enable/disable triggers throughout this). The rest of them should be turned off (they start that way), and the failure trigger sends memorize again, the success trigger sends the cast, and the next memorize, as well as turning the first round of triggers off, and the second one on.
Continue through this, for all your spells.

I only suggest doing it that way since yes, we can give you some script, but if you need to change it, you'll be lost.

But the list of script functions (mushclient forum, then there is a link on the top), the VBscript help file (link on the same page as the script engines), and then further inquiries (like how on earth these script things fit into my triggers) in the forum are your best friends. You'll do well perusing the functions (MC ones) and getting a feel for whats possible without any real scripting at all.

Otherwise (if you only want to use two triggers and an alias, with a variable) youll be incrementing that variable, and using If statements, in the same fashion as the daisy chain above, but the If statement will determine what to cast (in failure, just cast the spell, in success, increment the variable, and cast the 'current' spell (but you already added one) and then at the end, youll have to disable the triggers. With the alias starting it off like before.