Disabling a script while it's executing

Posted by Draechen on Tue 30 Jul 2019 05:40 PM — 5 posts, 19,634 views.

USA #0
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
USA Global Moderator #1
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.
Australia Forum Administrator #2
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.
Amended on Tue 30 Jul 2019 08:24 PM by Nick Gammon
USA #3
Thank you both, I suppose I should break down and figure out lua instead of clinging onto vb! :)
Australia Forum Administrator #4
It's not that bad. :)