11-05-2022, 11:51 PM
Hello.
Eat food script.
This script is useful when Options -> Eat Food is not eating a specific food you wanna eat. This happens because game-client doesn't tells if an item is a food or not, so i've to manually add each food on Bot.
This link will help you to find what's the item id of an item, so you can find food's id:
Eat food script.
This script is useful when Options -> Eat Food is not eating a specific food you wanna eat. This happens because game-client doesn't tells if an item is a food or not, so i've to manually add each food on Bot.
This link will help you to find what's the item id of an item, so you can find food's id:
local EAT_TRIES = { Min = 2, Max = 15 }
local FOODS_IDS = { 1234, 1234 } -- Foods ids you wanna eat.
local EAT_TIME = { Min = 300, Max = 480, } -- In SECONDS. Time to wait after eating food to eat again.
local STOP_FULL = false -- Stops eating when you are full message shows up.
NEXT_EAT_TIME = NEXT_EAT_TIME or 1
if connected() and runningtime() >= NEXT_EAT_TIME then
local eatCount = 0
local maxEatCount = random(EAT_TRIES.Min, EAT_TRIES.Max)
for _, food in ipairs(FOODS_IDS) do
if itemcount(food) > 0 then
for i = eatCount, maxEatCount do
useitem(food, '')
wait(400, 800)
eatCount = eatCount + 1
if STOP_FULL and statusmessage() == 'You are full.' then
break
end
end
end
if eatCount >= maxEatCount then
break
end
end
NEXT_EAT_TIME = runningtime() + random(EAT_TIME.Min, EAT_TIME.Max)
end