Gammon Forum
See www.mushclient.com/spam for dealing with forum spam.
Please read the MUSHclient FAQ!
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,315 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 (22,556 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 (22,556 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.
2,632 views.
It is now over 60 days since the last post. This thread is closed.
 
Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.