Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- -- Fuel check
- while true do
- fuelLevel = turtle.getFuelLevel()
- if fuelLevel <= 100 then
- print("Fuel level is too low, stopping program")
- return -- Exit the program completely
- end
- break -- Exit the fuel check loop and continue with the program
- end
- -- Perform actions
- function compFarmDown()
- if turtle.detectDown() == true then
- turtle.digDown()
- turtle.placeDown()
- end
- end
- function compForward()
- compFarmDown()
- turtle.forward()
- end
- function compBack()
- compFarmDown()
- turtle.back()
- end
- function forwardComp()
- turtle.forward()
- compFarmDown()
- end
- function backComp()
- turtle.back()
- compFarmDown()
- end
- function farmStart()
- compForward()
- compForward()
- compForward()
- compForward()
- compForward()
- compForward()
- compForward()
- compFarmDown()
- turtle.back()
- turtle.back()
- turtle.turnRight()
- turtle.forward()
- compForward()
- compForward()
- compFarmDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- compBack()
- compBack()
- compBack()
- compBack()
- compBack()
- compBack()
- compBack()
- compFarmDown()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- forwardComp()
- forwardComp()
- turtle.turnRight()
- forwardComp()
- turtle.turnRight()
- forwardComp()
- turtle.turnLeft()
- forwardComp()
- turtle.turnLeft()
- forwardComp()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- farmStart()
- -- Add delay to prevent the program from running too quickly
- os.sleep(600)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement