ScriptUO
Scripting Resources & Utilities => ScriptUO Application => Bug discussion => Topic started by: Superslayer on February 06, 2009, 12:37:52 PM
-
The Debug Panel reported that my GOTO had no matching tag, yet it is about 15 lines above. It loops fine and works well. perhaps the Debug Panel isn't 100% completed yet? I don't know.
One other thing with the Debug Panel, when it's run once, it stays open even after a second Syntax check is run. Perhaps the first report can be auto closed to avoid potential issues when opening further checks?
-
Do you have the snippet of code you can post or PM?
For your second request, I'll have to think of a way to do that since right now I'm not keeping track of the Forms I'm opening for that. Should be an easy one to fix though. I just got used to closing it. ;)
-
Here's the snip, it also is now not picking up my 'End:' goto
{
;display ok Please target the runebook(s) in your backpack that you will be using.$
+Press the "Space Bar" when you're done selecting books.
set %rbook
set %rbookcnt 0
set %hotkey Space
rbook_loop:
wait 5
set #targcurs 1
target
while #true
{
repeat
onhotkey %hotkey
goto End
until #targcurs = 0
break
}
finditem #ltargetid
if #findtype <> ZBN
{
display ok That is not a runebook. Try again.
goto rbook_loop
}
goto rbook_loop:
}
-
Have you tried not having the : in the goto line?
goto rbook_loop:
maybe should be
goto rbook_loop
The second is the proper use.
-
Ahh, that did it for the rbook loop, but 'end' still is comming up with a 'no matching tag'. ATM, it's no big deal, it works and 'end' is nowhere else in my script. thanks for pointing out that folly of mine Cerveza.
I do realize that the actual "End:" is not in the snip I posted, but that can sorta be ignored anyways. I wonder if one bad 'GOTO' is flagged, all in the script block will be as well. No matter, I've got the (.) and (,) operators finally working for me with the runebook sub now so all is good :)
-
You'll have to PM me your entire script so I can see if there's any interactions that's not apparent in the sample code.
That part of the syntax checker is pretty basic. There's no dependencies between one tag or another.
-
NP at all on the find. When I'm targetting stuff for setup I go a little different route. You might consider trimming up a little code...
rbook_loop:
wait 5
set #targcurs 1
target
while #true
{
repeat
onhotkey %hotkey
goto End
until #targcurs = 0
break
}
finditem #ltargetid
if #findtype <> ZBN
{
display ok That is not a runebook. Try again.
goto rbook_loop
}
goto rbook_loop
could become
rbook_loop:
wait 5
set #targcurs 1
target
while #targcurs = 1
wait 0
finditem #ltargetid
if #findtype <> ZBN
{
display ok That is not a runebook. Try again.
goto rbook_loop
}
goto rbook_loop
Saves 5 lines (+1 more for not having to set the hotkey, so 6 really). *(+1 one more in the original display telling the user to use space ;))
And I didn't see it in that section, but somewhere you must be using
set %rbookID #ltargetID
You really should have that right before the ending brackets in that section, so you don't get some other #ltargetID mixed in. Much cleaner coding to keep it all in one section. Without seeing the rest of the script... I can only assume that this isn't a called sub routine. I'd definitely change it to a sub with return. Much easier to handle, and you don't want it clogging up your main loop.
-
@ TrailMyx, I'm gonna see if I can pm you the whole script tonight as an attachment. It's 32kb's, quite large atm, and include the lines where this anomaly occurs. Seems to be off and on from time to time when I copy/paste from Euo to Suo for the syntax check and auto indent.
In the mean time, this bit is a bigger bit of what I'm dealing with and how I have it for the time being.
if #menures = 3 || #menures = 4 ; find runebook(s)
{
finditem ZBN C_ , #backpackid
if #findkind = -1
{
display ok Get the runebook(s) ya goof!!$
+Halting.
Halt
}
if #findkind = 0
{
display ok Please target the runebook(s) in your backpack that you will be using.$
+Press the "Space Bar" when you're done selecting the book(s).
set %rbook
set %rbookindex 0
set %rbookid
set %rbookcnt 0
set %hotkey Space
rbook_loop:
wait 5
set #targcurs 1
target
while #true
{
repeat
onhotkey %hotkey
goto End
until #targcurs = 0
break
}
finditem #ltargetid
if #findtype <> ZBN
{
display ok That is not a runebook. Try again.
goto rbook_loop
}
set %rbookindex %rbookindex + 1
set %rbookcnt %rbookcnt + 1
set %rbookid #ltargetid
set %rbook_ . %rbookcnt %rbookid
goto rbook_loop
}
}
End:
set #targcurs 0
if #menures = 4 ; use runebook charges
{
For %rbookindex 1 %rbookcnt
{
set #lobjectid %rbook_ . %rbookindex
wait 10
event macro 17 0
wait 10
set #ContPosX 363
wait 5
set #ContPosY 21
wait 5
call kalocr.txt getRunebookCharges 363 21
wait 15
click 640 130 r
if !rbi_charges < ( !rbi_maxcharges / 4 )
display ok Should get some scrolls for this book.
}
finditem WTL C_ , #backpackid
if #findkind = -1
{
display ok No scrolls in your backpack. Get some recall scrolls from your bank box or house secure.$
+Halting script. This is a temp message until I set up the home/bank secure boxes with resources. NOT Halting
;Halt
}
-
I added you to the Special Project Group. That will give you access to the special project section where you can post so only the staff can see. It's just a temporary section for discussions like this. So post what you've got there and we can take the conversation off-line. ;)
http://www.scriptuo.com/smf/index.php?board=68.0
-
It seems odd that still after all this time, and many more script additions, this goto thing hasn't come up again. I'm gonna chalk it up to what Cerveza had noticed about my type error in the first instance, a retard moment on my part.
While I'm still on the goto subject, I have noticed that while there is a "Tags" tree, would it be possible to add in there a "Goto" tree?
-
I had that in there a long time ago, but I found that I rarely used that part. I'm re-writing that section so that it updates all the time instead of having to refresh it. I might add that back.