View Full Version : Check if hole is covered
The bot should check if something is on the hole blocking it from using the shovel and then move the item, this could help a lot.
Nostrax
02-25-2013, 11:30 AM
Need that one to! :D
Infernal Bolt
02-25-2013, 11:42 AM
it would be quite easy to make.
local HOLE_ID = 0 --Change it to the closed hole ID
local HOLE_X = 11111 --Change it to the hole X-coordinate
local HOLE_Y = 22222 --Change it to the hole Y-coordinate
local MOVE_X = 33333 --Change it to the X-coordinate of where to move items to
local MOVE_Y = 44444 --Change it to the Y-coordinate of where to move items to
local MAX_TRIES = 50 --Maximum tries to move items before alarm goes off
--DO NOT EDIT BELOW!
local TRIES_DONE = 0
while (Map.GetTopMoveItem(HOLE_X, HOLE_Y, Self.Position().z).id) ~= HOLE_ID) do
if (TRIES_DONE < MAX_TRIES) then
Map.MoveItem(HOLE_X, HOLE_Y, MOVE_X, MOVE_Y, 100)
wait(500, 1000)
TRIES_DONE = TRIES_DONE+1
else
alarm()
wait(5000)
end
wait(100)
end
Thanks a lot for this! I did not know about the Map.MoveItem() function.
Couldn't this by built into the bot in some way so that it does it automatically at hole waypoints? It is a pretty basic protection that everyone needs running.
I get an error when running this! I don't think the Map.MoveItem() function exists. Do I need an external library or something?
16:41 XenoScript Error:
Line #: 72
Error: attempt to call field 'MoveItem' (a nil value)
soul4soul
02-25-2013, 10:52 PM
Thanks a lot for this! I did not know about the Map.MoveItem() function.
Couldn't this by built into the bot in some way so that it does it automatically at hole waypoints? It is a pretty basic protection that everyone needs running.
I get an error when running this! I don't think the Map.MoveItem() function exists. Do I need an external library or something?
16:41 XenoScript Error:
Line #: 72
Error: attempt to call field 'MoveItem' (a nil value)
http://forums.xenobot.net/showthread.php?11470-Update-XenoBot-v3.0.5
Guess I need the new version..... I have only been using the bot for about 7 days. I was under the impression that it would update on its own.
Thanks for all the help guys.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.