funnybunnyofdoom

storageSetup

Feb 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. function main()
  2. build(getSpecs())
  3. end
  4.  
  5. function getSpecs()
  6. print("Use only barrels if this is for storage")
  7. print("What length for storage building?")
  8. local l = read()
  9. print("What width?")
  10. local w = read()
  11. print("How high?")
  12. local h = read()
  13. return l,w,h
  14. end
  15.  
  16. function build(l,w,h)
  17. --Orient the turtle
  18. turtle.digUp()
  19. turtle.up()
  20. --Check for reload
  21. reload = 1
  22. for i=1,h do
  23. if turtle.getItemCount() < 16 then
  24. turtle.select(reload + 1)
  25. reload = reload + 1
  26. end
  27. for i=1,l do
  28. turtle.dig()
  29. turtle.digDown()
  30. turtle.placeDown()
  31. turtle.forward()
  32. print(turtle.getItemCount())
  33. end
  34. turtle.back()
  35. turtle.turnRight()
  36. turtle.forward()
  37. for i=1,w-1 do
  38. turtle.dig()
  39. turtle.digDown()
  40. turtle.placeDown()
  41. turtle.forward()
  42. print(turtle.getItemCount())
  43. end
  44. turtle.back()
  45. turtle.turnRight()
  46. turtle.forward()
  47. for i=1,l-1 do
  48. turtle.dig()
  49. turtle.digDown()
  50. turtle.placeDown()
  51. turtle.forward()
  52. print(turtle.getItemCount())
  53. end
  54. turtle.back()
  55. turtle.turnRight()
  56. turtle.forward()
  57. for i=1,w-1 do
  58. turtle.dig()
  59. turtle.digDown()
  60. turtle.placeDown()
  61. turtle.forward()
  62. end
  63. turtle.back()
  64. turtle.turnRight()
  65. turtle.digUp()
  66. turtle.up()
  67. end
  68. turtle.down()
  69. turtle.back()
  70. for i=1,h do
  71. turtle.down()
  72. end
  73. end
  74.  
  75. main()
Add Comment
Please, Sign In to add comment