Official ScriptUO EasyUO Scripts > Scripting Chat

Start Script at Specific Line

(1/1)

Rumples:
I'm a total newb, so please excuse my ignorance.

 Is there a way to start a script at a certain line? I'm trying to figure out what is going wrong, and rather than starting the script from the top (because of course my troubles are midway through) I would like to start at a certain line. It could be something to do with the 'step over', 'step into', 'step out' options but I have no idea what those mean. I pause when the script doesn't do what I want, so I have a general idea of where it is going awry, but because I'm clueless I am kind of just stumbling along with changing things and hoping they work, it would be much easier to start from where the issue is.

I tried to search for this but I couldn't find anything. I'm sure i'm just using the wrong verbiage...

Thanks

Gaderian:
So the various commands do this:
F6 - execute the rest of this routine or called external until you return from it, then pause there
F7 - execute 1 line at a time and pause before executing the next line
F8 - (step over) can be used to execute a whole subroutine or called external (you can't actually pause and step through a called external script)
F9 - run (no automatic pause control exists with this command)


When I want to stop at a known spot in the script, I will add a pause statement. A more flexible method is to set a value and pause if that value is set.


--- Code: easyuo ---set %debug _ , MYVALUE , _for %i 1 100 { wait 10 }; now in this loop, I want to set the pause, but only when %debug has the value _MYVALUE_ in itif _ , MYVALUE , _ in %debug { pause ; so it will stop at this line and you can use the F6 - F9 keys to control program flow from this point ; you can also check and set the values of variables using the right side of the easyuo program } for %i 1 10 { wait 10 }halt 
The benefit of doing it this way is you can control the pause statements by changing the %debug variable to have a variety of values and you can have multiple control points in the script. This will allow you to test a script at full speed without stopping on each line. The script can also keep the debug code in place and by just changing the %debug variable you can allow the whole script to run.

I used the underscores around the value because it forces the phrase to be whole and a partial match won't work - which is safer.

Gaderian

Rumples:
Thank you for your quick reply! Hopefully i'll have some time soon to test this out.

Navigation

[0] Message Index

Go to full version