ScriptUO

Official ScriptUO EasyUO Scripts => Script Snippets => Topic started by: NObama on February 16, 2010, 06:06:34 PM

Title: Determine and set %bankbox variable
Post by: NObama on February 16, 2010, 06:06:34 PM
I script.  I script a lot.  I script on four different shards using 82 different characters.

Hi, my name is NObama and I am an EUOholic.

I get tired of setting %bankbox variables manually.  This helps.

 :)

Code: [Select]
;=============================================================
;NObama go tired of setting bankbox values for his bajillion
;different slaves on every shard.  This takes care of that
;for you.
;
;Be warned: This script is tremendously powerful.
;Use only for good
;^o^
;=============================================================
sub get_bankbox
set %bankbox N/A ;substitute your script's bankbox variable name for %bankbox
while %bankbox = N/A
{
msg bank$
scanjournal 1
      if items in #journal
         set %bankbox #contid
}
return
;=============================================================
Title: Re: Determine and set %bankbox variable
Post by: manwinc on February 17, 2010, 09:04:56 AM
Hmm..... Something that Might work a little better would be checking the #contsize as Opposed to journal, in case some noob is running around spamming buying items or something ridiculous Like that.

I'm at school right now and Haven't copied any of my scripts onto a usb, but I THINK Thats how my Sub Cont_Timer works in some of my newer scripts... COuld be Very Very Very Wrong. Of course this is an Infinite Loop, so you had better be able to access your bank from where you are or else the script will just Cry about it. Might change the MSG BANK$ to event macro so you don't have that problem, then simply put a

if #result
return

after the gosub Cont_Timer (it returns #true if it Fails to do what you asked, which was to wait a maximum of 2 seconds for #contsize to = %bank_Contsize)

Code: [Select]
set %Bank_Contsize
Repeat
Msg Bank$
Gosub Cont_Timer 20 Contsize %Bank_Contsize
until #contsize = %Bank_Contsize
set %Bankbox #contid

Sub Cont_Timer
Namespace Push
Namespace Local Mwinc_Cont_Timer
if %0 = 0
{
; Lol, Just saw this used in a script of tm's and I liked it. Although I think there should be a set %Mwinc_Thinks_You_Are_A_nub True in here....
Namespace Pop
Return #True
}
set !Time_Limit #Scnt2 + %1
set !Cont_Check # . %2
While !Cont_Check <> %3 && !Time_Limit > #scnt2
{
wait 1
set !Cont_Check # . %2
}
if !Time_Limit < #scnt2
{
Namespace Pop
return #True
}
Namespace Pop
Return #False
Title: Re: Determine and set %bankbox variable
Post by: NObama on February 17, 2010, 02:35:55 PM
Ah - A much more elegant solution!  I tend to do my script banking in remote locations, so I didn't worry about infinite bank spams - but I did think about 'em briefly!

 ;)