PDA

View Full Version : Pause All Scripts command?



Maerit
11-03-2016, 05:28 PM
Is there a way to pause all currently active scripts within a script, except for the script calling the pause command?

Would you have to do some kind of parse of the list of active scripts from ;list (except I don't think you an start_script "list" because it's not a script), and then loop through the list of active scripts to pause everything except the script calling this "function"?

If so - anyone smart enough to write that function for me? I may have a few instances where that would be useful to both pause and unpause all active scripts.

To help clarify my goal, I am looking to micromanage a bunch of timers and temporary buffs: 506, 411, 902, bless, and 909 (evoke). These things are falling off, wearing off, and disappearing during things like waggle, go2, bigshot, combo (UAC), wander, useherbs... and other various active scripts - especially if two of them fall off at the same time. So, what I am hoping to do is create a nice script that can manage these temporary spells by pausing all the active scripts - performing the necessary "refresh" action(s) - then resuming the scripts that were paused.

Donquix
11-03-2016, 06:23 PM
Script.running.find_all { |script|
do some shit with each script
}

SashaFierce
11-03-2016, 07:48 PM
pause_script ("script name")
unpause_script ("script name")

pause_all or pause_all_script might work too, I don't remember

Tillmen
11-03-2016, 11:52 PM
paused_scripts = Array.new
Script.running.each { |s|
unless s.paused? or s == Script.current
s.pause
paused_scripts.push(s)
end
}

# do things and/or stuff

paused_scripts.each { |s| s.unpause }

Tillmen
11-03-2016, 11:58 PM
This post didn't really happen.

subzero
11-04-2016, 12:48 AM
This post didn't really happen.

Except it did and now I have proof!


https://www.youtube.com/watch?v=wLR5u_Tw8lA

Donquix
11-04-2016, 01:37 AM
This post didn't really happen.


https://www.youtube.com/watch?v=PkFyGNjaQ8k

Maerit
11-04-2016, 06:00 PM
Thanks Tillmen! That'll be perfect.