Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local setup = { 0, 1, 0, 1, 0, 1, 0, 0, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 2 }
- local inventory = nil
- local producing = false
- local refuelReactor = true
- local storageSide = "south"
- local recycleSide = "north"
- local reactor = peripheral.wrap("top")
- local storage = peripheral.wrap("tileinterface_3")
- local recycler = peripheral.wrap("tileinterface_4")
- local lzhF = { id = "IC2:item.reactorCondensatorLap", dmg = 0, }
- local uranF = { id = "IC2:item.reactorUraniumQuad", dmg = 0, }
- local overF = { id = "IC2:item.reactorVentGold", dmg = 0, }
- local function refuel()
- if refuelReactor == true then
- refuelReactor = false
- rs.setOutput("bottom", true)
- rs.setOutput("front", false)
- -- Recycle All Old Components
- if inventory ~= nil then
- for o = 1, 54 do
- recycler.pullItem(recycleSide, o, 1, 1)
- end
- end
- -- Export Items Into Reactor In Co-Ordinated Slots
- for w = 1, 54 do
- term.clear()
- term.setCursorPos(1,1)
- print("Refueling Now! " .. w)
- if setup[w] == 0 then
- storage.exportItem(lzhF, storageSide, 1, w)
- elseif setup[w] == 1 then
- storage.exportItem(uranF, storageSide, 1, w)
- elseif setup[w] == 2 then
- storage.exportItem(overF, storageSide, 1, w)
- end
- end
- end
- rs.setOutput("bottom", false)
- for q = 241, 0, -1 do
- term.clear()
- term.setCursorPos(1,1)
- print("Waming up cooling drive! " .. q)
- sleep(1.1)
- end
- rs.setOutput("front", true)
- end
- refuel()
- while true do
- term.clear()
- term.setCursorPos(1,1)
- producing = rs.getInput("back")
- -- Interface
- print("Running: " .. tostring(reactor.isActive()) .. "\n")
- print("Heat: " .. reactor.getHeat())
- print("ProducingEU: " .. tostring(producing))
- -- Interface
- -- Functionality
- if producing == true then
- refuelReactor = true
- elseif producing == false and refuelReactor == true then
- refuel()
- end
- if reactor.isActive() and reactor.getHeat() >= 100 then -- Reactor is Running and Has OverHeated
- rs.setOutput("front", false) -- Stop Reactor
- for y = 1, 54 do
- recycler.pullItem(recycleSide, y, 1, 1) -- Pull All Items From Within The Reactor
- end
- elseif reactor.isActive() and reactor.getHeat() < 100 then -- Reactor is Running and Hasn't OverHeated
- inventory = reactor.getAllStacks()
- rs.setOutput("front", true)
- if inventory ~= nil then
- for i = 1, 54 do
- if inventory[i] ~= nil then
- if inventory[i].id == uranF.id and inventory[i].dmg >= 8000 then
- if setup[i] == 1 then
- recycler.pullItem(recycleSide, i, 1, 1)
- storage.exportItem(lzhF, storageSide, 1, i)
- end
- end
- elseif inventory[i] == nil and setup[i] == 1 then
- storage.exportItem(uranF, storageSide, 1, i)
- end
- end
- end
- end
- -- Functionality
- os.queueEvent("fakeEvent")
- os.pullEvent()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement