Advertisement
asweigart

Solar Factory

Mar 12th, 2016
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.75 KB | None | 0 0
  1. --5
  2. os.loadAPI('hare')
  3.  
  4. DEBUG_SOLAR = true
  5.  
  6. STORAGE = {800, 78, -638, 'east'}
  7.  
  8. WOOD = {800, 81, -638, 'south'}
  9.  
  10. GLASS = {800, 80, -638, 'south'}
  11. IRON = {800, 79, -638, 'south'}
  12. MIRROR = {800, 78, -638, 'south'}
  13. REDSTONE = {800, 77, -638, 'south'}
  14.  
  15. PLANK = {799, 80, -638, 'south'}
  16. SOLAR_PANEL_I = {799, 79, -638, 'south'}
  17. GOLD = {799, 78, -638, 'south'}
  18. RECEPTION_COIL = {799, 77, -638, 'south'}
  19.  
  20. SOLAR_PANEL_II = {798, 80, -638, 'south'}
  21. TIN = {798, 79, -638, 'south'}
  22. TIN_GEAR = {798, 78, -638, 'south'}
  23. MACHINE_FRAME_BASIC = {798, 77, -638, 'south'}
  24.  
  25. LEAD = {797, 80, -638, 'south'}
  26. REDSTONE_BLOCK = {797, 79, -638, 'south'}
  27. LEADSTONE_ENERGY_CELL = {797, 78, -638, 'south'}
  28. PV_CELL_I = {797, 77, -638, 'south'}
  29.  
  30. SOLAR_PANEL_III = {796, 80, -638, 'south'}
  31. ELECTRUM = {796, 79-638, 'south'}
  32. ELECTRUM_GEAR = {796, 78-638, 'south'}
  33. INVAR = {796, 77-638, 'south'}
  34.  
  35. MACHINE_FRAME_HARDENED = {795, 80, -638, 'south'}
  36. HARDENED_ENERGY_CELL = {795, 79, -638, 'south'}
  37. PV_CELL_II = {795, 78, -638, 'south'}
  38. SOLAR_PANEL_IV = {795, 77, -638, 'south'}
  39.  
  40. SIGNALUM = {794, 80, -638, 'south'}
  41. SIGNALUM_GEAR = {794, 79, -638, 'south'}
  42. HARDENED_GLASS = {794, 78, -638, 'south'}
  43. MACHINE_FRAME_REINFORCED = {794, 77, -638, 'south'}
  44.  
  45. PV_CELL_III = {793, 80, -638, 'south'}
  46. EMPTY_REDSTONE_ENERGY_CELL = {793, 79, -638, 'south'}
  47. REDSTONE_ENERGY_CELL = {793, 78, -638, 'south'}
  48. SOLAR_PANEL_V = {793, 77, -638, 'south'}
  49.  
  50. PV_CELL_IV = {792, 80, -638, 'south'}
  51. DIAMOND = {792, 79, -638, 'south'}
  52. ENDERIUM = {792, 78, -638, 'south'}
  53. RESONANT_ENERGY_CELL_FRAME = {792, 77, -638, 'south'}
  54.  
  55. MACHINE_FRAME_RESONANT = {791, 80, -638, 'south'}
  56. ENDERIUM_GEAR = {791, 79, -638, 'south'}
  57.  
  58. function dumpAll()
  59. local i
  60. print('Dumping inventory...')
  61. hare.goto(STORAGE)
  62. for i=1,16 do
  63. turtle.select(i)
  64. turtle.drop(64)
  65. end
  66. end
  67.  
  68.  
  69. function grab(location, num, slots)
  70. if type(slots) == 'number' then slots = {slots} end
  71. success, errMsg = hare.goto(location)
  72. if not success then return false, errMsg end
  73. --print('arrived at barrel')
  74.  
  75. for k,v in pairs(slots) do
  76. --print('sel ' .. tostring(v) .. ' s ' .. num)
  77. hare.doActionsSafely('sel ' .. v .. ' s ' .. num)
  78. if turtle.getItemCount(v) ~= num then return false end
  79. end
  80. return true
  81. end
  82.  
  83.  
  84. function inventoryIsEmpty()
  85. for i=1,16 do
  86. if turtle.getItemCount(i) ~= 0 then return false end
  87. end
  88. return true
  89. end
  90.  
  91. function craftAndDrop(location, num)
  92. success, errMsg = hare.doActionsSafely('sel 16 c ' .. num)
  93. if not success then return false, errMsg end
  94.  
  95. success, errMsg = hare.goto(location)
  96. if not success then return false, errMsg end
  97.  
  98. if not hare.doActionsSafely('dr ' .. num) then return false, errMsg end
  99. if not inventoryIsEmpty() then
  100. dumpAll()
  101. return false, 'Crafting failed, inventory not empty'
  102. end
  103. return true
  104. end
  105.  
  106.  
  107. function craftPlank(num)
  108. print('Crafting planks...')
  109. if num % 4 ~= 0 then return false, 'Num for craftPlank() must multiple of 4' end
  110. if not inventoryIsEmpty() then dumpAll() end
  111.  
  112. if not grab(WOOD, num / 4, {1}) then return false, 'Could not grab WOOD' end
  113.  
  114. success, errMsg = craftAndDrop(PLANK, num)
  115. if not success then return false, errMsg end
  116. print('Planks (' .. num .. 'x) crafted.')
  117. return true
  118. end
  119.  
  120.  
  121. function craftRedstoneBlock(num)
  122. print('Crafting redstone block...')
  123. if not inventoryIsEmpty() then dumpAll() end
  124.  
  125. if not grab(REDSTONE, num, {1,2,3,5,6,7,9,10,11}) then return false, 'Could not grab REDSTONE' end
  126.  
  127. success, errMsg = craftAndDrop(REDSTONE_BLOCK, num)
  128. if not success then return false, errMsg end
  129. print('Redstone blocks (' .. num .. 'x) crafted.')
  130. return true
  131. end
  132.  
  133.  
  134. function craftMirror(num)
  135. print('Crafting mirror...')
  136. if not inventoryIsEmpty() then dumpAll() end
  137. if num % 2 ~= 0 then return false, 'Num for craftMirror() must be even' end
  138.  
  139. if not grab(GLASS, num / 2, {1,2,3}) then return false, 'Could not grab GLASS' end
  140. if not grab(IRON, num / 2, {6}) then return false, 'Could not grab IRON' end
  141.  
  142. success, errMsg = craftAndDrop(MIRROR, num)
  143. if not success then return false, errMsg end
  144. print('Mirrors (' .. num .. 'x) crafted.')
  145. return true
  146. end
  147.  
  148.  
  149. function craftSolarPanelI(num)
  150. print('Crafting solar panel I...')
  151. if not inventoryIsEmpty() then dumpAll() end
  152. if not grab(MIRROR, num, {1,2,3}) then return false, 'Could not grab MIRROR' end
  153. if not grab(PLANK, num, {5,9,10,11,7}) then return false, 'Could not grab PLANK' end
  154. if not grab(REDSTONE, num, {6}) then return false, 'Could not grab REDSTONE' end
  155.  
  156. success, errMsg = craftAndDrop(SOLAR_PANEL_I, num)
  157. if not success then return false, errMsg end
  158. print('Solar panel I (' .. num .. 'x) crafted.')
  159. return true
  160. end
  161.  
  162.  
  163. function craftReceptionCoil(num)
  164. print('Crafting reception coil...')
  165. if not inventoryIsEmpty() then dumpAll() end
  166. if not grab(REDSTONE, num, {3,9}) then return false, 'Could not grab REDSTONE' end
  167. if not grab(GOLD, num, {6}) then return false, 'Could not grab GOLD' end
  168.  
  169. success, errMsg = craftAndDrop(RECEPTION_COIL, num)
  170. if not success then return false, errMsg end
  171. print('Reception coil (' .. num .. 'x) crafted.')
  172. return true
  173. end
  174.  
  175.  
  176. function craftSolarPanelII(num)
  177. print('Crafting solar panel II...')
  178. if not inventoryIsEmpty() then dumpAll() end
  179. if not grab(SOLAR_PANEL_I, num, {1,2,3,5,7,9,10,11}) then return false, 'Could not grab SOLAR_PANEL_I' end
  180. if not grab(RECEPTION_COIL, num, {6}) then return false, 'Could not grab RECEPTION_COIL' end
  181.  
  182. success, errMsg = craftAndDrop(SOLAR_PANEL_II, num)
  183. if not success then return false, errMsg end
  184. print('Solar panel II (' .. num .. 'x) crafted.')
  185. return true
  186. end
  187.  
  188.  
  189. function craftTinGear(num)
  190. print('Crafting tin gear...')
  191. if not inventoryIsEmpty() then dumpAll() end
  192. if not grab(IRON, num, 6) then return false, 'Could not grab IRON' end
  193. if not grab(TIN, num, {2, 5, 7, 10}) then return false, 'Could not grab TIN' end
  194.  
  195. success, errMsg = craftAndDrop(TIN_GEAR, num)
  196. if not success then return false, errMsg end
  197. print('Tin gear (' .. num .. 'x) crafted.')
  198. return true
  199. end
  200.  
  201.  
  202. function craftLeadstoneEnergyFrame(num)
  203. print('Crafting leadstone energy frame...')
  204. if not inventoryIsEmpty() then dumpAll() end
  205. if not grab(LEAD, num, {1,3,9,11}) then return false, 'Could not grab LEAD' end
  206. if not grab(GLASS, num, {2,5,7,10}) then return false, 'Could not grab GLASS' end
  207. if not grab(REDSTONE_BLOCK, num, {5}) then return false, 'Could not grab REDSTONE_BLOCK' end
  208.  
  209. success, errMsg = craftAndDrop(LEADSTONE_ENERGY_CELL, num)
  210. if not success then return false, errMsg end
  211. print('Leadstone energy frame (' .. num .. 'x) crafted.')
  212. return true
  213. end
  214.  
  215.  
  216. function craftMachineFrameBasic(num)
  217. print('Crafting machine frame basic...')
  218. if not inventoryIsEmpty() then dumpAll() end
  219. if not grab(IRON, num, {1,3,9,11}) then return false, 'Could not grab IRON' end
  220. if not grab(GLASS, num, {2,5,7,10}) then return false, 'Could not grab GLASS' end
  221. if not grab(TIN_GEAR, num, {5}) then return false, 'Could not grab TIN_GEAR' end
  222.  
  223. success, errMsg = craftAndDrop(MACHINE_FRAME_BASIC, num)
  224. if not success then return false, errMsg end
  225. print('Machine frame basic (' .. num .. 'x) crafted.')
  226. return true
  227. end
  228.  
  229.  
  230. function craftSolarPanelIII(num)
  231. print('Crafting solar panel III...')
  232. if not inventoryIsEmpty() then dumpAll() end
  233. if not grab(PV_CELL_I, num, {1,2,3}) then return false, 'Could not grab PV_CELL_I' end
  234. if not grab(SOLAR_PANEL_II, num, {5,7,9,11}) then return false, 'Could not grab SOLAR_PANEL_II' end
  235. if not grab(MACHINE_FRAME_BASIC, num, {6}) then return false, 'Could not grab MACHINE_FRAME_BASIC' end
  236. if not grab(LEADSTONE_ENERGY_CELL, num, {10}) then return false, 'Could not grab LEADSTONE_ENERGY_CELL' end
  237.  
  238. success, errMsg = craftAndDrop(SOLAR_PANEL_III, num)
  239. if not success then return false, errMsg end
  240. print('Solar panel III (' .. num .. 'x) crafted.')
  241. return true
  242. end
  243.  
  244. function craftElectrumGear(num)
  245. print('Crafting electrum gear...')
  246. if not inventoryIsEmpty() then dumpAll() end
  247.  
  248. if not grab(IRON, num, {6}) then return false, 'Could not grab IRON' end
  249. if not grab(ELECTRUM, num, {2,5,7,10}) then return false, 'Could not grab ELECTRUM' end
  250.  
  251. success, errMsg = craftAndDrop(ELECTRUM_GEAR, num)
  252. if not success then return false, errMsg end
  253. print('Electrum gear (' .. num .. 'x) crafted.')
  254. return true
  255. end
  256.  
  257. function craftMachineFrameHardened(num)
  258. print('Crafting m. fr. hardened...')
  259. if not inventoryIsEmpty() then dumpAll() end
  260.  
  261. if not grab(INVAR, num, {1,3,9,11}) then return false, 'Could not grab INVAR' end
  262. if not grab(ELECTRUM_GEAR, num, {2}) then return false, 'Could not grab ELECTRUM_GEAR' end
  263. if not grab(MACHINE_FRAME_BASIC, num, {6}) then return false, 'Could not grab MACHINE_FRAME_BASIC' end
  264.  
  265. success, errMsg = craftAndDrop(MACHINE_FRAME_HARDENED, num)
  266. if not success then return false, errMsg end
  267. print('M. Fr. Hardened (' .. num .. 'x) crafted.')
  268. return true
  269. end
  270.  
  271. function craftHardenedEnergyCellFrame(num)
  272. print('Crafting hardened en cell fr...')
  273. if not inventoryIsEmpty() then dumpAll() end
  274.  
  275. if not grab(LEADSTONE_ENERGY_CELL, num, {6}) then return false, 'Could not grab LEADSTONE_ENERGY_CELL' end
  276. if not grab(INVAR, num, {2,5,7,10}) then return false, 'Could not grab INVAR' end
  277.  
  278. success, errMsg = craftAndDrop(HARDENED_ENERGY_CELL, num)
  279. if not success then return false, errMsg end
  280. print('hardened en cell fr (' .. num .. 'x) crafted.')
  281. return true
  282. end
  283.  
  284. function craftSolarPanelIV(num)
  285. print('Crafting SP IV...')
  286. if not inventoryIsEmpty() then dumpAll() end
  287.  
  288. if not grab(PV_CELL_II, num, {1,2,3}) then return false, 'Could not grab PV_CELL_II' end
  289. if not grab(SOLAR_PANEL_III, num, {5,7,9,11}) then return false, 'Could not grab SOLAR_PANEL_III' end
  290. if not grab(MACHINE_FRAME_HARDENED, num, {6}) then return false, 'Could not grab MACHINE_FRAME_HARDENED' end
  291. if not grab(HARDENED_ENERGY_CELL, num, {10}) then return false, 'Could not grab HARDENED_ENERGY_CELL' end
  292.  
  293. success, errMsg = craftAndDrop(SOLAR_PANEL_IV, num)
  294. if not success then return false, errMsg end
  295. print('SP IV (' .. num .. 'x) crafted.')
  296. return true
  297. end
  298.  
  299. function craftSignalumGear(num)
  300. print('Crafting signalum gear...')
  301. if not inventoryIsEmpty() then dumpAll() end
  302.  
  303. if not grab(IRON, num, {6}) then return false, 'Could not grab IRON' end
  304. if not grab(SIGNALUM, num, {2,5,7,10}) then return false, 'Could not grab SIGNALUM' end
  305.  
  306. success, errMsg = craftAndDrop(SIGNALUM_GEAR, num)
  307. if not success then return false, errMsg end
  308. print('signalum gear (' .. num .. 'x) crafted.')
  309. return true
  310. end
  311.  
  312.  
  313. function craftMachineFrameReinforced(num)
  314. print('Crafting m. fr. reinfor...')
  315. if not inventoryIsEmpty() then dumpAll() end
  316.  
  317. if not grab(HARDENED_GLASS, num, {1,3,9,11}) then return false, 'Could not grab HARDENED_GLASS' end
  318. if not grab(SIGNALUM_GEAR, num, {2}) then return false, 'Could not grab SIGNALUM_GEAR' end
  319. if not grab(MACHINE_FRAME_HARDENED, num, {6}) then return false, 'Could not grab MACHINE_FRAME_HARDENED' end
  320.  
  321. success, errMsg = craftAndDrop(MACHINE_FRAME_REINFORCED, num)
  322. if not success then return false, errMsg end
  323. print('M. Fr. reinfo (' .. num .. 'x) crafted.')
  324. return true
  325. end
  326.  
  327. function craftRedstoneEnergyCellFrame(num)
  328. print('Crafting red en cell fr...')
  329. if not inventoryIsEmpty() then dumpAll() end
  330.  
  331. if not grab(ELECTRUM, num, {1,3,9,11}) then return false, 'Could not grab ELECTRUM' end
  332. if not grab(HARDENED_GLASS, num, {2,5,7,10}) then return false, 'Could not grab HARDENED_GLASS' end
  333. if not grab(DIAMOND, num, {6}) then return false, 'Could not grab DIAMOND' end
  334.  
  335. success, errMsg = craftAndDrop(MACHINE_FRAME_REINFORCED, num)
  336. if not success then return false, errMsg end
  337. print('red en cell fr (' .. num .. 'x) crafted.')
  338. return true
  339. end
  340.  
  341. function craftSolarPanelV(num)
  342. print('Crafting SP V...')
  343. if not inventoryIsEmpty() then dumpAll() end
  344.  
  345. if not grab(PV_CELL_III, num, {1,2,3}) then return false, 'Could not grab PV_CELL_III' end
  346. if not grab(SOLAR_PANEL_IV, num, {5,7,9,11}) then return false, 'Could not grab SOLAR_PANEL_IV' end
  347. if not grab(MACHINE_FRAME_REINFORCED, num, {6}) then return false, 'Could not grab MACHINE_FRAME_REINFORCED' end
  348. if not grab(REDSTONE_ENERGY_CELL, num, {10}) then return false, 'Could not grab REDSTONE_ENERGY_CELL' end
  349.  
  350. success, errMsg = craftAndDrop(SOLAR_PANEL_V, num)
  351. if not success then return false, errMsg end
  352. print('SP V (' .. num .. 'x) crafted.')
  353. return true
  354. end
  355.  
  356. function craftEnderiumGear(num)
  357. print('Crafting enderium gear...')
  358. if not inventoryIsEmpty() then dumpAll() end
  359.  
  360. if not grab(IRON, num, {6}) then return false, 'Could not grab IRON' end
  361. if not grab(ENDERIUM, num, {2,5,7,10}) then return false, 'Could not grab ENDERIUM' end
  362.  
  363. success, errMsg = craftAndDrop(ENDERIUM_GEAR, num)
  364. if not success then return false, errMsg end
  365. print('enderium gear (' .. num .. 'x) crafted.')
  366. return true
  367. end
  368.  
  369. function craftResonantEnergyCellFrame(num)
  370. print('Crafting res en cell fr gear...')
  371. if not inventoryIsEmpty() then dumpAll() end
  372.  
  373. if not grab(REDSTONE_ENERGY_CELL, num, {6}) then return false, 'Could not grab REDSTONE_ENERGY_CELL' end
  374. if not grab(ENDERIUM, num, {2,5,7,10}) then return false, 'Could not grab ENDERIUM' end
  375.  
  376. success, errMsg = craftAndDrop(RESONANT_ENERGY_CELL_FRAME, num)
  377. if not success then return false, errMsg end
  378. print('res en cell fr (' .. num .. 'x) crafted.')
  379. return true
  380. end
  381.  
  382. function craftMachineFrameResonant(num)
  383. print('Crafting m. fr. res...')
  384. if not inventoryIsEmpty() then dumpAll() end
  385.  
  386. if not grab(HARDENED_GLASS, num, {1,3,9,11}) then return false, 'Could not grab HARDENED_GLASS' end
  387. if not grab(ENDERIUM_GEAR, num, {2}) then return false, 'Could not grab SIGNALUM_GEAR' end
  388. if not grab(MACHINE_FRAME_HARDENED, num, {6}) then return false, 'Could not grab MACHINE_FRAME_HARDENED' end
  389.  
  390. success, errMsg = craftAndDrop(MACHINE_FRAME_RESONANT, num)
  391. if not success then return false, errMsg end
  392. print('M. Fr. res (' .. num .. 'x) crafted.')
  393. return true
  394. end
  395.  
  396. function craftSolarPanelVI(num)
  397. print('Crafting SP VI...')
  398. if not inventoryIsEmpty() then dumpAll() end
  399.  
  400. if not grab(PV_CELL_IV, num, {1,2,3}) then return false, 'Could not grab PV_CELL_IV' end
  401. if not grab(SOLAR_PANEL_V, num, {5,7,9,11}) then return false, 'Could not grab SOLAR_PANEL_V' end
  402. if not grab(MACHINE_FRAME_RESONANT, num, {6}) then return false, 'Could not grab MACHINE_FRAME_RESONANT' end
  403. if not grab(RESONANT_ENERGY_CELL_FRAME, num, {10}) then return false, 'Could not grab RESONANT_ENERGY_CELL_FRAME' end
  404.  
  405. success, errMsg = craftAndDrop(SOLAR_PANEL_V, num)
  406. if not success then return false, errMsg end
  407. print('SP VI (' .. num .. 'x) crafted.')
  408. return true
  409. end
  410.  
  411.  
  412.  
  413.  
  414.  
  415. local tArgs = {...}
  416. if tArgs == nil then
  417. print '"solar make" to run main program'
  418. return
  419. elseif tArgs[1] == 'make' then
  420. dumpAll()
  421. while true do
  422. success, errMsg = craftPlank(64)
  423. if not success then print(errMsg); dumpAll() end
  424.  
  425. success, errMsg = craftRedstoneBlock(8)
  426. if not success then print(errMsg); dumpAll() end
  427.  
  428. success, errMsg = craftMirror(64)
  429. if not success then print(errMsg); dumpAll() end
  430.  
  431. success, errMsg = craftSolarPanelI(64)
  432. if not success then print(errMsg); dumpAll() end
  433.  
  434. success, errMsg = craftReceptionCoil(64)
  435. if not success then print(errMsg); dumpAll() end
  436.  
  437. success, errMsg = craftSolarPanelII(8)
  438. if not success then print(errMsg); dumpAll() end
  439.  
  440. success, errMsg = craftTinGear(64)
  441. if not success then print(errMsg); dumpAll() end
  442.  
  443. success, errMsg = craftLeadstoneEnergyFrame(8)
  444. if not success then print(errMsg); dumpAll() end
  445.  
  446. success, errMsg = craftMachineFrameBasic(8)
  447. if not success then print(errMsg); dumpAll() end
  448.  
  449. success, errMsg = craftSolarPanelIII(8)
  450. if not success then print(errMsg); dumpAll() end
  451.  
  452. print('Sleeping...')
  453. os.sleep(10)
  454. end
  455. elseif tArgs[1] == '1' then
  456. dumpAll()
  457. while true do
  458. success, errMsg = craftPlank(64)
  459. if not success then print(errMsg); dumpAll() end
  460. success, errMsg = craftPlank(64)
  461. if not success then print(errMsg); dumpAll() end
  462. success, errMsg = craftPlank(64)
  463. if not success then print(errMsg); dumpAll() end
  464. success, errMsg = craftPlank(64)
  465. if not success then print(errMsg); dumpAll() end
  466. success, errMsg = craftPlank(64)
  467. if not success then print(errMsg); dumpAll() end
  468.  
  469. success, errMsg = craftMirror(64)
  470. if not success then print(errMsg); dumpAll() end
  471. success, errMsg = craftMirror(64)
  472. if not success then print(errMsg); dumpAll() end
  473. success, errMsg = craftMirror(64)
  474. if not success then print(errMsg); dumpAll() end
  475.  
  476. success, errMsg = craftSolarPanelI(64)
  477. if not success then print(errMsg); dumpAll() end
  478. end
  479. elseif tArgs[1] == '2' then
  480. dumpAll()
  481. while true do
  482. success, errMsg = craftReceptionCoil(64)
  483. if not success then print(errMsg); dumpAll() end
  484.  
  485. success, errMsg = craftSolarPanelII(64)
  486. if not success then print(errMsg); dumpAll() end
  487. end
  488. elseif tArgs[1] == '3' then
  489. dumpAll()
  490. while true do
  491.  
  492. success, errMsg = craftRedstoneBlock(8)
  493. if not success then print(errMsg); dumpAll() end
  494.  
  495. success, errMsg = craftTinGear(64)
  496. if not success then print(errMsg); dumpAll() end
  497.  
  498. success, errMsg = craftLeadstoneEnergyFrame(8)
  499. if not success then print(errMsg); dumpAll() end
  500.  
  501. success, errMsg = craftMachineFrameBasic(8)
  502. if not success then print(errMsg); dumpAll() end
  503.  
  504. success, errMsg = craftSolarPanelIII(8)
  505. if not success then print(errMsg); dumpAll() end
  506. end
  507.  
  508. elseif tArgs[1] == '4' then
  509. elseif tArgs[1] == '5' then
  510. elseif tArgs[1] == '6' then
  511. elseif tArgs[1] == 'sp1' then
  512. dumpAll()
  513. while true do
  514. success, errMsg = craftSolarPanelI(64)
  515. if not success then print(errMsg); dumpAll() end
  516. end
  517. elseif tArgs[1] == 'sp2' then
  518. dumpAll()
  519. while true do
  520. success, errMsg = craftSolarPanelII(64)
  521. if not success then print(errMsg); dumpAll() end
  522. end
  523. elseif tArgs[1] == 'sp3' then
  524. dumpAll()
  525. while true do
  526. success, errMsg = craftSolarPanelIII(64)
  527. if not success then print(errMsg); dumpAll() end
  528. end
  529. elseif tArgs[1] == 'sp4' then
  530. dumpAll()
  531. while true do
  532. success, errMsg = craftSolarPanelIV(64)
  533. if not success then print(errMsg); dumpAll() end
  534. end
  535. elseif tArgs[1] == 'sp5' then
  536. dumpAll()
  537. while true do
  538. success, errMsg = craftSolarPanelV(64)
  539. if not success then print(errMsg); dumpAll() end
  540. end
  541. elseif tArgs[1] == 'sp6' then
  542. dumpAll()
  543. while true do
  544. success, errMsg = craftSolarPanelVI(64)
  545. if not success then print(errMsg); dumpAll() end
  546. end
  547.  
  548. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement