Advertisement
jared314

Untitled

Oct 1st, 2016
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. floorSize = 5
  2.  
  3. currentSlot = 2
  4.  
  5.  
  6. function PlaceTorch()
  7. turtle.select(1)
  8. turtle.turnRight()
  9. turtle.turnRight()
  10.  
  11. turtle.place()
  12.  
  13. turtle.turnRight()
  14. turtle.turnRight()
  15. turtle.select(currentSlot)
  16. end
  17.  
  18. function CheckSlotLevel()
  19. if (turtle.getItemCount() <= 0) then
  20. currentSlot = currentSlot + 1
  21. turtle.select(currentSlot)
  22. end
  23. end
  24.  
  25. function BuildRow(torch)
  26. for i=0,floorSize,1 do
  27. CheckSlotLevel()
  28. turtle.placeDown()
  29. if (torch and (i%5==0)) then
  30. PlaceTorch()
  31. end
  32. turtle.forward()
  33. end
  34. end
  35.  
  36. function Turn(i)
  37. if (i%2==0) then
  38. turtle.turnRight()
  39. turtle.forward()
  40. turtle.turnRight()
  41. else
  42. turtle.turnLeft()
  43. turtle.forward()
  44. turtle.turnLeft()
  45. end
  46. end
  47.  
  48. function Build()
  49. BuildRow(false)
  50. for i=0,floorSize,1 do
  51.  
  52. Turn()
  53.  
  54. torch = i%5==0
  55. BuildRow(torch)
  56. end
  57. end
  58.  
  59. turtle.select(currentSlot)
  60. Build()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement