Savage_Me55iah

CC_MassNukeSetup

Jul 30th, 2016
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.08 KB | None | 0 0
  1. local inv = {}
  2.  
  3. local function insertInv(...)
  4.     local tempTable = {...}
  5.     for a,b in pairs(tempTable) do
  6.         table.insert(inv, b)
  7.     end
  8. end
  9.  
  10. insertInv(2,3,3,2,2,3,2)
  11. insertInv(3,1,1,3,3,1,3)
  12. insertInv(2,3,3,2,3,1,3)
  13. insertInv(2,3,3,2,2,3,2)
  14. insertInv(3,1,1,3,2,3,2)
  15. insertInv(2,3,3,2,3,1,3)
  16.  
  17. local fre = {[1] = 273, [2] = 547, [3] = 1092}
  18. local returnFre = 0
  19. local ins = {[1] = false, [2] = true, [3] = true}
  20. local nukeDir, turtleDir = "north", "south"
  21. local chain = true
  22. local mox = true
  23. local maxheat = 9900
  24.  
  25. while turtle.detect() do
  26.     local nuke = peripheral.wrap("front")
  27.     turtle.select(1)
  28.     turtle.placeUp()
  29.     local ender = peripheral.wrap("top")
  30.     local heat = nuke.getHeat()
  31.    
  32.     if mox and heat < maxheat then
  33.         ender.setFrequency(returnFre)
  34.         for num=1,nuke.getInventorySize() do
  35.             nuke.condenseItems()
  36.             if tostring(nuke.getStackInSlot(1)) ~= "nil" then
  37.                 local notEmpty = 0
  38.                 while notEmpty == 0 do
  39.                     nuke.condenseItems()
  40.                     notEmpty = nuke.pushItemIntoSlot(nukeDir, 1, 1, 16)
  41.                 end
  42.                 local y = 0
  43.                 while y == 0 do
  44.                     ender.condenseItems()
  45.                     y = ender.pullItemIntoSlot("down", 16, 1, ender.getInventorySize())
  46.                 end
  47.             end
  48.         end
  49.         nuke.pullItemIntoSlot(nukeDir, 2, 1, 1)
  50.         while heat < maxheat do
  51.             heat = nuke.getHeat()
  52.             term.clear()
  53.             term.setCursorPos(1,1)
  54.             print("heating: "..heat)
  55.             redstone.setOutput("front", true)
  56.             os.queueEvent("heat")
  57.             os.pullEvent()
  58.         end
  59.         redstone.setOutput("front", false)
  60.         nuke.pushItemIntoSlot(nukeDir, 1, 1, 2)
  61.     end
  62.    
  63.     for a,b in pairs(inv) do
  64.         local h = nuke.getStackInSlot(a)
  65.         if ins[b] and tostring(h) == "nil" then
  66.             local x = 0
  67.             while x == 0 do
  68.                 ender.setFrequency(fre[b])
  69.                 ender.condenseItems()
  70.                 x = ender.pushItemIntoSlot("down", 1, 1, 1)
  71.             end
  72.             local detail = turtle.getItemDetail()
  73.             print(detail["name"])
  74.             local y = 0
  75.             while y == 0 do
  76.                 y = nuke.pullItemIntoSlot(nukeDir, 1, 1, a)
  77.             end
  78.         else
  79.             if tostring(h) ~= "nil" then print(h["name"]) else print("space") end
  80.         end
  81.     end
  82.    
  83.     turtle.digUp()
  84.     if chain then
  85.         turtle.up()
  86.     end
  87. end
Advertisement
Add Comment
Please, Sign In to add comment