Need help with a script

Posted by Kaervos on Mon 24 Dec 2007 05:44 PM — 5 posts, 20,854 views.

USA #0
In the MUD I play (Aetolia), I have a bad habit of trying to do things (like take the corpse of a recent kill, for example) before my character has regained balance or equilibrium. I would like to make a script so that when I get the message "You must regain balance/equilibrium first." it will automatically resend the command after getting the message "You have recovered balance/equilibrium." How would I do this?
Australia Forum Administrator #1
You can do this with two triggers. The first detects a failed attempt to do something, and saves the last command. The second detects the other message, sends the command, and clears it so it doesn't get sent again later.


<triggers>

  <trigger
   enabled="y"
   match="You have recovered balance/equilibrium."
   send_to="12"
   sequence="100"
  >
  <send>

if failed_command then
  Send (failed_command [1])
  failed_command = nil
end -- previous command failed

</send>

  </trigger>
  <trigger
   enabled="y"
   match="You must regain balance/equilibrium first."
   send_to="12"
   sequence="100"
  >
  <send>

failed_command = GetCommandList (1)

</send>
  </trigger>

</triggers>
USA #2
Okay...I see how that should work, but I don't know how to put it into MUSHclient so that it _does_ work. I'm a little slow on this scripting stuff...
Australia Forum Administrator #3
http://www.mushclient.com/pasting
USA #4
Thanks!