Neopherus

widelog

Apr 11th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. --Variables
  2. tArgs = { ... }
  3. local width = tonumber(tArgs[1])
  4.  
  5.  
  6. --Functions
  7. function turnaround()
  8. turtle.turnRight()
  9. turtle.turnRight()
  10. end
  11.  
  12. function nextRow()
  13. turtle.forward()
  14. turtle.turnLeft()
  15. turtle.forward()
  16. turtle.turnLeft()
  17. end
  18.  
  19. --Main
  20. for w = 1,width do
  21. turtle.dig()
  22. turtle.forward()
  23.  
  24. while turtle.detectUp() do
  25. sleep(0.25)
  26. turtle.dig()
  27. turtle.digUp()
  28. turtle.up()
  29. end
  30. while not turtle.detectDown() do
  31. sleep(0.1)
  32. turtle.down()
  33. end
  34. turnaround()
  35. nextRow()
  36. end
Advertisement
Add Comment
Please, Sign In to add comment