Advertisement
TitanChase

Untitled

Aug 18th, 2020 (edited)
1,991
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local robot = require("robot")
  2. local computer = require("computer")
  3.  
  4.  
  5. function gotoRecharge()
  6.     robot.turnLeft()
  7.     robot.forward()
  8.     robot.forward()
  9. end
  10.  
  11. function leaveRecharge()
  12.     robot.back()
  13.     robot.back()
  14.     robot.turnRight()
  15. end
  16.  
  17. function recharge()
  18.     while computer.energy() / computer.maxEnergy() < 0.95 do
  19.         os.sleep(1)
  20.     end
  21. end
  22.  
  23. gotoRecharge()
  24. recharge()
  25. leaveRecharge()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement