Advertisement
DustinRosebery

platform1.1

May 24th, 2016
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. left = true
  2. slot = 1
  3.  
  4.  
  5. -- Checks for Empty slot and switches if empty
  6.  
  7. local function slotCheck()
  8. if turtle.getItemCount() == 0 then
  9. slot = slot + 1
  10. end
  11. turtle.select(slot)
  12. end
  13.  
  14.  
  15. -- Startup prompt
  16. print("Platform dimensions, Width to the left and depth straight ahead.")
  17. print("Enter a width")
  18. width = read()
  19. print("Enter a depth")
  20. depth = read()
  21.  
  22.  
  23. -- Start of turtle movement
  24.  
  25. for i = 1, width do
  26.  
  27. for j = 1, depth do
  28.  
  29. slotCheck()
  30. turtle.placeDown()
  31. turtle.forward()
  32.  
  33. end
  34.  
  35. if left == true then
  36. turtle.turnLeft()
  37. turtle.forward()
  38. turtle.turnLeft()
  39. turtle.forward()
  40. left = false
  41. else
  42. turtle.turnRight()
  43. turtle.forward()
  44. turtle.turnRight()
  45. turtle.forward()
  46. left = true
  47.  
  48. end
  49.  
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement