Author Topic: cant exit goto correctly  (Read 3422 times)

0 Members and 1 Guest are viewing this topic.

Offline Man7dowNTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 0
  • Man7dowN has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
cant exit goto correctly
« on: February 27, 2019, 02:40:27 AM »
0
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: [Select]
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

Offline gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6190
  • Activity:
    3%
  • Reputation Power: 71
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +273
  • Referrals: 3
    • View Profile
Re: cant exit goto correctly
« Reply #1 on: February 27, 2019, 07:10:21 AM »
0
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)
« Last Edit: February 27, 2019, 07:12:21 AM by gimlet »

Offline Man7dowNTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Activity:
    0%
  • Reputation Power: 0
  • Man7dowN has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: cant exit goto correctly
« Reply #2 on: February 27, 2019, 08:38:12 AM »
0
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)


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

Tags: