PenUltima Online

It is currently Fri Sep 05, 2008 9:36 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: runaway script??? what is this?
PostPosted: Sat Sep 08, 2007 1:26 am 
Offline

Joined: Fri Aug 31, 2007 2:25 pm
Posts: 58
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?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 08, 2007 4:40 am 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 209
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 08, 2007 6:14 am 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 747
Location: Chicago, IL USA
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl