Advertisement
Dr_Turtle

Untitled

Jun 27th, 2021
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. args = {...}
  2. loops = args[1]
  3. delay = args[2]
  4.  
  5.  
  6. turtle.select(1)
  7.  
  8.  
  9. function main(loops, delay)
  10. for j = 1,loops do
  11. for i = 1,4 do
  12. turtle.strip()
  13. turnEnd("R")
  14. turtle.strip()
  15. turnEnd("L")
  16. end
  17. strip()
  18. turtle.turnLeft()
  19. for i = 1,8 do
  20. turtle.forward()
  21. end
  22. turtle.turnLeft()
  23. for i = 1,8 do
  24. turtle.forward()
  25. end
  26. turtle.turnLeft()
  27. turtle.turnLeft()
  28. sleep(delay)
  29. end
  30. end
  31.  
  32. function turnEnd(direction)
  33. if direction == "R" then
  34. turtle.turnRight()
  35. turtle.forward()
  36. turtle.turnRight()
  37. elseif direction == "L" then
  38. turtle.turnLeft()
  39. turtle.forward()
  40. turtle.turnLeft()
  41. end
  42.  
  43. function strip()
  44. turtle.placeDown()
  45. for i = 1,8 do
  46. turtle.forward()
  47. turtle.placeDown()
  48. end
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement