01-01-2021, 07:23 PM
Happy new year everyone!
I am using the script > "Drop loot inside a container (backpack,bag, etc.)" can be found here
He works just fine until the lootbag is full, the bot don't open the next bp inside of the lootbag.
Someone can help me to fix that? Thank you in advance alt="Big Grin" title="Big Grin" class="smilie smilie_4" />
The Action Code:
local ItemsDrop = { 'plate armor', 'Small Stone' } -- Items that you wanna drop inside the container.
local BackpackLoot = 'Beach Backpack' -- Backpack that you are carrying to keep loots, it will drop FROM this backpack.
local DropBagPosition = { X = 32785, Y = 32514, Z = 7 } -- Container's location that you wanna open and drop items inside.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ CREDITS TO ARKILYS --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
local startWindowsCount = windowcount()
local currentWindowsCount = -1
for i = 0, 5 do
openitem(0, ground(DropBagPosition.X, DropBagPosition.Y, DropBagPosition.Z), true)
wait(1000, 1200)
currentWindowsCount = windowcount()
if currentWindowsCount > startWindowsCount then
break
end
end
if currentWindowsCount > startWindowsCount then
table.id(ItemsDrop)
local bagIndex = currentWindowsCount - 1
local bagContainer = getcontainer(bagIndex)
if tempOpenNextContainer == nil then
function tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots > 0 then
while bagContainer.maxslots == bagContainer.usedslots and bagContainer.maxslots > 0 do
local foundContainer = false
for _, bagItem in ipairs(bagContainer.items) do
if itemhasflags(bagItem.id, 4) then
foundContainer = true
openitem(bagItem.id, bagContainer.index)
wait(1200, 1500)
bagContainer = getcontainer(bagContainer.index)
break
end
end
if foundContainer == false then
break
end
end
end
return bagContainer
end
end
bagContainer = tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
if emptyLeft > 0 then
for _, item in ipairs(ItemsDrop) do
while itemcount(item, BackpackLoot) > 0 do
if emptyLeft == 0 then
bagContainer = tempOpenNextContainer(getcontainer(bagContainer.index))
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
if emptyLeft == 0 then
break
end
end
end
moveitems(item, bagContainer.index, BackpackLoot, 100)
wait(300)
emptyLeft = emptyLeft - 1
end
end
end
end
end
I am using the script > "Drop loot inside a container (backpack,bag, etc.)" can be found here
He works just fine until the lootbag is full, the bot don't open the next bp inside of the lootbag.
Someone can help me to fix that? Thank you in advance
The Action Code:
local ItemsDrop = { 'plate armor', 'Small Stone' } -- Items that you wanna drop inside the container.
local BackpackLoot = 'Beach Backpack' -- Backpack that you are carrying to keep loots, it will drop FROM this backpack.
local DropBagPosition = { X = 32785, Y = 32514, Z = 7 } -- Container's location that you wanna open and drop items inside.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ CREDITS TO ARKILYS --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
local startWindowsCount = windowcount()
local currentWindowsCount = -1
for i = 0, 5 do
openitem(0, ground(DropBagPosition.X, DropBagPosition.Y, DropBagPosition.Z), true)
wait(1000, 1200)
currentWindowsCount = windowcount()
if currentWindowsCount > startWindowsCount then
break
end
end
if currentWindowsCount > startWindowsCount then
table.id(ItemsDrop)
local bagIndex = currentWindowsCount - 1
local bagContainer = getcontainer(bagIndex)
if tempOpenNextContainer == nil then
function tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots > 0 then
while bagContainer.maxslots == bagContainer.usedslots and bagContainer.maxslots > 0 do
local foundContainer = false
for _, bagItem in ipairs(bagContainer.items) do
if itemhasflags(bagItem.id, 4) then
foundContainer = true
openitem(bagItem.id, bagContainer.index)
wait(1200, 1500)
bagContainer = getcontainer(bagContainer.index)
break
end
end
if foundContainer == false then
break
end
end
end
return bagContainer
end
end
bagContainer = tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
if emptyLeft > 0 then
for _, item in ipairs(ItemsDrop) do
while itemcount(item, BackpackLoot) > 0 do
if emptyLeft == 0 then
bagContainer = tempOpenNextContainer(getcontainer(bagContainer.index))
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
if emptyLeft == 0 then
break
end
end
end
moveitems(item, bagContainer.index, BackpackLoot, 100)
wait(300)
emptyLeft = emptyLeft - 1
end
end
end
end
end

