Trigger action then wait till next action

Posted by Boen310 on Fri 24 Aug 2018 10:03 AM — 3 posts, 13,391 views.

#0
I am not very good with triggers. I am looking to trigger an action of a output from the MUD

Your bones pop and creak ominously.

then after a certain time frame do another action.

This is what I have but not working.

Trigger- Your bones pop and creak ominously.
Send-
grav stop
med
wait.time 60, "grav endure"
#1
I figured it out digging through lots and lots and lots of posts



<triggers>
  <trigger
   enabled="y"
   ignore_case="y"
   match="Your bones pop and creak ominously."
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>

require "wait"

wait.make (function ()  --- coroutine below here

  Send ("grav stop")
  Send ("med")
  wait.time (90)   -- wait 90 seconds
  Send ("grav endure")
 
end)  -- end of coroutine

</send>
  </trigger>
</triggers>
Amended on Sat 25 Aug 2018 09:34 PM by Nick Gammon
Australia Forum Administrator #2
You could also do:


Send ("grav stop")
Send ("med")
DoAfter (90, "grav endure")  -- send after 90 seconds


Then you don't need the "wait" module, in this case.