Author Topic: Goto's in the Debug Panel  (Read 12791 times)

0 Members and 1 Guest are viewing this topic.

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Goto's in the Debug Panel
« on: February 06, 2009, 12:37:52 PM »
0
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?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Goto's in the Debug Panel
« Reply #1 on: February 06, 2009, 01:24:32 PM »
0
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.  ;)
« Last Edit: February 06, 2009, 01:28:23 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Goto's in the Debug Panel
« Reply #2 on: February 06, 2009, 01:38:33 PM »
0
Here's the snip, it also is now not picking up my 'End:' goto

Code: [Select]
{
  ;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:
}

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Goto's in the Debug Panel
« Reply #3 on: February 06, 2009, 03:47:40 PM »
0
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.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Goto's in the Debug Panel
« Reply #4 on: February 06, 2009, 04:16:33 PM »
0
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  :)

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Goto's in the Debug Panel
« Reply #5 on: February 06, 2009, 06:30:08 PM »
0
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.
« Last Edit: February 06, 2009, 06:33:06 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Goto's in the Debug Panel
« Reply #6 on: February 06, 2009, 09:30:46 PM »
0
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...

Code: [Select]
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

Code: [Select]
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

Code: [Select]
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.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Goto's in the Debug Panel
« Reply #7 on: February 07, 2009, 12:57:46 PM »
0
@ 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.

Code: [Select]
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
      }

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Goto's in the Debug Panel
« Reply #8 on: February 07, 2009, 01:15:12 PM »
0
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
« Last Edit: February 07, 2009, 01:20:21 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Goto's in the Debug Panel
« Reply #9 on: March 11, 2009, 06:40:26 PM »
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?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Goto's in the Debug Panel
« Reply #10 on: March 11, 2009, 09:33:35 PM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: