[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger action then wait till next action

Trigger action then wait till next action

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Boen310   (17 posts)  [Biography] bio
Date Fri 24 Aug 2018 10:03 AM (UTC)
Message
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"
[Go to top] top

Posted by Boen310   (17 posts)  [Biography] bio
Date Reply #1 on Fri 24 Aug 2018 10:31 AM (UTC)

Amended on Sat 25 Aug 2018 09:34 PM (UTC) by Nick Gammon

Message
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>
[Go to top] top

Posted by Nick Gammon   Australia  (23,001 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sat 25 Aug 2018 09:34 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

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.


9,073 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]