maxo10

walkloop

Sep 19th, 2021 (edited)
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local stepsCompleted = 0
  2. local fuel = turtle.getFuelLevel()
  3.  
  4. if os.getComputerLabel() ~= "derp" then os.setComputerLabel("derp") end
  5.  
  6. local function clear() --clears the terminal
  7.     term.clear()
  8.     term.setCursorPos(1,1)
  9.     print(fuel)
  10.     if fuel == "unlimited" then
  11.         print("No fuel needed! Let's work...")
  12.     elseif fuel == 0
  13.         then turtle.refuel()
  14.     end
  15. end
  16.  
  17. local function circles()
  18.     turtle.forward()
  19.     turtle.turnRight()
  20. end
  21.  
  22. clear()
  23. print("Starting loop!")
  24.  
  25. for i = 1, 4 do
  26.     circles()
  27.     stepsCompleted = stepsCompleted + 1
  28.     print(stepsCompleted)
  29. end
  30.  
Add Comment
Please, Sign In to add comment