runaway script??? what is this?

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 097.
Note: Core 097 is no longer officially supported.
Post Reply
phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm

runaway script??? what is this?

Post 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?
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Post 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.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post 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.
Post Reply