Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Methods:
- --getMaxHeat
- --isActive
- --getAllStacks
- --getEUOutput
- --getHeat
- --getInventorySize
- --Config:
- reactorSide = "top"
- redstonSide = "back"
- --Function:
- reactor = peripheral.wrap(reactorSide)
- function firstRun()
- if fs.exists("log.txt") then
- -- Open data
- print("Uranium Slot file Ok")
- file = fs.open("log.txt","r")
- slotFile = file.readAll()
- file.close()
- print(slotFile)
- slotCell = textutils.unserialize(slotFile)
- else
- shell.run("pastebin get 1JHBtb20 searchCell")
- shell.openTab("searchCell")
- for i = 5,0,-1 do
- term.setCursorPos(1,2)
- print("Searching Uranium Cell ...")
- term.setCursorPos(1,3)
- term.clearLine()
- print("Wait "..i.." s")
- sleep(1)
- end
- end
- term.clear()
- end
- function uranium()
- for k,v in pairs(slotCell) do
- slot = v
- --print("slot: "..slot)
- --print(k..": "..tostring(v))
- --sleep(1)
- slotData = reactor.getStackInSlot(slot)
- if slotData ~= nil then
- for k,v in pairs(slotData) do
- dispName = slotData.display_name
- name = slotData.name
- dmg = slotData.dmg
- end
- maxDmg = 10000
- timeInSec = 10020
- ratio = maxDmg/timeInSec
- calTime_1 = (timeInSec - (dmg*ratio))/60
- --print("Cal_1: "..calTime_1)
- calTime_2 = math.floor(calTime_1)/60 -- hour decimal
- --print("Cal_2: "..calTime_2)
- calTime_3 = (calTime_2 - math.floor(calTime_2)) * 60
- timeH = math.floor(calTime_2)
- timeM = math.floor(calTime_3)
- --print("Cal_3: "..calTime_3)
- --print("H: "..math.floor(calTime_2))
- --print("Min: "..math.floor(calTime_3))
- strg = string.format("%s: %s - %s h %s min",slot,dispName,timeH,timeM)
- print(strg)
- yPos = yPos + 1
- --print(name)
- --print(dmg)
- end
- end
- end
- --for k,v in pairs(reactor) do
- --print(k..": "..tostring(v))
- --sleep(2)
- --end
- term.clear()
- term.setCursorPos(1,1)
- firstRun()
- while true do
- yPos = 7
- if slotCell == nil then
- firstRun()
- end
- sleep(1)
- temp = reactor.getHeat()
- tempMax = reactor.getMaxHeat()
- energyOut = reactor.getEUOutput()
- energyReal = energyOut*5
- term.setCursorPos(1,4)
- term.clearLine()
- print("°C: "..temp.."/"..tempMax)
- term.setCursorPos(1,5)
- term.clearLine()
- print("Output: "..energyReal.." EU/t")
- term.setCursorPos(1,yPos)
- term.clearLine()
- uranium()
- end
Advertisement
Add Comment
Please, Sign In to add comment