Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("monitor_0")
- local rad = peripheral.wrap("back")
- while true do
- local R = 0
- act = rad.getActive()
- nrg = rad.getEnergyStored()
- fTmp = rad.getFuelTemperature()
- cTmp = rad.getCasingTemperature()
- ful = rad.getFuelAmount()
- fMax = rad.getFuelAmountMax()
- eTic = rad.getEnergyProducedLastTick()
- frl = rad.getFuelReactivity()
- fTic = rad.getFuelConsumedLastTick()
- rod = rad.getControlRodLevel(R)
- if nrg <= 5000000 then
- rad.setActive(true)
- end
- if nrg >= 7500000 then
- rad.setActive(false)
- end
- mon.setTextScale(1.97)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(1)
- mon.write("Active: ")
- if act == true then
- mon.setTextColor(15000)
- else
- mon.setTextColor(17000)
- end
- mon.write(act)
- mon.setCursorPos(1,2)
- mon.setTextColor(1)
- mon.write("RF Rate: ")
- local e = eTic/1000
- e = math.floor(e)
- local ee = e*10
- mon.setTextColor(17000)
- mon.write(e)
- mon.write("K/t")
- -- mon.write("K/t, ")
- -- mon.write(ee)
- -- mon.write("K/s")
- local n = (math.floor(nrg/1000))
- mon.setCursorPos(1,3)
- mon.setTextColor(1)
- mon.write("Stored RF: ")
- mon.setTextColor(15000)
- mon.write(n)
- mon.write("K")
- local ft = math.floor(fTmp)
- local ct = math.floor(cTmp)
- mon.setCursorPos(1,4)
- mon.setTextColor(1)
- mon.write("Temp Core/Case: ")
- if ft < 800 then
- mon.setTextColor(15000)
- elseif ft < 1700 then
- mon.setTextColor(18)
- else
- mon.setTextColor(17000)
- end
- mon.setCursorPos(3,5)
- mon.write(ft)
- mon.setTextColor(1)
- mon.write("C")
- mon.write("/")
- if ct < 800 then
- mon.setTextColor(15000)
- elseif ct < 1700 then
- mon.setTextColor(18)
- else
- mon.setTextColor(17000)
- end
- mon.write(ct)
- mon.setTextColor(1)
- mon.write("C")
- local f = ful/fMax
- f = 100*f
- f = math.floor(f)
- mon.setTextColor(1)
- mon.setCursorPos(1,7)
- mon.write("Fuel: ")
- if f < 40 then
- mon.setTextColor(17000)
- elseif f < 85 then
- mon.setTextColor(18)
- else
- mon.setTextColor(15000)
- end
- mon.write(f)
- mon.write("%")
- -- local counter = counter
- -- local adj = adj
- -- local num1 = num1
- -- local num2 = num2
- -- local tmp1 = tmp1
- -- local tmp2 = tmp2
- -- local I = I
- -- local O = O
- local counter = 0
- local num1 = 0
- local num2 = 0
- local I = 0
- local O = 0
- local T = -1
- counter=counter+1
- if counter == 1 then
- num1 = nrg
- local tmp1 = nrg - num2
- local tmp2 = tmp1/nrg
- I = (tmp2*100)
- I = math.floor(I)
- local adj = I - O
- else
- num2 = nrg
- tmp1 = nrg - num1
- tmp2 = tmp1/nrg
- O = math.floor(tmp2*100)
- adj = O - I
- counter = 0
- end
- R=1
- local RA = rod
- R=2
- local RB = rod
- R=3
- local RC = rod
- R=4
- local RD = rod
- R=5
- local RE = rod
- R=6
- local RF = rod
- R=7
- local RG = rod
- R=8
- local RH = rod
- R=9
- local RI = rod
- R=10
- local RJ = rod
- R=11
- local RK = rod
- R=12
- local RL = rod
- R=13
- local RM = rod
- R=14
- local RN = rod
- R=15
- local RO = rod
- R=16
- local RP = rod
- R=17
- local RQ = rod
- R=18
- local RR = rod
- tot = RA+RB+RC+RD+RE+RF+RG+RH+RI+RJ+RK+RL+RM+RN+RO+RP+RQ+RR
- local avg = tot/18
- adj = adj * T
- local fin = avg - adj
- rad.setAllControlRodLevels(fin)
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment