ravneravn

builder

Nov 19th, 2013
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. length = {...}
  2. slot = 1
  3. place = 1
  4. turtle.select(1)
  5.  
  6. function line()
  7. while turtle.getItemCount(tonumber(length[1])) > 0 do
  8. for i = 1, 64 do
  9. turtle.select(slot)
  10. turtle.forward()
  11. turtle.placeDown()
  12. end
  13. slot = slot +1
  14. end
  15. end
  16.  
  17. function up()
  18. while turtle.getItemCount(tonumber(length[1])) > 0 do
  19. for i = 1, 64 do
  20. turtle.select(slot)
  21. turtle.up()
  22. turtle.forward()
  23. turtle.placeDown()
  24. end
  25. slot = slot +1
  26. end
  27. end
  28.  
  29. function down()
  30. while turtle.getItemCount(tonumber(length[1])) > 0 do
  31. for i = 1, 64 do
  32. turtle.select(slot)
  33. turtle.forward()
  34. turtle.down()
  35. turtle.placeDown()
  36. end
  37. slot = slot +1
  38. end
  39. end
  40.  
  41. function row()
  42. turtle.select(slot)
  43. for i = 1, tonumber(length[1]) do
  44. getMats = turtle.getItemCount(slot)
  45. if getMats == 0 then
  46. slot = slot +1
  47. turtle.select(slot)
  48. end
  49. turtle.placeDown()
  50. place = place +1
  51. turtle.forward()
  52. end
  53. end
  54.  
  55. function rowBack()
  56. turtle.turnRight()
  57. turtle.turnRight()
  58. for i = 1, tonumber(length[1]) do
  59. turtle.forward()
  60. end
  61. end
  62.  
  63. function start()
  64. turtle.forward()
  65. turtle.turnLeft()
  66. for i = 1, (tonumber(length[1])-1) / 2 do
  67. turtle.forward()
  68. end
  69. turtle.turnRight()
  70. end
  71.  
  72. function platform()
  73. slot = 1
  74. start()
  75. for i = 1, tonumber(length[1]) do
  76. row()
  77. rowBack()
  78. turtle.turnLeft()
  79. turtle.forward()
  80. turtle.turnLeft()
  81. end
  82. end
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. slot = 1
  91. if length[2] == "up" then up()
  92. elseif length[2] == "down" then down()
  93. elseif length[2] == "platform" then platform()
  94. else line()
  95. end
RAW Paste Data