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 reactor = peripheral.wrap("top")
- local storage = peripheral.wrap("tileinterface_4")
- local recycler = peripheral.wrap("tileinterface_5")
- local depleted = true
- local x = 1
- 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(check)
- if x == 1 then
- x = 0
- rs.setOutput("front", false)
- if check then
- for o = 1, 54 do
- recycler.pullItem("north", o, 1, 1)
- end
- end
- for i = 1, 54 do
- if setup[i] == 0 then
- storage.exportItem(lzhF, "south", 1, i)
- elseif setup[i] == 1 then
- storage.exportItem(uranF, "south", 1, i)
- elseif setup[i] == 2 then
- storage.exportItem(overF, "south", 1, i)
- end
- end
- rs.setOutput("front", true)
- end
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- -- MAIN
- print("Running: " .. tostring(reactor.isActive()))
- print("Heat: " .. reactor.getHeat())
- if reactor.getHeat() >= 100 then
- rs.setOutput("front", false)
- for y = 1, 54 do
- recycler.pullItem("east", y, 1, 1)
- end
- elseif reactor.getHeat() < 100 then
- rs.setOutput("front", true)
- end
- depleted = rs.getInput("back")
- if depleted == true then
- x = 1
- elseif depleted == false and x == 1 then
- if next(reactor.getAllStacks()) == nil then
- reFuel(false)
- x = 0
- else
- reFuel(true)
- x = 0
- end
- end
- os.queueEvent("fakeEvent")
- os.pullEvent()
- -- MAIN
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement