Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. params = {...}
  2.  
  3. floorLength = tonumber(params[1])
  4. floorWidth = tonumber(params[2])
  5.  
  6. currentSlot = 1
  7.  
  8.  
  9. turnRight = true
  10.  
  11. function gotoNextSlotIfEmpty()
  12. if turtle.getItemCount(currentSlot) == 0 then
  13. currentSlot = currentSlot + 1
  14. turtle.select(currentSlot)
  15. end
  16. end
  17.  
  18. turtle.select(currentSlot)
  19. turtle.up()
  20.  
  21. for width = 1, floorWidth>=width do
  22.  
  23. for length = 1, floorLength>=length do
  24.  
  25. turtle.placeDown()
  26. gotoNextSlotIfEmpty()
  27. if length ~= floorLength then
  28. turtle.forward()
  29. end
  30.  
  31. end
  32.  
  33. if turnRight then
  34. turtle.turnRight()
  35. turtle.forward()
  36. turtle.turnRight()
  37. else
  38. turtle.turnLeft()
  39. turtle.forward()
  40. turtle.turnLeft()
  41. end
  42. turnRight = not turnRight
  43.  
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement