Looting regs from bank

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Nazgul
Posts: 9
Joined: 2004-06-01 12:50:42

Looting regs from bank

Post by Nazgul »

Code: Select all

sub loot() 
UO.FindType("0x0F88","-1","container")  #NightShade
UO.Grab("50","finditem")
UO.FindType("0x0F85","-1","container")  #Gingseng
UO.Grab("50","finditem")
UO.FindType("0x0F7B","-1","container")  #BloodMoss
UO.Grab("50","finditem")
UO.FindType("0x0F8C","-1","container")  #Sulfour's Ash
UO.Grab("50","finditem")
UO.FindType("0x0F86","-1","container")  #Mandrake Roots
UO.Grab("50","finditem")
UO.FindType("0x0F84","-1","container")  #Garlic
UO.Grab("50","finditem")
UO.FindType("0x0F8D","-1","container")  #Spider's Silk
UO.Grab("50","finditem")
UO.FindType("0x0F7A","-1","container")  #Black Pearl's
UO.Grab("50","finditem")
end sub


I'm trying to make script that loots 50 of each reg from the bank when i open bank and say ,exec loot. But i get error: "invalid object: 0" 8 times and script stops without taking any regs :(. Anyone know where is the problem?
BETEPAH
Expert!
Posts: 838
Joined: 2004-05-31 09:31:51
Contact:

Post by BETEPAH »

Try This



sub Reagents()
VAR StoreRegCont=0x400271DE
VAR CharRegBag='CharRegBag'
VAR CountReg=30
VAR WaitTime=600
VAR MainSafe=0x40057901

uo.print('Choose BAG for regs')
uo.exec('addobject CharRegBag')
while uo.targeting()
wait(100)
wend

UO.UseObject(MainSafe)
UO.UseObject(StoreRegCont)

UO.SetReceivingContainer(CharRegBag)
wait(WaitTime)

if UO.BM<CountReg then
UO.FindType('0x0F7B','-1',StoreRegCont) ; BM
UO.Grab(STR((CountReg-UO.BM)),'finditem')
wait(WaitTime)
endif

if UO.BP<CountReg then
UO.FindType('0x0F7A','-1',StoreRegCont) ; BP
UO.Grab(STR(CountReg-UO.BP),'finditem')
wait(WaitTime)
endif

if UO.GA<CountReg then
UO.FindType('0x0F84','-1',StoreRegCont) ; GA
UO.Grab(STR(CountReg-UO.GA),'finditem')
wait(WaitTime)
endif

if UO.GS<CountReg then
UO.FindType('0x0F85','-1',StoreRegCont) ; GS
UO.Grab(STR(CountReg-UO.GS),'finditem')
wait(WaitTime)
endif

if UO.MR<CountReg then
UO.FindType('0x0F86','-1',StoreRegCont) ; MR
UO.Grab(STR(CountReg-UO.MR),'finditem')
wait(WaitTime)
endif

if UO.NS<CountReg then
UO.FindType('0x0F88','-1',StoreRegCont) ; NS
UO.Grab(STR(CountReg-UO.NS),'finditem')
wait(WaitTime)
endif

if UO.SA<CountReg then
UO.FindType('0x0F8C','-1',StoreRegCont) ; SA
UO.Grab(STR(CountReg-UO.SA),'finditem')
wait(WaitTime)
endif

if UO.SS<CountReg then
UO.FindType('0x0F8D','-1',StoreRegCont) ; SS
UO.Grab(STR(CountReg-UO.SS),'finditem')
endif
end:
UO.UnsetReceivingContainer()
end sub
Post Reply