Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ Delays between trigger firings
Delays between trigger firings
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Silencher
(55 posts) 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? | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 04 Mar 2015 05:48 AM (UTC) |
Message
| It was probably DoAfter ...
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) 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 | Top |
|
Posted by
| Silencher
(55 posts) 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. | 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.
18,785 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top