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 ➜ VBscript ➜ Disabling a script while it's executing

Disabling a script while it's executing

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


Posted by Draechen   USA  (2 posts)  Bio
Date Tue 30 Jul 2019 05:40 PM (UTC)
Message
There may be a far easier way to go about this, but here's my scenario.

I have an alias that goes through a whole timed list of commands utilizing world.doafter. Occasionally, it would be helpful if I could break out of the list and stop execution of the rest. Is there any good way to go about this, or an entirely different approach to accomplish what I'm after?

Thank you in advance!
Draechen
Top

Posted by Fiendish   USA  (2,535 posts)  Bio   Global Moderator
Date Reply #1 on Tue 30 Jul 2019 08:00 PM (UTC)
Message
If you're already passing control back to MUSHclient in between each of your commands, then you can make an alias that sets a variable and then check the status of that variable in between your commands.

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

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 30 Jul 2019 08:23 PM (UTC)

Amended on Tue 30 Jul 2019 08:24 PM (UTC) by Nick Gammon

Message
If your alias does a whole lot of DoAfter calls then that has effectively queued up various things as temporary timer items.

If you open world configuration and look at the timers you will see them (if they haven't fired yet).

To stop them doing their thing you would need to delete those timers before they fire. You could loop through all timers (see GetTimerList) and then work out if each one was one that you wanted to delete (see GetTimerInfo). You could, for example, find if the "temporary" flag was set.

Then you could call DeleteTimer to delete it.




Personally I would use Lua rather than VBscript, then you can use the "wait" module to do things in a loop inside the script, with delays, and inside that loop check some external variable as Fiendish mentioned.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Draechen   USA  (2 posts)  Bio
Date Reply #3 on Tue 30 Jul 2019 08:59 PM (UTC)
Message
Thank you both, I suppose I should break down and figure out lua instead of clinging onto vb! :)
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 31 Jul 2019 09:05 AM (UTC)
Message
It's not that bad. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


14,264 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.