Joshalot

CCT - essenceFarm

Jun 11th, 2021 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.35 KB | None | 0 0
  1. --pastebin get Fs0M4fZZ essenceFarm
  2. --------------------------------------------------
  3. function clear()
  4.     term.clear()
  5.     term.setCursorPos(1,1)
  6.     term.setTextColor(colors.yellow)
  7.     print('Josh.OS')
  8.     term.setTextColor(colors.white)
  9. end
  10.  
  11. reqFuel = 500
  12.  
  13. -------------------------------------------------- Init --------------------------------------------------
  14. clear()
  15. if not fs.exists('betterMovement') then
  16.     print('Downloading dependencies...')
  17.     print()
  18.     fs.delete('betterMovement')
  19.     shell.run('pastebin get FWMpYYcT betterMovement')
  20. end
  21.  
  22. bm = require('betterMovement')
  23.  
  24. clear()
  25. print()
  26. term.setTextColor(colors.yellow)
  27. print("Welcome to Josh's Essence Farm Builder!")
  28. term.setTextColor(colors.white)
  29. print()
  30. print('Place the turtle in the bottom-left corner of the build (facing inwards)')
  31. print()
  32. print('Press ENTER to continue...')
  33. cont = read()
  34.  
  35. while turtle.getFuelLevel() < reqFuel do
  36.     turtle.select(1)
  37.     currFuel = turtle.getFuelLevel()
  38.    
  39.     clear()
  40.     term.setTextColor(colors.red)
  41.     print('---WARNING---')
  42.     print('Fuel level low!')
  43.     term.setTextColor(colors.white)
  44.     print()
  45.     print('Please put fuel into the first slot to meet the minimum fuel requirements...')
  46.     print()
  47.     print('Current Fuel: '..currFuel..'/'..reqFuel)
  48.    
  49.     turtle.refuel(1)
  50. end
  51.  
  52.  
  53. clear()
  54. print()
  55. print('Place a chest BEHIND the turtle.')
  56. print('Place the following items in the turtle.')
  57. print()
  58. term.setTextColor(colors.red)
  59. print('---WARNING---')
  60. term.setTextColor(colors.white)
  61. print('The items need to be the exact amount AND in the exact slots spesified.')
  62. print()
  63. print('Failiure to do so can cause the farm to be misbuilt!')
  64. print()
  65. print('Press ENTER to continue...')
  66. cont = read()
  67.  
  68. clear()
  69. print('Slot 1-4 : 48 Dirt')
  70. print('Slot 5   : 4 Vacuum Chests')
  71. print('Slot 6   : 4 Plant Interactors')
  72. print('Slot 7   : 4 Crafters')
  73. print('Slot 8   : 37 Item Conduits')
  74. print('Slot 9   : 13 Energy Conduits')
  75. print('Slot 10  : 2 Pressurised Fluid Conduits')
  76. print()
  77. print('Press ENTER to continue...')
  78. print()
  79. print('Page 1/3')
  80. cont = read()
  81.  
  82. clear()
  83. print('Slot 11  : 1 Water Tank (Agri)')
  84. print('Slot 12  : 24 Irrigation Channels')
  85. print('Slot 13  : 4 Sprinklers (Agri)')
  86. print('Slot 14  : 8 Glowstone')
  87. print('Slot 15  : 1 Chest')
  88. print('Slot 16  : 1 Aqueous Accumulator')
  89. print()
  90. print('Press ENTER to continue...')
  91. print()
  92. print()
  93. print('Page 2/3')
  94. cont = read()
  95.  
  96. clear()
  97. print('Place the following items in the CHEST')
  98. print()
  99. print('Slot 1-2 : 1 Water Bucket')
  100. print('Slot 3   : 1 Diamond Hoe  (optional)')
  101. print('Slot 4-7 : 48 Crop Sticks (optional)')
  102. print()
  103. print()
  104. print()
  105. print('Press ENTER to continue...')
  106. print()
  107. print('Page 3/3')
  108. cont = read()
  109.  
  110. clear()
  111. print()
  112. print('Are you ready to run the program? (y/n)')
  113. conf = read()
  114.  
  115. if conf ~= 'y' then
  116.     clear()
  117.     print('"y" was not selected.')
  118.     print('The program will now quit...')
  119.     os.sleep(1)
  120.     error()
  121. end
  122.  
  123. clear()
  124. print()
  125. print('Building will start in')
  126. print('3')
  127. os.sleep(1)
  128. print('2')
  129. os.sleep(1)
  130. print('1')
  131. os.sleep(1)
  132. clear()
  133. print()
  134. print('Building...')
  135.  
  136. -------------------------------------------------- Build --------------------------------------------------
  137.  
  138. -- 4 Quadrants
  139. for i=1, 4 do
  140.     turtle.select(i)
  141.     bm.move('uuu')
  142.  
  143.     bm.move('cCfcCfcCfcCfcCfcCfcCrfr')
  144.     bm.move('cCfcCfcCfcCfcCfcCfcClfl')
  145.     bm.move('cCfcCfcCfcCfcCfcCfcCrfr')
  146.    
  147.     bm.move('cCfcCfcCf')
  148.     turtle.select(5)
  149.     bm.move('cCf')
  150.     turtle.select(i)
  151.     bm.move('cCfcCfcClfl')
  152.    
  153.     bm.move('cCfcCfcCfcCfcCfcCfcCrfr')
  154.     bm.move('cCfcCfcCfcCfcCfcCfcClfl')
  155.     bm.move('cCfcCfcCfcCfcCfcCfcC')
  156.    
  157.     bm.move('flffuf')
  158.     turtle.select(6) -- interactor
  159.     turtle.placeDown()
  160.     turtle.back()
  161.    
  162.     turtle.select(9) -- energy
  163.     turtle.placeDown()
  164.     turtle.back()
  165.    
  166.     turtle.down()
  167.     turtle.select(7) -- crafter
  168.     turtle.placeDown()
  169.     turtle.up()
  170.  
  171.     turtle.select(9) -- energy
  172.     turtle.placeDown()
  173.     turtle.select(8) -- item
  174.     turtle.placeDown()
  175.     turtle.back()
  176.     turtle.select(9) -- energy
  177.     turtle.placeDown()
  178.     turtle.select(8) -- item
  179.     turtle.placeDown()
  180.  
  181.     bm.move('ffffddddbbbl')
  182.     bm.move('ZfZfZfZfZrfZfZ')
  183.     bm.move('fffrfffffffffffr') -- return to start
  184. end
  185.  
  186. -- Restock from chest
  187. bm.move('ll')
  188. turtle.select(1) -- Water
  189. turtle.suck(1)
  190. turtle.select(2) -- Water
  191. turtle.suck(1)
  192. turtle.select(3) -- Hoe
  193. turtle.suck(1)
  194. turtle.select(4) -- Crop Sticks
  195. turtle.suck(48)
  196. turtle.select(5) -- Crop Sticks
  197. turtle.suck(48)
  198. turtle.select(6) -- Crop Sticks
  199. turtle.suck(48)
  200. turtle.select(7) -- Crop Sticks
  201. turtle.suck(48)
  202. bm.move('ll')
  203.  
  204. hoe = turtle.getItemDetail(3)
  205. if hoe ~= nil then
  206.     if hoe.name == 'minecraft:diamond_hoe' then
  207.         turtle.select(8)
  208.         bm.move('ubuuuf')
  209.         shell.run('equip 3 left')
  210.         for i=1, 4 do
  211.             turtle.select(i+3)
  212.             bm.move('cCfcCfcCfcCfcCfcCfcCrfr')
  213.             bm.move('cCfcCfcCfcCfcCfcCfcClfl')
  214.             bm.move('cCfcCfcCfcCfcCfcCfcCrfr')
  215.             bm.move('cCfcCfcCfcCfcCfcCfcClfl')
  216.             bm.move('cCfcCfcCfcCfcCfcCfcCrfr')
  217.             bm.move('cCfcCfcCfcCfcCfcCfcClfl')
  218.             bm.move('cCfcCfcCfcCfcCfcCfcC')
  219.            
  220.             bm.move('fffffffflffffffll') -- move to next quad
  221.         end
  222.         bm.move('bdddfd') -- return back
  223.         shell.run('equip 3 left')
  224.     end
  225. end
  226.  
  227. -- Irrigation
  228. bm.move('fffffffrfffffffcuu')
  229. turtle.select(1) -- water
  230. turtle.place()
  231. bm.move('ll')
  232. turtle.select(2) -- water
  233. turtle.place()
  234. turtle.select(16) -- acc
  235. bm.move('uC')
  236.  
  237. turtle.up()
  238. turtle.select(10) -- fluid
  239. turtle.placeDown()
  240. turtle.select(8) -- item
  241. turtle.placeDown()
  242. turtle.select(9) -- energy
  243. turtle.placeDown()
  244. turtle.up()
  245. turtle.select(10) -- fluid
  246. turtle.placeDown()
  247. turtle.select(8) -- item
  248. turtle.placeDown()
  249. turtle.select(9) -- energy
  250. turtle.placeDown()
  251. turtle.up()
  252.  
  253. turtle.select(11) -- tank
  254. turtle.placeDown()
  255. turtle.select(12) -- irr
  256. turtle.turnLeft()
  257.  
  258. for i=1, 2 do
  259.     bm.move('fCfCfCflffffd')
  260.     turtle.select(14) -- glo
  261.     bm.move('lXrrXrb')
  262.     turtle.select(12) -- irr
  263.     turtle.place()
  264.     turtle.down()
  265.     turtle.select(13) -- spr
  266.     bm.move('Xuuf')
  267.     turtle.select(12) -- irr
  268.  
  269.     bm.move('fCfCfCfCfCfCfCfd')
  270.     turtle.select(14) -- glo
  271.     bm.move('lXrrXrb')
  272.     turtle.select(12) -- irr
  273.     turtle.place()
  274.     turtle.down()
  275.     turtle.select(13) -- spr
  276.     bm.move('Xuuf')
  277.     turtle.select(12) -- irr
  278.     bm.move('ffffffffbbbblffff')
  279. end
  280. bm.move('lffd')
  281. turtle.select(15)
  282. turtle.placeDown()
  283. turtle.select(1)
  284. bm.move('fffdddddrfffffffrffffffffffffr') -- return home
  285. bm.move('rrxrr') -- break chest
  286. clear()
  287. print()
  288. print('Building Finished')
Add Comment
Please, Sign In to add comment