PDA

View Full Version : Problem with moving items script!



tassius
01-23-2019, 06:22 AM
Hello scripters! Im having a problem with this script. It jumps a loot backpack. Example, it open a backpack, and fill them with loot, after that, it jump to the next, and jump again!


------------------------------ CONFIG --------------------------
local FoodID = {3725, 3731}
local PotID = {23374, 7642, 23375, 268}
local NoMove = {3191, 3161, 3180, 3148, 3202, 3192, 3160, 3723, 10326, 5926, 5801, 9602, 9016, 2858, 3723, 5942, 2866, 28718, 9596, 20270, 3155, 2867, 3161, 9058, 5929, 8860, 3191, 3031, 3035, 3043, 14112, 23525, 3253, 9605, 10327, 6529, 3549, 4033, 3097, 10202, 22084, 18339, 3450, 9601, 6528, 15793, 25758, 25757}

local indexOfFoodBackpack = 0 -- Name, index or id of container - local onde devem ficar os food
local indexOfSuplyBackpack = 4 -- Name, index or id of container - local onde devem fica os pot
local indexOfLootBackpack = 1 -- Name, index or id of container - local onde devem ficar os loot

----------------------------- MOVE ITENS --------------------------
Module.New('Mover', function(movemod)
bp1 = Container(0)
for spot, item in bp1:iItems() do
if (table.contains(FoodID, item.id)) then
bp1:MoveItemToContainer(spot, Container.New(indexOfFoodBackpack):Index())
wait(500)
elseif (table.contains(PotID, item.id)) then
bp1:MoveItemToContainer(spot, Container.New(indexOfSuplyBackpack):Index())
wait(500)
elseif (item.id ~= table.contains(NoMove, item.id)) then
while true do
local pos = Self.Position()
if Container(indexOfLootBackpack):isOpen() then
if Container(indexOfLootBackpack):isFull() then
for spot = Container(indexOfLootBackpack):ItemCount() - 1, 0, -1 do
if Item.isContainer(Container(indexOfLootBackpack):Ge tItemData(spot).id) then
Container(indexOfLootBackpack):UseItem(spot, true)
wait(500)
end
end
else
bp1:MoveItemToContainer(spot, Container.New(indexOfLootBackpack):Index(), Container(indexOfLootBackpack):ItemCapacity()-1)
wait(500)
break
end
end
end
end
end
movemod:Delay(500, 1000)
end)