PDA

View Full Version : move items from bp to bp with checker



mihelox123
07-17-2016, 06:51 PM
Hello!
Im Looking for script which :
move items from the backpack to backpack. but if i choose ( 200 mana potions ) he take only 200 manas
soo

i need move items with itemcount

thanks, Mihelox here :rolleyes:

melimao
07-21-2016, 04:50 PM
XtrmJosh script
buy potion with check. (Label name - BuyMana)




local BuyMana = 200 --- How many mana potions you begin the hunt with?
local ManaName = "Strong Mana Potion" --- Change potion name
local ManaCost = 80 --- Potion cost
local ManaID = Item.GetID(ManaName)

-- These are the flask IDs, not worth changing since it will sell all flasks regardless of type.
local FlaskID = 283
local FlaskIDA = 284
local FlaskIDB = 285

function onWalkerSelectLabel(labelName)
elseif (labelName == "BuyMana") then
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 100)
-- Buy manas, make sure Self.ItemCount returns items in hands.
while (Self.ItemCount(ManaID) < BuyMana) do
Self.ShopBuyItemsUpTo(ManaID, BuyMana)
wait(500,800)
end
Walker.Start()
end
end



got this one on random post.
move item while buying potions. (No Label)


Module.New('SuppMover', function(suppmovemodule)
local ManaID = 237 --- Strong Mana Potion
local ManasBP = "Yellow Backpack"
local items = {ManaID}

bp1 = Container(0)
for spot, item in bp1:iItems() do
if (table.contains(items, item.id)) then
bp1:MoveItemToContainer(spot, Container.New(ManasBP):Index())
end
end
suppmovemodule:Delay(500, 1000)
end)

nmmoore
10-22-2016, 01:41 AM
Would you know how to move crystalline arrows from my dp, to my fourth backpack, which would be my ammo bp?

Pat
11-03-2017, 01:43 AM
XtrmJosh script
buy potion with check. (Label name - BuyMana)

got this one on random post.
move item while buying potions. (No Label)




This can be modified really easily to move a list of items to a backpack (the infrastructure already exists, it's just referencing an inefficient local variable). For example, if you want it to move all your different potions or created runes / ammo without running multiple scripts - just throw in all of the item IDs you want moved to your ammo / rune / pots backpack.





Module.New('SuppMover', function(suppmovemodule)
local ManasBP = "Yellow Backpack" --- Backpack name / label. Use different coloured backpacks as your first backpack
local items = {3161, 3147} --- Item ID list

bp1 = Container(0)
for spot, item in bp1:iItems() do
if (table.contains(items, item.id)) then
bp1:MoveItemToContainer(spot, Container.New(ManasBP):Index())
end
end
suppmovemodule:Delay(500, 800)
end)



Note: There's no error checking, if the backpack is full, your client will just loop a "You cannot put more objects...." error. If anyone is a bit of a perfectionist and would like to help complete this just for the sake of it, that'd be awesome.

You can also have multiple backpacks - see my really crude, amateurish example below. Again, if anyone feels the need to improve it feel free to, but it works:




Module.New('SuppMover', function(suppmovemodule)
local ManasBP = "Yellow Backpack"
local FoodBP = "Moon Backpack"
local ManasList = {3161, 3147}
local FoodList = {3725}

bp1 = Container(0)
for spot, item in bp1:iItems() do
if (table.contains(ManasList, item.id)) then
bp1:MoveItemToContainer(spot, Container.New(ManasBP):Index())
elseif (table.contains(FoodList, item.id)) then
bp1:MoveItemToContainer(spot, Container.New(FoodBP):Index())
end
end
suppmovemodule:Delay(500, 800)
end)




Thanks for the original code, this helped me :)