Official ScriptUO EasyUO Scripts > Script Debug

cant exit goto correctly

(1/1)

Man7dowN:
this is my  restock sub, mainly having trouble with dropping recalls on runebook and returning from the GOTO back to where it left off in the sub, it keeps moving threw other GOTO's.
i think i have a bracket miss placed but i cant find it,,,
any help appreciated


--- Code: --- SET %weight 200
set %regamount 50
SET %bandageamount 200
SET %bankbook APNOHPD
SET %farmbook LPOELOD
SET %restockbag FTQDSPD
SET %lootbag ZRBNPMD
SET %dropbag RPYCWND
SET %dropoff POF_MYM
set %garlic KZF_
set %ginseng JZF_
set %mandrake RZF_
set %spider MZF_
set %bandage ZLF_
set %recallget WTL_
set %recallgetamount 100
set %bankboxID JYDQBND



GOSUB RESTOK
halt



SUB RESTOK
Finditem %recallget C_ , %BankboxID
  if #findkind
   {
    goto bankbookstock
      }
     Finditem %recallget C_ , %BankboxID
  if #findkind
   {
    goto farmbookstock
      }
     findItem %bandage C_ , %lootbag
  if #findkind = -1
   {
     set %rg %bandage
     goto bandagesnag
     }
findItem %garlic C_ , %lootbag
  if #findkind = -1
   {
     set %rg %garlic
     goto regsnag
     }
     findItem %ginseng C_ , %lootbag
  if #findkind = -1
   {
     set %rg %ginseng
     goto regsnag
     }
     findItem %mandrake C_ , %lootbag
  if #findkind = -1
   {
     set %rg %mandrake
     goto regsnag
     }
     findItem %spider C_ , %lootbag
  if #findkind = -1
   {
     set %rg %spider
     goto regsnag
     }
     return



bankbookstock:
finditem %recallget C_ , %restockbag
     exevent drag #findid #findstack
     wait 10
     exevent dropc %bankbook
bankbookstock_exit
farmbook:
finditem %recallget C_ , %restockbag
     exevent drag #findid #findstack
     wait 10
     exevent dropc %bankbook
     farmbook_exit
bandagesnag:
finditem %rg C_ , %restockbag
     exevent drag #findid %bandageamount
     wait 10
     exevent dropc %lootbag
     bandagesnag_exit
regsnag:
finditem %rg C_ , %restockbag
     exevent drag #findid %regamount
     wait 10
     exevent dropc %lootbag
     regsnag_exit
--- End code ---

gimlet:
I might point out a few things that look weird to me.

 if #findkind
   {
    goto bankbookstock
      }
     Finditem %recallget C_ , %BankboxID

no condition on if statement for this and the next.



Also this statement and others like it  does nothing

bankbookstock_exit

Also need waits after dropc commands

Hope this helps.

(I rarely use goto statements, I use gosub)

Man7dowN:

--- Quote from: gimlet on February 27, 2019, 07:10:21 AM ---I might point out a few things that look weird to me.

 if #findkind
   {
    goto bankbookstock
      }
     Finditem %recallget C_ , %BankboxID

no condition on if statement for this and the next.



Also this statement and others like it  does nothing

bankbookstock_exit

Also need waits after dropc commands

Hope this helps.

(I rarely use goto statements, I use gosub)

--- End quote ---


it sure does thank you for reply, i sometimes find myself coming up with commands that dont exist lol, but they sound good

Navigation

[0] Message Index

Go to full version