help with a trigger or script

Posted by Tal on Thu 01 Jan 2004 03:13 AM — 10 posts, 30,101 views.

#0
I have been using mushclient for a little while now and i was just wondering if someone could help me with a trigger or a script as i am a complete newbie to it all.

what i need to do is activate a timer on an event and disable it on another event.

so....

a monster has a few wounds. (timer activated to send the "kick" command every 5 seconds.

a mosnster is in awful condition (timer stoped)

i have no idea how to use scripts so any help i would be thankful for.

Australia Forum Administrator #1
OK, you need a couple of triggers and a timer. Like this:



<timers>
  <timer name="KickTimer" enabled="n" second="5" >
  <send>kick</send>
  </timer>
</timers>

<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="* has a few wounds"
   send_to="12"
   sequence="100"
  >
  <send>EnableTimer "KickTimer", vbTrue
ColourNote "white", "green", "Kick timer now enabled"</send>
  </trigger>
  <trigger
   custom_colour="1"
   enabled="y"
   match="* is in awful condition"
   send_to="12"
   sequence="100"
  >
  <send>EnableTimer "KickTimer", vbFalse
ColourNote "white", "red", "Kick timer now disabled"</send>
  </trigger>
</triggers>



You will need to enable scripting for this to work (VBscript language). No script file is needed.

Copy between the lines above and go to File -> Import -> Clipboard. This will import one timer and two triggers. You will need to modify the triggers to match exactly what the MUD sends. (eg. if it is really "a monster is in awful condition." then the trailing period is needed). I made the trigger with a wildcard (*) so that it would match on any monster name.

Then you can inspect the timer and triggers to see what they do.
Amended on Thu 01 Jan 2004 07:42 PM by Nick Gammon
#2
it works great...
the little mesages were a nice touch
thanks heaps nick
#3
Hey, I tried out a simple walking script, from the example above, but it won't work.. anyone know what I did wrong?
<timers>
<timer name="WalkTimer" enabled="n" second="5">
<send>west</send>
</timer>
</timers>
Greece #4
Did you change "KickTimer" to WalkTimer in the script?
#5
yes, I did :)
Greece #6
I don't know what it could be, maybe the triggers do not match?
#7
I dun have any triggs, I just tried to make a timer to check out how it works.. what kind of triggers do I need?
Australia Forum Administrator #8
You have the timer disabled (enabled="n") - that means it is there but not doing anything. Edit the timer and check the "enabled" box.
#9
cool, thanks :)