Neopherus

2x2

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