Log in

View Full Version : Food script



Dreazil
07-10-2016, 03:27 PM
Hello, im testing Xenobot on Trial version and there's no Tool like "eat food". Its why i wrote it. I need .lua script who will be eating food from bp (brown mushrooms). Sry for my englado but i hope u can understand this :)

Oscagi
07-10-2016, 03:57 PM
Hello, im testing Xenobot on Trial version and there's no Tool like "eat food". Its why i wrote it. I need .lua script who will be eating food from bp (brown mushrooms). Sry for my englado but i hope u can understand this :)


Module.New('Eat_Food', function(eat)
for i = 0, #Container.GetAll() do
local cont = Container(i)
for spot = 0, cont:ItemCount() do
if (Item.isFood(cont:GetItemData(spot).id)) then
cont:UseItem(spot)
end
end
end
eat:Delay(180000) -- will eat every 3 mins
end)

Dreazil
07-10-2016, 08:53 PM
Module.New('Eat_Food', function(eat)
for i = 0, #Container.GetAll() do
local cont = Container(i)
for spot = 0, cont:ItemCount() do
if (Item.isFood(cont:GetItemData(spot).id)) then
cont:UseItem(spot)
end
end
end
eat:Delay(180000) -- will eat every 3 mins
end)


Thanks you m8. Works great!

7.4
07-12-2016, 09:14 AM
Hello, im testing Xenobot on Trial version and there's no Tool like "eat food". Its why i wrote it. I need .lua script who will be eating food from bp (brown mushrooms). Sry for my englado but i hope u can understand this :)

Can also be found under Tools I think.