Delays between trigger firings

Posted by Silencher on Wed 04 Mar 2015 04:18 AM — 5 posts, 24,078 views.

#0
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?
Australia Forum Administrator #1
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.

Australia Forum Administrator #2
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.
#3
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.
USA #4
Something like http://gammon.com.au/forum/bbshowpost.php?id=10967 perhaps?