Advertisement
guitarplayer616

spiral

Feb 1st, 2022
1,713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. -- code for turtle to harvest botany pots in a spiral
  2. -- must put stick in 1st slot
  3.  
  4. local count = 1
  5.  
  6. function inc(num)
  7.   num = num or 1
  8.   for i=1,num do
  9.     turtle.placeUp()
  10.     turtle.placeDown()
  11.     turtle.forward()
  12.   end
  13. end
  14.  
  15. inc()
  16. turtle.turnRight()
  17. inc(2)
  18. turtle.turnRight()
  19. inc(2)
  20. turtle.turnRight()
  21. inc(3)
  22. turtle.turnRight()
  23. inc(3)
  24. turtle.turnRight()
  25. inc(4)
  26. turtle.turnRight()
  27. inc(4)
  28. turtle.turnRight()
  29. inc(5)
  30. turtle.turnRight()
  31. inc(5)
  32. turtle.turnRight()
  33. inc(2)
  34. turtle.turnRight()
  35. inc(3)
  36. turtle.turnRight()
  37. turtle.turnRight()
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement