Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local computer = require("computer")
- function gotoRecharge()
- robot.turnLeft()
- robot.forward()
- robot.forward()
- end
- function leaveRecharge()
- robot.back()
- robot.back()
- robot.turnRight()
- end
- function recharge()
- while computer.energy() / computer.maxEnergy() < 0.95 do
- os.sleep(1)
- end
- end
- gotoRecharge()
- recharge()
- leaveRecharge()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement