Thanks for a quick reply guys.
You are not understanding how moveTo works. item:moveTo("bag1") moves 'item' to bag1, not the item you are holding with your mouse. moveTo deals with items in your inventory. Because you are taking an item from your bank you need to use the "PickUp" functions, as you know.
Yes well basicly that was the reason why i turned to you guys for help - couldnt work out the function to do that work

but thanks to your hints i went on the right track.
That "Pickup" function wasnt so easy to work out either

took me a while to find out that it needs a second argument ( as where is should look for item ) as it was keep trying to find those pots in the bank slots / finding free slots not in the bag ( item shop bag )
How you are going to know which bank slot to pick up, I'm not sure.
I have reserved 5 first slots in the bank just for pot swapping and i use the code below to to put it there:
Code: Select all
bank_table = {};
player:target_NPC("Housekeeper");
sendMacro("SpeakFrame_ListDialogOption(1, 4)"); yrest(1500); -- opening the bank box
if( inventory:itemTotalCount(207200) > 0 ) then -- Unbridled Enthusiasm
inventory:useItem(207200)
inventory:update()
yrest(750)
table.insert(bank_table,"Potion: Unbridled Enthusiasm")
end
if( inventory:itemTotalCount(207202) > 0 ) then -- Clear Thought
inventory:useItem(207202)
yrest(1000)
inventory:update()
yrest(750)
table.insert(bank_table,"Potion: Clear Thought")
end
if( inventory:itemTotalCount(207203) > 0 ) then -- Turn of Luck Powder Dust
inventory:useItem(207203)
inventory:update()
yrest(750)
table.insert(bank_table,"Potion: Turn of Luck Powder Dust")
end
if( inventory:itemTotalCount(207210) > 0 ) then -- Smoked Bacon with Herbs
inventory:useItem(207210)
inventory:update()
yrest(750)
table.insert(bank_table,"207210")
end
sendMacro("CloseWindows()");
Than thanks to you guys i managed to put together a code to pick up those pots from the bank :
Code: Select all
if (#bank_table ~= 0 ) then
player:target_NPC("Housekeeper"); -- Pick Up Pots from Bank
sendMacro("SpeakFrame_ListDialogOption(1, 4)"); yrest(1500); -- opening the bank
for i,v in ipairs(bank_table) do
sendMacro("PickupBankItem("..i..");") ;yrest(500);
toslot = inventory:findItem(v,"bag1")
if toslot then
print ("Found same item (",v, ") will try to stack them at slot.");
RoMScript("PickupBagItem("..toslot.BagId..")")
else
toslot = inventory:findItem(0,"bags")
print ("Cant find any stackable item in backpack - (",v, ") will be placed in first empty slot.")
RoMScript("PickupBagItem("..toslot.BagId..")")
end
end
sendMacro("CloseWindows()"); -- closing the bank
else
printf("No bank items to retrieve\n");
end
Tried to work out the CursorHasItem() function -but gave up after a while - as i doubt it will ever overstack.
Once again thanks for all help
