Excellent! Now I don't seem to be wasting mana. I'll test this a little more to see if there's any hiccups, but it looks like that's it. Also, the script seems very simple. So thanks for that!
Amended on Sun 12 Sep 2010 03:24 AM (UTC) by Nick Gammon
Message
Something like this would do it:
<triggers>
<trigger
enabled="y"
match="You are paralysed and *"
send_to="12"
sequence="110"
>
<send>
if not paralyzed then
Send ("FOCUS BODY")
paralyzed = true
end -- if
</send>
</trigger>
<trigger
enabled="y"
match="Your muscles unlock; you are no longer paralysed."
send_to="12"
sequence="110"
>
<send>
paralyzed = false
</send>
</trigger>
</triggers>
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
This sets a Lua variable 'paralyzed' (which is assumed to be false when you open the world).
Then when you get the message about being paralysed you only send the message if the variable isn't set already.
I didn't use regular expressions there, your triggers are so simple it is easier to read without using regexps.
Amended on Sun 12 Sep 2010 03:06 AM (UTC) by Rivius
Message
In one of the games I play there is a case where you might become paralyzed and need to send the command to the game
FOCUS BODY
Now when you're paralyzed, this is the trigger line.
^You are paralysed and
and I have it set to Send("FOCUS BODY") to the world.
For example lets say I get paralyzed mid-swing and then I attempt to swing again it would say
"You are paralysed and cannot do that".
and the trigger would fire and send "FOCUS BODY".
Focus body takes some time to eventually cure my paralysis.
Now if I inadvertently hit swing again while still focusing body, it will once again trigger off the command FOCUS BODY. This is undesirable because it uses up excess mana and takes longer.
Now, I don't know very much about variables and scripting, but I'm sure it isn't too difficult.
I want something like a variable called "paralyzed" to be initially set to 0 when I start the game. Then when a paralysis message comes up, I want it to set paralysis to 1 and prevent "focus body" from firing again.
this second trigger:
^Your muscles unlock\; you are no longer paralysed\.$
Should set paralyzed to 0, and allow for someone to once again fire off focus body.
In this way, I can be as efficient as possible with my mana. During combat with multiple people in a room, it gets too spammy and I can't always keep track of these things and before I notice I might do an extra swing or two.
Anyway, can you please instruct me on how to go about doing this? I figure this would assist in the coding of similar aspects.
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.