PDA

View Full Version : Script won't pause...



ShatteredCasis
02-03-2011, 01:19 AM
Hey all.

I have 2 scripts.. script 1 and script 2.

script 1 runs, and at a certain point, fires script 2 and does a wait_while script 2 is running.



start_script 'script2'
wait_while{running?('script2')}


First, I discovered that script 1 wouldn't actually wait. It would pause for a few seconds, but would eventually keep going.
So, I figured, alright then, in script 2, I added a pause_script 'script 1'.

Lich tells me that script 1 is paused (when I do a ;list), but it STILL does crap.

I don't have any hooks or seperate threads going for script 1 but script 1 does contain multiple "class" definititions - so perhaps this is the reason it's not honoring the wait or pause. Anyone run into this before?

Thanks,
Casis

ShatteredCasis
02-03-2011, 12:54 PM
Tillmen is the man! He helped me out with it, but I'll mention the solution in case someone else runs into it.

When pausing a lich script, it set's a flag. But that flag's not going to be looked at unless a Lich function is actually called by the script. In my case script 1's loop was basically looking at simple variables, and not actually calling a lich function. So, Tillmen had me add "Script.self" inside the loop to allow Lich to properly pause it.

- Casis