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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Delays between trigger firings
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Delays between trigger firings

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


Posted by Silencher   (54 posts)  [Biography] bio
Date Wed 04 Mar 2015 04:18 AM (UTC)
Message
Hello,

I think there used to be a video on youtube for making delays between trigger firings (in the example, the trigger would go off everytime the person got a tell). I can't find that video anymore, though, but I would like to use something similar in a trigger.

I thought about using the 'wait' function instead, but the way shown in the video was cleaner, and I think used OS time somehow.

Can someone give an example of how to cause a trigger to delay, say, 10 seconds between firings?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 04 Mar 2015 05:48 AM (UTC)
Message
It was probably DoAfter ...

Template:function=DoAfter DoAfter

The documentation for the DoAfter script function is available online. It is also in the MUSHclient help file.


- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Wed 04 Mar 2015 05:49 AM (UTC)
Message
Or you could check inside the trigger script (assuming it sent to script) if 10 seconds had elapsed, and if not, just return, doing nothing.

- Nick Gammon

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

Posted by Silencher   (54 posts)  [Biography] bio
Date Reply #3 on Thu 05 Mar 2015 03:22 AM (UTC)
Message
I'm fairly sure it wasn't do after. It was an if check using os.time, I'm just not sure how to do it.

A vague idea of how it went was

trigger name: * tells you *

trigger body:

if (os.time since last tell > 30 seconds) then
PlaySound("alert")

else
--do nothing

end

It's how to do/make that 'if' statement work that I'm having trouble with.

Honestly, I think you may have been the one to have made the video on YouTube, but I can't find it anymore.
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #4 on Thu 05 Mar 2015 03:43 AM (UTC)
Message
Something like http://gammon.com.au/forum/bbshowpost.php?id=10967 perhaps?

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[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.


3,213 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 FutureQuest]