Register forum user name Search FAQ

Gammon Forum

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 ➜ overwriting and/or stopping 'wait' times?

overwriting and/or stopping 'wait' times?

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


Posted by Silencher   (55 posts)  Bio
Date Sat 12 Apr 2014 02:00 AM (UTC)
Message
I wanted to make a trigger where you use the wait function.

1) When the trigger goes into effect, I want it to wait for x seconds, then do something. The catch is it can only be 'online' seconds, and and if I'm disconnected I want the wait.timer to stop until I reconnect, how can I do that?

2) I have another trigger / wait timer set up to help me keep track of when my character is fully healed since it doesn't do so automatically where I play.
I have it so the wait timer is based on a variable, how can I make it so that when the trigger is triggered, it overwrites the previous... trigger?

To explain what I mean, suppose I type hp and my trigger records that I will fully naturally heal in 500 seconds. But suppose I then drink a potion that partially heals me, and I type hp again, I now would naturally heal in 200 seconds. Unfortunately, the trigger reacts to both, I get a message that I'm fully healed 500 seconds after the first time the trigger fired, and 200 seconds after the second time. How do I have the second 'firing' overwrite the first, if that's even possible.?
Top

Posted by Fiendish   USA  (2,536 posts)  Bio   Global Moderator
Date Reply #1 on Sat 12 Apr 2014 04:49 PM (UTC)
Message
Quote:
I wanted to make a trigger where you use the wait function.

Incorrect. You want to make a trigger where you use http://www.mushclient.com/scripts/doc.php?function=AddTimer or http://www.mushclient.com/scripts/doc.php?function=DoAfterSpecial

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Silencher   (55 posts)  Bio
Date Reply #2 on Sat 12 Apr 2014 05:27 PM (UTC)

Amended on Sat 12 Apr 2014 06:03 PM (UTC) by Silencher

Message
Well, those are neat features and I tried it with doafter, but I ran into the same situation, the 'newest' firing of the trigger doesn't overwrite previous firings.

edit: Oddly enough, AddTimer would work great except I can't figure out how to switch the timer from send to world to send to script automatically.

edit 2: Nevermind, figured out how to do this with SetTimerOption http://www.mushclient.com/scripts/doc.php?function=SetTimerOption

This works great, thanks a lot.
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.


12,487 views.

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

Go to topic:           Search the forum


[Go to top] top

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