Page 1 of 1

runaway script??? what is this?

Posted: Sat Sep 08, 2007 1:26 am
by phao

Code: Select all

[09/08 06:21:10] Runaway script[11]: scripts/cmd/gm/gump.ecl (20000 cycles)
 478: #
 479: local #1
 480: "teste16"
 481: 8L
 482: makelocal
>483: jmp userfunc @850
 484: #
 485: local #1
 486: "teste16"
 487: 8L
 488: makelocal
i'm doing some 'enginee' here, and i'm testing it. i'm making tests by using a lot of times the functions of it, and the functions modify a variable (passed byref), and of course, more functions i call, more modifications, load, etc.

I think this is (this = runaway script) is because of that, but is there some way that i can avoid it? i'm getting this runaway script evertime i call the textcmd i've made to test it, it's 140 lines calling the same function (hehehe, this is kinda need here), if you need the code just ask.

well, is there som way to avoid it?

Posted: Sat Sep 08, 2007 4:40 am
by ncrsn
Runaway occurs when processing of single script lasts long. You can avoid this by using Sleep() or SleepMS() calls, which lets POL process other things for a while or making the script critical, using set_critical(1). Critical scripts will run from begin to an end, nothing else gets prosessed meanwhile.

Posted: Sat Sep 08, 2007 6:14 am
by CWO
Do NOT EVER make a script critical if its running away. You're just going to escalate the problem by doing that. The best way, if you have while, for, foreach, repeat/until, ect... loops is to put a sleepms() inside the loop. Depending on how fast you need the script to go you can raise or lower the number. Usually on a script that needs to be faster, I put 1 or 2 which makes no noticeable difference in the speed. Otherwise I may slow it down to 5 or even 10 ms if its not too important.