mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-12-15 16:39:47 +01:00
Updated to OTCv8 3.0 rev 19
This commit is contained in:
76
modules/game_bot/default_configs/vBot/z_depot_withdraw.lua
Normal file
76
modules/game_bot/default_configs/vBot/z_depot_withdraw.lua
Normal file
@@ -0,0 +1,76 @@
|
||||
-- config
|
||||
setDefaultTab("Tools")
|
||||
local defaultBp = "shopping bag"
|
||||
local id = 21411
|
||||
|
||||
-- script
|
||||
|
||||
local playerContainer = nil
|
||||
local depotContainer = nil
|
||||
local mailContainer = nil
|
||||
|
||||
function reopenLootContainer()
|
||||
for _, container in pairs(getContainers()) do
|
||||
if container:getName():lower() == defaultBp:lower() then
|
||||
g_game.close(container)
|
||||
end
|
||||
end
|
||||
|
||||
local lootItem = findItem(id)
|
||||
if lootItem then
|
||||
schedule(500, function() g_game.open(lootItem) end)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
macro(50, "Depot Withdraw", function()
|
||||
|
||||
-- set the containers
|
||||
if not potionsContainer or not runesContainer or not ammoContainer then
|
||||
for i, container in pairs(getContainers()) do
|
||||
if container:getName() == defaultBp then
|
||||
playerContainer = container
|
||||
elseif string.find(container:getName(), "Depot") then
|
||||
depotContainer = container
|
||||
elseif string.find(container:getName(), "your inbox") then
|
||||
mailContainer = container
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if playerContainer and #playerContainer:getItems() == 20 then
|
||||
for j, item in pairs(playerContainer:getItems()) do
|
||||
if item:getId() == id then
|
||||
g_game.open(item, playerContainer)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if playerContainer and freecap() >= 200 then
|
||||
local time = 500
|
||||
if depotContainer then
|
||||
for i, container in pairs(getContainers()) do
|
||||
if string.find(container:getName(), "Depot") then
|
||||
for j, item in pairs(container:getItems()) do
|
||||
g_game.move(item, playerContainer:getSlotPosition(playerContainer:getItemsCount()), item:getCount())
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if mailContainer then
|
||||
for i, container in pairs(getContainers()) do
|
||||
if string.find(container:getName(), "your inbox") then
|
||||
for j, item in pairs(container:getItems()) do
|
||||
g_game.move(item, playerContainer:getSlotPosition(playerContainer:getItemsCount()), item:getCount())
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end)
|
||||
Reference in New Issue
Block a user