PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
runaway script??? what is this?

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Development Discussion 097
Display posts from previous:   

Author Message
phao



Joined: 31 Aug 2007
Posts: 34

PostPosted: Sat Sep 08, 2007 5:26 am    Post subject: runaway script??? what is this? Reply with quote

Code:

[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?

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 189

PostPosted: Sat Sep 08, 2007 8:40 am    Post subject: Reply with quote

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.

Author Message
CWO



Joined: 04 Feb 2006
Posts: 713
Location: Chicago, IL USA

PostPosted: Sat Sep 08, 2007 10:14 am    Post subject: Reply with quote

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 new topic   Reply to topic    PenUltima Online Forum Index -> Development Discussion 097 All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty