Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Energy Cell
- e1 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_0")
- e2 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_1")
- e3 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_2")
- e4 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_3")
- e5 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_4")
- e6 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_5")
- e7 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_6")
- e8 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_7")
- e9 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_8")
- e10 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_9")
- e11 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_10")
- e12 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_11")
- e13 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_12")
- e14 = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_13")
- -- Turbines
- b1 = peripheral.wrap("BigReactors-Turbine_1")
- b2 = peripheral.wrap("BigReactors-Turbine_2")
- b3 = peripheral.wrap("BigReactors-Turbine_3")
- b4 = peripheral.wrap("BigReactors-Turbine_4")
- b5 = peripheral.wrap("BigReactors-Turbine_5")
- b6 = peripheral.wrap("BigReactors-Turbine_6")
- b7 = peripheral.wrap("BigReactors-Turbine_7")
- b8 = peripheral.wrap("BigReactors-Turbine_8")
- -- Peripheriques
- d = peripheral.wrap("monitor_0")
- rednet.open("back")
- while true do
- u1 = e1.getEnergyStored()
- u2 = e2.getEnergyStored()
- u3 = e3.getEnergyStored()
- u4 = e4.getEnergyStored()
- u5 = e5.getEnergyStored()
- u6 = e6.getEnergyStored()
- u7 = e7.getEnergyStored()
- u8 = e8.getEnergyStored()
- u9 = e9.getEnergyStored()
- u10 = e10.getEnergyStored()
- u11 = e11.getEnergyStored()
- u12 = e12.getEnergyStored()
- u13 = e13.getEnergyStored()
- u14 = e14.getEnergyStored()
- t1 = b1.getEnergyProducedLastTick()
- t2 = b2.getEnergyProducedLastTick()
- t3 = b3.getEnergyProducedLastTick()
- t4 = b4.getEnergyProducedLastTick()
- t5 = b5.getEnergyProducedLastTick()
- t6 = b6.getEnergyProducedLastTick()
- t7 = b7.getEnergyProducedLastTick()
- t8 = b8.getEnergyProducedLastTick()
- r1 = b1.getRotorSpeed()
- r2 = b2.getRotorSpeed()
- r3 = b3.getRotorSpeed()
- r4 = b4.getRotorSpeed()
- r5 = b5.getRotorSpeed()
- r6 = b6.getRotorSpeed()
- r7 = b7.getRotorSpeed()
- r8 = b8.getRotorSpeed()
- local function centerText(text)
- x,y = d.getSize()
- x1,y1 = d.getCursorPos()
- d.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
- d.write(text)
- end
- -- Presentation
- d.clear()
- d.setCursorPos(1,3)
- d.setTextColor(1025)
- centerText("| Energy |")
- --Presentation
- d.setCursorPos(35,7)
- d.write("|")
- d.setCursorPos(35,8)
- d.write("|")
- d.setCursorPos(35,9)
- d.write("|")
- d.setCursorPos(35,10)
- d.write("|")
- d.setCursorPos(35,11)
- d.write("|")
- d.setCursorPos(35,12)
- d.write("|")
- d.setCursorPos(35,13)
- d.write("|")
- d.setCursorPos(35,14)
- d.write("|")
- d.setCursorPos(35,15)
- d.write("|")
- d.setCursorPos(35,16)
- d.write("|")
- d.setCursorPos(35,17)
- d.write("|")
- d.setCursorPos(35,18)
- d.write("|")
- d.setCursorPos(35,19)
- d.write("|")
- d.setCursorPos(35,20)
- d.write("|")
- d.setCursorPos(35,21)
- d.write("|")
- d.setCursorPos(35,22)
- d.write("|")
- d.setCursorPos(35,23)
- d.write("|")
- d.setCursorPos(35,24)
- d.write("|")
- d.setCursorPos(35,25)
- d.write("|")
- d.setCursorPos(35,26)
- d.write("|")
- -- Generator
- d.setTextColor(4096)
- d.setCursorPos(1,4)
- d.write("------------")
- d.setCursorPos(1,5)
- d.write("|Generateur|")
- d.setCursorPos(1,6)
- d.write("------------")
- d.setTextColor(1)
- d.setCursorPos(1,7)
- d.write("Status :")
- id, message = rednet.receive()
- tableG = textutils.unserialize(message)
- --Status
- d.setCursorPos(18,7)
- if tableG[1] == true then
- d.setTextColor(32)
- d.write("On")
- else
- d.setTextColor(16384)
- d.write("Off")
- end
- --Consomation
- d.setTextColor(1)
- d.setCursorPos(1,8)
- d.write("Consomation :")
- d.setCursorPos(18,8)
- d.write(tableG[3])
- d.setCursorPos(25,8)
- d.write(" Y/h ")
- --Rod
- d.setCursorPos(1,9)
- d.write("Rod Insertion :")
- d.setCursorPos(18,9)
- d.write(tableG[2])
- d.setCursorPos(25,9)
- d.write(" % ")
- --Fuel
- d.setCursorPos(1,10)
- d.write("Reactivity : ")
- d.setCursorPos(18,10)
- if tableG[1] == true then
- d.write(tableG[4])
- d.setCursorPos(25,10)
- d.write(" % ")
- else
- d.write("Off")
- end
- --Temperature
- d.setCursorPos(1,11)
- d.write("Temperature ; ")
- d.setCursorPos(18,11)
- d.write(tableG[5])
- d.setCursorPos(25,11)
- d.write(" C ")
- if tableG[5] >= 600 then
- d.setTextColor(16384)
- d.setCursorPos(28,11)
- d.write(" DANGER")
- d.setTextColor(1)
- else
- d.setTextColor(32)
- d.setCursorPos(28,11)
- d.write(" Ok")
- d.setTextColor(1)
- end
- -- Turbines
- d.setTextColor(16384)
- d.setCursorPos(55,4)
- d.write("------------")
- d.setCursorPos(55,5)
- d.write("|Turbines|")
- d.setCursorPos(55,6)
- d.write("------------")
- d.setTextColor(1)
- --color
- vert = 8192
- bleue = 2048
- rouge = 16384
- --T 1
- if r1 < 200 then
- d.setBackgroundColor(rouge)
- d.setCursorPos(39,7)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,7)
- d.write("T1 : Offline")
- d.setBackgroundColor(colors.black)
- end
- if r1 < 1600 and r1 > 200 then
- d.setBackgroundColor(bleue)
- d.setCursorPos(39,7)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,7)
- d.write("T1: ")
- d.write(math.ceil(r1))
- d.setCursorPos(47,7)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- if r1 > 1600 then
- d.setBackgroundColor(vert)
- d.setCursorPos(39,7)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,7)
- d.write("T1: ")
- d.write(math.ceil(r1))
- d.setCursorPos(47,7)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- --T2
- if r2 < 200 then
- d.setBackgroundColor(rouge)
- d.setCursorPos(55,8)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,8)
- d.write("T2 : Offline")
- d.setBackgroundColor(colors.black)
- end
- if r2 < 1600 and r2 > 200 then
- d.setBackgroundColor(bleue)
- d.setCursorPos(55,8)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,8)
- d.write("T2: ")
- d.write(math.ceil(r2))
- d.setCursorPos(63,8)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- if r2 > 1600 then
- d.setBackgroundColor(vert)
- d.setCursorPos(55,8)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,8)
- d.write("T2: ")
- d.write(math.ceil(r2))
- d.setCursorPos(63,8)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- --t3
- if r3 < 200 then
- d.setBackgroundColor(rouge)
- d.setCursorPos(39,9)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,9)
- d.write("T3 : Offline")
- d.setBackgroundColor(colors.black)
- end
- if r3 < 1600 and r3 > 200 then
- d.setBackgroundColor(bleue)
- d.setCursorPos(39,9)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,9)
- d.write("T3: ")
- d.write(math.ceil(r3))
- d.setCursorPos(47,9)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- if r3 > 1600 then
- d.setBackgroundColor(vert)
- d.setCursorPos(39,9)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,9)
- d.write("T3: ")
- d.write(math.ceil(r3))
- d.setCursorPos(47,9)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- --T4
- if r4 < 200 then
- d.setBackgroundColor(rouge)
- d.setCursorPos(55,10)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,10)
- d.write("T4 : Offline")
- d.setBackgroundColor(colors.black)
- end
- if r4 < 1600 and r4 > 200 then
- d.setBackgroundColor(bleue)
- d.setCursorPos(55,10)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,10)
- d.write("T4: ")
- d.write(math.ceil(r4))
- d.setCursorPos(63,10)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- if r4 > 1600 then
- d.setBackgroundColor(vert)
- d.setCursorPos(55,10)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,10)
- d.write("T4: ")
- d.write(math.ceil(r4))
- d.setCursorPos(63,10)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- --t5
- if r5 < 200 then
- d.setBackgroundColor(rouge)
- d.setCursorPos(39,12)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,12)
- d.write("T5 : Offline")
- d.setBackgroundColor(colors.black)
- end
- if r5 < 1600 and r5 > 200 then
- d.setBackgroundColor(bleue)
- d.setCursorPos(39,12)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,12)
- d.write("T5: ")
- d.write(math.ceil(r5))
- d.setCursorPos(47,12)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- if r5 > 1600 then
- d.setBackgroundColor(vert)
- d.setCursorPos(39,12)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,12)
- d.write("T5: ")
- d.write(math.ceil(r5))
- d.setCursorPos(47,12)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- --T6
- if r6 < 200 then
- d.setBackgroundColor(rouge)
- d.setCursorPos(55,13)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,13)
- d.write("T6 : Offline")
- d.setBackgroundColor(colors.black)
- end
- if r6 < 1600 and r6 > 200 then
- d.setBackgroundColor(bleue)
- d.setCursorPos(55,13)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,13)
- d.write("T6: ")
- d.write(math.ceil(r6))
- d.setCursorPos(63,13)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- if r6 > 1600 then
- d.setBackgroundColor(vert)
- d.setCursorPos(55,13)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,13)
- d.write("T6: ")
- d.write(math.ceil(r6))
- d.setCursorPos(63,13)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- --t7
- if r7 < 200 then
- d.setBackgroundColor(rouge)
- d.setCursorPos(39,14)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,14)
- d.write("T7 : Offline")
- d.setBackgroundColor(colors.black)
- end
- if r7 < 1600 and r7 > 200 then
- d.setBackgroundColor(bleue)
- d.setCursorPos(39,14)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,14)
- d.write("T7: ")
- d.write(math.ceil(r7))
- d.setCursorPos(47,14)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- if r7 > 1600 then
- d.setBackgroundColor(vert)
- d.setCursorPos(39,14)
- d.write(string.rep(" ",11))
- d.setCursorPos(39,14)
- d.write("T7: ")
- d.write(math.ceil(r7))
- d.setCursorPos(47,14)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- --T8
- if r8 < 200 then
- d.setBackgroundColor(rouge)
- d.setCursorPos(55,15)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,15)
- d.write("T8 : Offline")
- d.setBackgroundColor(colors.black)
- end
- if r8 < 1600 and r8 > 200 then
- d.setBackgroundColor(bleue)
- d.setCursorPos(55,15)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,15)
- d.write("T8: ")
- d.write(math.ceil(r8))
- d.setCursorPos(63,15)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- if r8 > 1600 then
- d.setBackgroundColor(vert)
- d.setCursorPos(55,15)
- d.write(string.rep(" ",11))
- d.setCursorPos(55,15)
- d.write("T8: ")
- d.write(math.ceil(r8))
- d.setCursorPos(63,15)
- d.write(" RPM")
- d.setBackgroundColor(colors.black)
- end
- -- Energy
- d.setTextColor(16)
- d.setCursorPos(1,13)
- d.write("----------")
- d.setCursorPos(1,14)
- d.write("|Stockage|")
- d.setCursorPos(1,15)
- d.write("----------")
- d.setTextColor(1)
- energ = u1+u2+u3+u4+u5+u6+u7+u9+u10+u11+u12+u13+u14
- energy = energ/1000000
- d.setCursorPos(1,16)
- --Stock
- d.write("Energie stockée :")
- d.setCursorPos(18,16)
- d.write(math.ceil(energy))
- d.setCursorPos(25,16)
- d.write(" M Rf")
- --Delta
- -- if ut == nil then
- -- ut = 0
- -- delta = 0 -- initialisation
- -- else
- -- ut0 = ut --Ancien Tick
- -- ut = u1+u2+u3+u4+u5+u6+u7+u9+u10+u11+u12+u13+u14 --Nouveau tick
- -- delta = ut-ut0
- -- end
- -- deltac = delta/15
- -- d.setCursorPos(1,17)
- -- d.write("Delta :")
- -- d.setCursorPos(18,17)
- -- d.write(deltac)
- -- d.setCursorPos(25,17)
- -- d.write(" Rf/t ")
- -- Production
- d.setTextColor(8)
- d.setCursorPos(1,19)
- d.write("------------")
- d.setCursorPos(1,20)
- d.write("|Production|")
- d.setCursorPos(1,21)
- d.write("------------")
- d.setTextColor(1)
- d.setCursorPos(1,22)
- d.write("Turbines :")
- d.setCursorPos(18,22)
- p = t1+t2+t3+t4+t5+t6+t7+t8
- d.write(p)
- d.setCursorPos(25,22)
- d.write(" Rf/t ")
- sleep(0) --while
- end
Add Comment
Please, Sign In to add comment