mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-22 07:25:54 +02:00
Version 2.6.1
This commit is contained in:
29
modules/game_bot/default_configs/vithrax_1.3/eat_food.lua
Normal file
29
modules/game_bot/default_configs/vithrax_1.3/eat_food.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
setDefaultTab("HP")
|
||||
|
||||
UI.Separator()
|
||||
|
||||
UI.Label("Eatable items:")
|
||||
if type(storage.foodItems) ~= "table" then
|
||||
storage.foodItems = {3582, 3577}
|
||||
end
|
||||
|
||||
local foodContainer = UI.Container(function(widget, items)
|
||||
storage.foodItems = items
|
||||
end, true)
|
||||
foodContainer:setHeight(35)
|
||||
foodContainer:setItems(storage.foodItems)
|
||||
|
||||
|
||||
macro(500, "Eat Food", function()
|
||||
if player:getRegenerationTime() > 400 or not storage.foodItems[1] then return end
|
||||
-- search for food in containers
|
||||
for _, container in pairs(g_game.getContainers()) do
|
||||
for __, item in ipairs(container:getItems()) do
|
||||
for i, foodItem in ipairs(storage.foodItems) do
|
||||
if item:getId() == foodItem.id then
|
||||
return g_game.use(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
Reference in New Issue
Block a user