Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Code for a turtle acting as a Guard for the Tomb of the Unknown Soldier
- -- Place turtle at northern end of the path (with tomb to it's left), and place
- -- fuel in turtle's inventory. If it drops below 100 fuel, it will stop at the
- -- northern end of the path, and wait for someone to refuel it, and then
- -- auto-resume
- while true do
- if turtle.getFuelLevel() < 100 then
- print("Out of fuel! Waiting for more...")
- repeat
- os.sleep(10)
- for i=1,16 do
- turtle.select(i)
- turtle.refuel()
- end
- until turtle.getFuelLevel() >= 100
- end
- os.sleep(21)
- for i=1,21 do
- repeat
- local success = turtle.forward()
- until success
- end
- turtle.turnLeft()
- os.sleep(21)
- turtle.turnLeft()
- os.sleep(21)
- for i=1,21 do
- repeat
- local success = turtle.forward()
- until success
- end
- turtle.turnRight()
- os.sleep(21)
- turtle.turnRight()
- end
Advertisement
Add Comment
Please, Sign In to add comment