What I'm trying to do is somewhat complex. I have a bag in my house that hold my reagents. Sometimes, I get home with 4, 5 bags with regs of others players that I've looted. So, I want to :
1.) emptycontainer all those bags to my backpack
2.) Move all the regs in my backpack to the main reagent bag in my house
3.) Transfer 50 of each reagent from the main reagent bag to my reagent bag in my backpack.
I could write the steps 2 and 3, but not the one IF AND ONLY IF THERE'S TWO BAGS OF THE SAME KIND IN MY BACKPACK. I've tried this, please, someone help me:
Code: Select all
sub restock()
var i
dim a[8]
dim b[4]
b[0]="0x0E76"
b[1]="0x0E75"
b[2]="0x09A9"
b[3]="0x0E79"
for i = 0 to 3
UO.FindType(b[i],"-1","backpack")
if UO.FindCount() < 2 then
UO.EmptyContainer("0", "finditem", "backpack")
else
for j = 1 to UO.FindCount()
UO.EmptyContainer("0", "finditem[j]", "backpack")
end if
wait(90)
next
UO.Exec("set quiet 1")
UO.SetReceivingContainer("mainbagreg")
a[0]="0x0F86"
a[1]="0x0F7A"
a[2]="0x0F84"
a[3]="0x0F8D"
a[4]="0x0F8C"
a[5]="0x0F85"
a[6]="0x0F88"
a[7]="0x0F7B"
for i = 0 to 7
UO.FindType(a[i],"0","backpack")
UO.Grab("0","finditem")
wait(90)
next
UO.SetReceivingContainer("myregbag")
for i = 0 to 7
UO.FindType(a[i],"0","mainregbag")
UO.Grab("50","finditem")
wait(90)
next
UO.Exec("set quiet 0")
end sub