ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Coragin on February 24, 2010, 08:50:45 PM

Title: Why isint this finding gold in my secure?
Post by: Coragin on February 24, 2010, 08:50:45 PM
Okay, the point of this sub is to take leftover gold in my backpack, drop it in a secure IN my bank.  Then drag 2500 gold out of the secure IN my bank and drop it in my backpack.

Its taking it out of my pack fine, but the nit tells me I am out of gold (when I have over 1 mill in gold in the secure in my bank.)

Code: [Select]
set %gold POF

Display Ok Select Supply Container IN BANK.
  set #targcurs 1
      while #targcurs = 1
         wait 1
         set %secure #ltargetID
      set #lobjectID #ltargetID
      event macro 17
      wait 20
gosub getgold
Sub GetGold
    Finditem POF C_ , #backpackid
             exevent drag #findid #findstack
             exevent dropc %secure
    finditem POF C_ , %secure
         if #findkind = 0
            {
            display You are done. You are out of Gold.
            halt
            }
         exevent drag #findid 2500
         wait 10
         exevent dropc #BackpackID
         wait 20
Return
Title: Re: Why isint this finding gold in my secure?
Post by: Scotch_Tape on February 24, 2010, 10:18:32 PM
change

if #findkind = 0
            {
            display You are done. You are out of Gold.
            halt
            }


to

if #findkind = -1
            {
            display You are done. You are out of Gold.
            halt
            }


If no gold is found this variable will be -1.  
Title: Re: Why isint this finding gold in my secure?
Post by: Cerveza on February 25, 2010, 02:31:41 AM
Have you considered

msg Withdraw 2500 $

instead of drag/drop stuff?
Title: Re: Why isint this finding gold in my secure?
Post by: UOMaddog on February 25, 2010, 02:43:13 AM
I thought the exact same thing as soon as I read this Cerv! But scotch is also right about the -1.

In EasyUO, #false = -1, #true = 0
Title: Re: Why isint this finding gold in my secure?
Post by: NObama on February 25, 2010, 06:48:36 AM
I concur that speaking 'withdraw' is probably a better option.  Pair it with a journal scan for art_thou to recognize when you're out of gold.
Title: Re: Why isint this finding gold in my secure?
Post by: Cerveza on February 25, 2010, 07:00:58 AM
Maybe even scan around to make sure there's a banker prior to the message as well.

Item type, event property, if banker notin #property - something those lines...
Title: Re: Why isint this finding gold in my secure?
Post by: Coragin on February 25, 2010, 11:34:58 AM
If I can pull directly from bank box I can stay hidden 100% of the time.  Thats why I wanted to stay away from "withdraw", but I got it working, ran all night on a trial account and got me 40k of each reg.  Just ran a secondary script that if I was attacked it would call guards.
Title: Re: Why isint this finding gold in my secure?
Post by: Endless Night on February 25, 2010, 11:51:43 AM
Why not use the  #gold  and then withdraw the difference.

Code: [Select]
; statusbar must be open or #gold is not set
If #gold < 2500
  {
 set %Gold 2500 - #gold
 msg Withdraw %Gold $
 }