waiting period in triggers

Posted by Diwafiven on Wed 02 Dec 2009 03:18 PM — 2 posts, 14,930 views.

#0
I have searched the forums and google for a solution for this problem, but haven't been able to find it.

I play a mud where exp botting is legal (but not recommended once you go pk ready) but I have a problem with the trigger. every so often I need to get ammo, but you can only do that so often. so I sometimes get this message:

Your headquarters tells you to try again in 4 seconds.

or some other amount of seconds. Is there a way to make a trigger try again in that amount of time (+1 second in case the mud is rounding it's seconds down)?
USA #1
IF you're using LUA for the scripting language, the following should work.

NOTE: I am not a LUA user/programmer. I'm not aware if there's an easier, or better way, I just know that this works.


<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   match="^Your headquarters tells you to try again in (\d+) seconds\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>local secs_to_wait = tonumber('%1') + 1
DoAfterSpecial(secs_to_wait,'Note("You can cast the spell again!")',12)</send>
  </trigger>
</triggers>