ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Grandewd on February 13, 2014, 07:33:11 PM

Title: Is it possible
Post by: Grandewd on February 13, 2014, 07:33:11 PM
Is it possible to have one script pause another script?
Title: Re: Is it possible
Post by: TrailMyx on February 13, 2014, 08:01:27 PM
Sure, you can use global variables to do that.

In one script do this:

Code: [Select]
sub PauseScript
  namespace push
  namespace global monitor
  set !pause %1
  namespace pop
return

Then call to pause just do:

Code: [Select]
gosub PauseScript #TRUE ; or #FALSE to unpause

Then in the other script tab, do something like this

Code: [Select]

repeat
  namespace push
  namespace global monitor
  repeat
  until  !pause = #TRUE
  namespace pop
until #FALSE

If you really want to "PAUSE" it without need to control the start back up, just put a "pause" command in for the successful test for !pause

note this only works for scripts contained within a single EUO instance and multiple tabs. 
Title: Re: Is it possible
Post by: Grandewd on February 14, 2014, 11:30:23 AM
A global variable to control a pause, of course... Another reason to continue my learning of namespace globals... Thanks TM.
Title: Re: Is it possible
Post by: TrailMyx on February 14, 2014, 11:42:39 AM
You betcha