Merkapa
09-14-2015, 04:27 PM
hello
how to use option "eater"? i dont have in trail versions "tools"...
why bot attacking only second monster from battle? how to fix it?
are this bot can recognize summons?
thank u
anoyn
09-14-2015, 10:51 PM
The eat food checkbox is disabled for the trial version.
You can use a community created script to do this.
Paste this into a file as save as something.lua
Save it to this location Documents/Xenobot/Scripts
in game ctrl click yourself > Scripts > Something.lua > Execute
--Food eater/dropper by anoyn
--What does it do:
-- Drops excess food open backpacks under self
-- randomized delay
-- wont spam throw or spam eat
-- ignores specific food ids found in "ignoreTheseFoodIDs" in config
--What do you do?
-- Set xenobot's looter to pickup food
-- Keep config as it is or edit to your liking
--[[CONFIG]]
ignoreTheseFoodIDs = { 12345123, 99999 }
dropFoodIfCountAbove = 5 -- Drop food if you have more than this
delayBetweenEatingFood = 20 -- wait this many seconds before eating food again
delayBetweenDroppingFood = 20 -- wait this many seconds before dropping food again
moduleDelay = 5000 -- Check if you can drop/eat every this milliseconds
moduleDelayRandomization = 2000 --Ex, if delay set to 5000 and this is 2000, delay will be between 3 and 7 seconds
--[[SCRIPT]]
print("Food eater running")
lastEatFood = 0
Module.New('eatFood', function(eatFood)
if os.time() - lastEatFood >= delayBetweenEatingFood then
local ateFood = false
for i = 0, #Container.GetAll() do
for spot = Container(i):ItemCount() - 1, 0, -1 do
if Item.isFood( Container(i):GetItemData(spot).id ) and not table.find( ignoreTheseFoodIDs, Container(i):GetItemData(spot).id, false) then
--Food Found eating
Container(i):UseItem(spot, true)
lastEatFood = os.time()
ateFood = true
break
end
end
if ateFood then
--ate food, skip looking at other bps
break
end
end
end
eatFood:Delay(math.random(moduleDelay - moduleDelayRandomization, moduleDelay + moduleDelayRandomization) )
end)
lastDropFood = 0
Module.New('countFood', function(countFood)
if os.time() - lastDropFood >= delayBetweenDroppingFood then
local foodCount = 0
for i = 0, #Container.GetAll() do
for spot = Container(i):ItemCount() - 1, 0, -1 do
if Item.isFood( Container(i):GetItemData(spot).id ) and not table.find( ignoreTheseFoodIDs, Container(i):GetItemData(spot).id, false) then
local itemData = Container(i):GetItemData(spot)
foodCount = itemData.count + foodCount
end
end
end
--Check if have too much food
if foodCount > dropFoodIfCountAbove then
local dropped = false
for i = 0, #Container.GetAll() do
for spot = Container(i):ItemCount() - 1, 0, -1 do
if Item.isFood( Container(i):GetItemData(spot).id ) and not table.find( ignoreTheseFoodIDs, Container(i):GetItemData(spot).id, false) then
local itemData = Container(i):GetItemData(spot)
local myPos = Self.Position()
lastDropFood = os.time()
--if the pile is larger than limit, drop partial
if itemData.count > dropFoodIfCountAbove then
local drop = itemData.count - dropFoodIfCountAbove
Container(i):MoveItemToGround(spot, myPos.x, myPos.y, myPos.z, drop)
-- Large pile , drop partial amount
dropped = true
break
else
--pile not larger than limit, drop all
Container(i):MoveItemToGround(spot, myPos.x, myPos.y, myPos.z, itemData.count)
dropped = true
break
end
end
end
if dropped then
--ate food, skip looking at other bps
break
end
end
end
end
countFood:Delay(math.random(moduleDelay - moduleDelayRandomization, moduleDelay + moduleDelayRandomization) )
end)
walber
03-29-2017, 05:14 PM
He throws my brown mushrooms down. How to solve this?:confused:
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.