Advertisement
fsadfasfSA

Untitled

Jan 21st, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. pos = { x = 0, y = 0 }
  2.  
  3. function checkFuel()
  4.     if(turtle.getFuelLevel() < 2) then
  5.         if(not(turtle.refuel(1))) then
  6.             print("Out of fuel!")
  7.         end
  8.     end
  9. end
  10.  
  11. function forward()
  12.     checkFuel()
  13.     if(turtle.forward()) then
  14.         pos.x = pos.x + 1
  15.     end
  16. end
  17.  
  18. function back()
  19.     checkFuel()
  20.     if(turtle.back()) then
  21.         pos.x = pos.x - 1
  22.     end
  23. end
  24.        
  25. while true do
  26.     print("eat dick")
  27.     forward()
  28.     os.sleep( 1 )
  29.     back()
  30.     os.sleep( 1 )
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement