Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- supported: macerator,electric furnace,extractor,compressor,
- -- supported: ore washing,thermal centrifuge, metal former,canning,
- -- supported: recycler,powered furnace,pulverizer,sawmill, induction smelter
- -- supported: batbox,mfe,cesu,mfsu,capacitor bank
- -- supported: RC tanks, OpenBlock Tank, Dynamic Tank (Mekanism), raintank,
- -- supported: me controller
- -- MC 1.6.4
- -- bitowa paleta kolorå83¥B3w.
- local palette = {["white"] = 1, ["orange"] = 2, ["magenta"] = 4, ["lightBlue"] = 8, ["yellow"] = 16,
- ["lime"] = 32, ["pink"] = 64, ["gray"] = 128, ["lightGray"] = 256, ["cyan"] = 512, ["purple"] = 1024,
- ["blue"] = 2048, ["brown"] = 4096, ["green"] = 8192, ["red"] = 16384, ["black"] = 32768}
- -- *** CONFIG **
- -- zmienne
- local version = "0.6.5"
- local activeMsg, inactiveMsg, pendingMsg = "USING", "IDLE", "PENDI"
- local textSize = 1
- local name_mfsu = "BatBox"
- -- terminal bridge
- energEU = {
- {
- ["id"] = 1,
- ["name"] = " EU:"
- }
- }
- energRF = {
- {
- ["id"] = 2,
- ["name"] = " RF:"
- }
- }
- energMJ = {
- {
- ["id"] = 3,
- ["name"] = " MJ:",
- }
- }
- energ = {energEU,energRF,energMJ}
- memoryAE = {
- {
- ["id"] = 4,
- ["name"] = " Memory:"
- }
- }
- typeAE = {
- {
- ["id"] = 5,
- ["name"] = " Types:"
- }
- }
- AEs = {memoryAE,typeAE}
- RCHeat = {
- {
- ["id"] = 6,
- ["name"] = " Reactor Heat:"
- }
- }
- RactAR = {RCHeat}
- tanksAR = {}
- local bridge = peripheral.wrap("back") -- terminal glasses bridge setup!!
- local widthBR = 100
- local offset2 = 17
- bridge.clear()
- -- Monitory
- local powerMon = "monitor_2" -- monitor for display power info
- local tankMon = "monitor_7" -- monitor for display tanks
- local AEMon = "monitor_5" -- monitor for display AE
- local machMon = "monitor_4" -- monitor for display machines
- local reactMon = "monitor_6" -- monitor for display reactor
- local mon = peripheral.wrap(powerMon)
- local mon2 = peripheral.wrap(tankMon)
- local mon3 = peripheral.wrap(AEMon)
- local mon4 = peripheral.wrap(machMon)
- local mon5 = peripheral.wrap(reactMon)
- mon.clear()
- mon2.clear()
- mon3.clear()
- mon4.clear()
- mon5.clear()
- mon.setTextScale(textSize)
- mon2.setTextScale(textSize)
- mon3.setTextScale(textSize)
- mon4.setTextScale(textSize)
- -- Maszyny --
- -- IC2
- local name_comp = "COMPRESSOR"
- local name_furnace = "E.FURNACE"
- local name_ext = "EXTRCTOR"
- local name_mace = "MACERTOR"
- local name_recycler = "RECYCLR"
- local name_canning = "CAN_MCHINE"
- local name_washer = "ORWASHR"
- local name_centrifuge = "THR. CENTRI"
- local name_former = "METAL FOREM"
- local name_recycler = "RECYCLER"
- -- GT
- local name_pbm = "PLATE BEND.M."
- local name_asseM = "ASSEMBL M."
- local name_ind_grin = "IND.GRINDER"
- local name_ind_BF = "BLAST.FURN."
- -- TE
- local name_REC = "ENERGY CELL"
- local name_pow_furnance = "POW.FURNANCE"
- local name_pulverizer = "PULVERIZER"
- local name_sawmill = "SAWMILL"
- local name_ind_smel = "IND.SMELTER"
- -- Kolory
- local hc = palette.lightBlue -- domyslny kolor nagå85?0šå83¥B3wka
- local tc = palette.white -- domyslny kolor textu
- local color_reading = palette.lime
- local color_inactive = palette.gray
- local color_active = palette.lime
- local color_machines = palette.orange
- local color_ores = palette.pink
- -- Pozycje tekstå83¥B3w
- local pwrX_Reading = 25
- local machineDisplayXPos = 14
- local offsetPos = 2
- local mStatusPos = 28
- local orePos = 36
- -- SPECIAL CHARACTERS
- local separator = " | "
- local spacer = " : "
- -- Inne ustawienia
- local waitTime = {9,13}
- local timer = {0,0,0,0,0,0,0,0,0,0,0}
- local supported_Power = {"mfsu","mfe","batbox", "redstone_energy_cell"} --brak
- local supported_Machines = {"macerator","electric_furnace", "extractor", "compressor", "orewashing","thermalcentrifuge", "metalformer", "canning", "recycler", "tile_thermalexpansion_machine_furnace_name", "tile_thermalexpansion_machine_pulverizer_name", "tile_thermalexpansion_machine_sawmill_name", "tile_thermalexpansion_machine_smelter_name"}
- local sleepTime = 3
- local numFormat = 1
- -- sloty maszyn --
- local ic2ItemUsed = 7
- local ic2ItemCreated = 1
- local gtItemInput = 2
- local gtItemInd = 0
- local teItemInput = 0
- local oreWashItemUsed = 9
- local thermCentrItemUsed = 9
- -- Load API ---
- if fs.exists("enu") then else shell.run("pastebin get Mpk9yubJ enu") end
- os.loadAPI("enu")
- ---------------
- term.clear()
- function upMachines(mnitPeri)
- term.clear()
- term.setCursorPos(1,1)
- machines = peripheral.getNames()
- table.sort(machines)
- if mnitPeri then
- for k, v in pairs(machines) do
- print(tostring(k)..": "..tostring(v))
- end
- end
- end
- function procenty(capa, stor)
- if capa and stor ~= 0 then
- local proc = 100 / capa * stor
- local a = math.floor(proc*1000 + 0.5)/ 1000
- tempProc = string.format("%.2f",a)
- else
- tempProc = 0
- end
- return tempProc
- end
- function round(num, idp)
- local mult = 10^(idp or 0)
- return math.floor(num * mult + 0.5) / mult
- end
- function round1(num)
- local a = math.floor(num*1000 + 0.5)/ 1000
- return a,string.format("%.2f",a)
- end
- function advList(getPeriph) -- lista dostepnych funkcji dla perip.
- uused = getPeriph["getAdvancedMethodsData"]()
- for key, value in pairs(uused) do
- print(value.name)
- --sleep(1)
- end
- end
- function writeCenter(text, xWidth)
- local xspot = math.floor((xWidth/2)-(string.len(text)*1.4))
- return xspot
- end
- function getInfoTankBridge()
- tanksAR={}
- for i=1, #machines do
- if string.find(machines[i], "rcirontankvalvetile")
- or string.find(machines[i], "rcsteeltankvalvetile")
- or string.find(machines[i], "openblocks_tank")
- or string.find(machines[i], "tile_basicblock_dynamic_valve_name")
- or string.find(machines[i], "factory2_1")
- or string.find(machines[i], "water_tank") then
- if peripheral.isPresent(machines[i]) then
- periph = peripheral.wrap(machines[i])
- fluidRaw, fluidName, fluidAmount, fluidCapacity, fluidID = enu.getTank(periph)
- if fluidName == nil then
- elseif fluidName ~= nil then
- tester = {
- {
- ["id"] =machines[i],
- ["name"] = fluidName,
- }
- }
- table.insert(tanksAR,tester)
- end
- end
- end
- end
- return tanksAR
- end
- function disBridgeInfo(array1,posStart,BoxName,colBar,addtext)
- offset2 = 18
- for i=1, #array1 do
- for key,value in pairs(array1[i]) do
- value["label"] = bridge.addText(5,5+offset2 + posStart,array1[i][1]["name"],0x33FF33)
- value["label"].setScale(0.5)
- value["proc"] = bridge.addText(45,5+offset2 + posStart,"FILL: 0.0%",0xC5360F)
- value["proc"].setScale(0.5)
- if addtext then
- value["textadd"] = bridge.addText(10,offset2 + posStart," ",0x33FF33)
- value["textadd"].setScale(0.5)
- end
- value["heatTitle"] = bridge.addText(5,10+offset2 + posStart,"0",0x66FFFF)
- value["heatTitle"].setScale(0.8)
- value["progressbar"] = bridge.addGradientBox(10,10+offset2 + posStart,100,7,0x000033,0.7,0x66ccff,0.7,1)
- value["progressbar"].setZ(10)
- -- value["progressbar"].setColor2(0x66CCFF)
- -- value["progressbar"].setGradient(1)
- value["progressbarmarker"] = bridge.addGradientBox(10,10+offset2 + posStart,1,7,colBar,0.7,0xFFFFFF,0.7,1)
- value["progressbarmarker"].setZ(11)
- -- value["progressbarmarker"].setGradient(1)
- -- value["progressbarmarker"].setColor2(0xFFFFFF)
- value["capTitle"] = bridge.addText(26,11+offset2 + posStart," 0/0",0x33FF33)
- value["capTitle"].setScale(0.5)
- offset2 = offset2 + 18
- end
- end
- boxName = bridge.addBox(2, 2+posStart, 111, offset2, 0x262626, 0.2)
- boxName2 = bridge.addText(5,5+posStart,BoxName,0x66CCFF)
- boxName2.setScale(0.7)
- end
- function ClearBridge(array1)
- for i=1, #array1 do
- -- for key,value in pairs(array1[i]) do
- -- value["label"].delete()
- -- value["proc"].delete()
- -- value["heatTitle"].delete()
- -- value["progressbar"].delete()
- -- value["progressbarmarker"].delete()
- -- value["capTitle"].delete()
- array1 = {}
- -- end
- end
- -- boxName.delete()
- -- boxName2.delete()
- boxName.setOpacity(0)
- boxName2.setText(" ")
- end
- function upBridgeDis(arrayNames,arrayNumber,capa1,stor1,currBOX,colBr,addtext1,newtext)
- for i=#arrayNames,1,-1 do
- for j=#arrayNames[i],1,-1 do
- storage1 = arrayNames[i][j]
- if storage1["id"] == arrayNumber then
- curStored = widthBR / capa1 * stor1
- -- storage1["progressbarmarker"].setColor(0xFFFFFF)
- storage1["progressbarmarker"].setWidth(curStored)
- if addtext1 then
- storage1["textadd"].setText(newtext)
- end
- curStoredE = round1(curStored)
- if curStoredE <= 29 then
- storage1["proc"].setColor(0xFF0000)
- storage1["proc"].setText("FILL: "..curStoredE.."%")
- elseif curStoredE >= 30 and curStoredE <= 79 then
- storage1["proc"].setColor(0xFFFF00)
- storage1["proc"].setText("FILL: "..curStoredE.."%")
- elseif curStoredE >= 80 and curStoredE <= 99 then
- storage1["proc"].setColor(0x009900)
- storage1["proc"].setText("FILL: "..curStoredE.."%")
- elseif curStoredE >= 100 then
- storage1["proc"].setColor(0x66CCFF)
- storage1["proc"].setText("FULL")
- end
- disSmalCAP= enu.dot(stor1).."/"..enu.dot(capa1)
- storage1["capTitle"].setX(writeCenter(disSmalCAP,100)+11)
- storage1["capTitle"].setText(disSmalCAP)
- storage1["heatTitle"].setText(tostring(currBOX))
- end
- end
- end
- end
- function disTankBar(tankProc,monBar,x1PosBar,x2PosBar,yPosBar)
- monBar.setCursorPos(x1PosBar,yPosBar)
- lengBar = x2PosBar - x1PosBar
- widthBar = lengBar / 100 * tankProc
- monBar.write("|")
- if tankProc <= 29 then
- monBar.setBackgroundColor(colors.red)
- elseif tankProc >= 30 and tankProc <= 79 then
- monBar.setBackgroundColor(colors.lime)
- elseif tankProc >= 80 and tankProc <= 99 then
- monBar.setBackgroundColor(colors.green)
- elseif tankProc >= 100 then
- monBar.setBackgroundColor(colors.blue)
- end
- for k = x1PosBar, x1PosBar + widthBar do
- monBar.write(" ")
- end
- monBar.setBackgroundColor(colors.black)
- monBar.setCursorPos(x2PosBar + 2,yPosBar)
- monBar.write("|")
- end
- machines = peripheral.getNames()
- table.sort(machines)
- -- MONITOR 1 x,y Pos
- local machinesInfoCol = 1
- -- MONITOR 2 x,y Pos
- local tankPosStart = 1
- -- *** FUNKCJE ***
- function pFormat(pName) -- formatowanie nazwy
- if string.find(pName, "compressor") then pName = name_comp
- elseif string.find(pName, "electric_furnace") then pName = name_furnace
- elseif string.find(pName, "extractor") then pName = name_ext
- elseif string.find(pName, "macerator") then pName = name_mace
- elseif string.find(pName, "canning") then pName = name_canning
- elseif string.find(pName, "recycler") then pName = name_recycler
- elseif string.find(pName, "former") then pName = name_former
- elseif string.find(pName, "orewashing") then pName = name_washer
- elseif string.find(pName, "thermalcentrifuge") then pName = name_centrifuge
- elseif string.find(pName, "batbox") then pName = name_mfsu
- elseif string.find(pName, "cofh_thermalexpansion_energycell") then pName = name_REC
- elseif string.find(pName, "tile_thermalexpansion_machine_furnace_name") then pName = name_pow_furnance
- elseif string.find(pName, "tile_thermalexpansion_machine_pulverizer_name") then pName = name_pulverizer
- elseif string.find(pName, "tile_thermalexpansion_machine_sawmill_name") then pName = name_sawmill
- elseif string.find(pName, "tile_thermalexpansion_machine_smelter_name") then pName = name_ind_smel
- end
- return pName
- end
- function disReactorIC2()
- mon5.setCursorPos(offsetPos,2)
- for i=1, #machines do
- -- Tanks
- if string.find(machines[i], "nuclear_reactor") then
- NRperiph = peripheral.wrap(machines[i])
- local heatNR = NRperiph["getHeat"]()
- local heatMaxNR = NRperiph["getMaxHeat"]()
- local euOutputNR = NRperiph["getEUOutput"]()*5
- local ActiveNR = NRperiph["isActive"]()
- local procHeat = procenty(heatMaxNR,heatNR)
- -- advList(NRperiph)
- if ActiveNR then powNR = 1 else powNR = 0 end
- upBridgeDis(RactAR,6,heatMaxNR,heatNR,powNR,0x990099,true, "EU Output: "..euOutputNR)
- enu.appendString(reactMon, tc, " Is Active " .. separator, true, offsetPos, 4)
- enu.appendString(reactMon, color_reading, ActiveNR, false, pwrX_Reading, 4)
- enu.appendString(reactMon, tc, " Reactor Heat " .. separator, true, offsetPos, 5)
- enu.appendString(reactMon, color_reading, (enu.dot(heatNR)), false, pwrX_Reading, 5)
- enu.appendString(reactMon, tc, " Max Reactor Heat " .. separator, true, offsetPos,6)
- enu.appendString(reactMon, color_reading, (enu.dot(heatMaxNR)), false, pwrX_Reading,6)
- enu.appendString(reactMon, tc, " EU Output " .. separator, true, offsetPos,8)
- enu.appendString(reactMon, color_reading, (enu.dot(euOutputNR)), false, pwrX_Reading,8)
- enu.appendString(reactMon, tc, " Proc Heat " .. separator, true, offsetPos, 10)
- enu.appendString(reactMon, color_reading, procHeat.."%", false, pwrX_Reading, 10)
- disTankBar(tonumber(procHeat),mon5,2,35,11)
- end
- end
- end
- function dispAE()
- mon3.setCursorPos(offsetPos,2)
- local AEy = 14
- for j=1, #machines do
- -- AE
- if string.find(machines[j], "appeng_me_tilecontroller") then
- AEperiph = peripheral.wrap(machines[j])
- local storedAE = AEperiph["getUnusedBytes"]()
- local capacityAE = AEperiph["getTotalBytes"]()
- local itemCountAE = AEperiph["getStoredItemCount"]()
- local itemSTypeAE = AEperiph["getStoredItemTypes"]()
- local itemTTypeAE = AEperiph["getTotalItemTypes"]()
- local aeJobs = AEperiph["getJobList"]()
- upBridgeDis(AEs,4,capacityAE,storedAE,1,0x330000,true," Items: "..enu.dot(itemCountAE))
- enu.appendString(AEMon, tc, " Memory Stored " .. separator, true, offsetPos, 3)
- enu.appendString(AEMon, color_reading, (enu.dot(storedAE)), false, pwrX_Reading, 3)
- enu.appendString(AEMon, tc, " Memory State " .. separator, true, offsetPos, 4)
- enu.appendString(AEMon, color_reading, procenty(capacityAE,storedAE).."%", false, pwrX_Reading, 4)
- enu.appendString(AEMon, tc, " Memory Capacity " .. separator, true, offsetPos, 5)
- enu.appendString(AEMon, color_reading, (enu.dot(capacityAE)), false, pwrX_Reading,5 )
- enu.appendString(AEMon, tc, " Items " .. separator, true, offsetPos, 7)
- enu.appendString(AEMon, color_reading, (enu.dot(itemCountAE)), false, pwrX_Reading,7 )
- upBridgeDis(AEs,5,itemTTypeAE,itemSTypeAE,1,0x330000,false)
- enu.appendString(AEMon, tc, " Stored Types " .. separator, true, offsetPos, 9)
- enu.appendString(AEMon, color_reading, (enu.dot(itemSTypeAE)), false, pwrX_Reading,9 )
- enu.appendString(AEMon, tc, " Stored Types State " .. separator, true, offsetPos, 10)
- enu.appendString(AEMon, color_reading, procenty(itemTTypeAE,itemSTypeAE).."%", false, pwrX_Reading,10)
- enu.appendString(AEMon, tc, " Total Types " .. separator, true, offsetPos, 11)
- enu.appendString(AEMon, color_reading, (enu.dot(itemTTypeAE)), false, pwrX_Reading,11)
- enu.appendString(AEMon, tc, " Currently Crafting:" .. separator, true, offsetPos, 13)
- for key, value in pairs(aeJobs) do
- enu.appendString(AEMon, palette.lightBlue,tostring(value.qty), false, 4,AEy )
- enu.appendString(AEMon, palette.lightBlue,"- "..value.name, false,12 ,AEy )
- AEy = AEy +1
- end
- end
- end
- for i=1,10,1 do
- mon3.setCursorPos(1,AEy)
- mon3.clearLine()
- AEy = AEy + 1
- end
- end
- function dispTanks()
- mon2.setCursorPos(offsetPos,2)
- ClearBridge(tanksAR)
- getInfoTankBridge()
- disBridgeInfo(tanksAR,168,"- Tank Info -",0xCC0000,false)
- for i=1, #machines do
- -- Tanks
- if string.find(machines[i], "rcirontankvalvetile")
- or string.find(machines[i], "rcsteeltankvalvetile")
- or string.find(machines[i], "openblocks_tank")
- or string.find(machines[i], "tile_basicblock_dynamic_valve_name")
- or string.find(machines[i], "factory2_1")
- or string.find(machines[i], "water_tank") then
- -- print(machines[i])
- if peripheral.isPresent(machines[i]) then
- periph = peripheral.wrap(machines[i])
- fluidRaw, fluidName, fluidAmount, fluidCapacity, fluidID = enu.getTank(periph)
- if fluidName == nil then
- -- brak fluidu nie wyswietli tanka
- elseif fluidName ~= nil then
- mon2.setTextColor(tc)
- tankProc1 = procenty(fluidCapacity,fluidAmount)
- x,y = mon2.getCursorPos()
- mon2.setCursorPos(offsetPos, (y+1))
- mon2.clearLine()
- -- mon2.write(" (" .. fluidName .. ") : " ..enu.dot(fluidAmount) .. " / " ..enu.dot(fluidCapacity) .. " mb (" ..procenty(fluidCapacity,fluidAmount).."%)"))
- mon2.write(" (" .. fluidName .. ") : (" ..tankProc1.."%)")
- disTankBar(tonumber(tankProc1),mon2,28,58,(y+1))
- mon2.setCursorPos(offsetPos, (y+2))
- upBridgeDis(tanksAR,machines[i],fluidCapacity,fluidAmount,"T",0xCC0000,false)
- end
- end
- end
- end
- x,y = mon2.getCursorPos()
- for i=1,10,1 do
- y = y + 1
- mon2.setCursorPos(1,y)
- mon2.clearLine()
- end
- loaded = true
- end
- function dispPower()
- local EUProc = 0
- local RFProc = 0
- local MJProc = 0
- local couMJM = 0
- local couRFM = 0
- local couEUM = 0
- local totalStorage = 0
- local totalCapacity = 0
- local totalStoredRF = 0
- local totalCapacityRF = 0
- local totalStoredMJ = 0
- local totalCapacityMJ = 0
- for i=1, #machines do
- if string.find(machines[i], "batbox") or string.find(machines[i], "mfsu") or string.find(machines[i], "mfe") or string.find(machines[i], "cesu") then -- IC2 Power
- periphEU = peripheral.wrap(machines[i])
- if peripheral.isPresent(machines[i]) then
- local storedEU = periphEU.getEUStored()
- local capacity = periphEU.getEUCapacity()
- if storedEU <= 100 then
- print(machines[i])
- end
- totalStorage = totalStorage + storedEU
- totalStorage = math.floor(totalStorage)
- totalCapacity = capacity + totalCapacity
- EUProc = procenty(totalCapacity,totalStorage)
- couEUM = couEUM + 1
- end
- end
- if string.find(machines[i], "cofh_thermalexpansion_energycell") then -- TE Power
- periphRF = peripheral.wrap(machines[i])
- if peripheral.isPresent(machines[i]) then
- local storedRF = periphRF.getEnergyStored("all")
- local capacityRF = periphRF.getMaxEnergyStored("all")
- if storedRF<= 100 then
- print(machines[i])
- end
- totalStoredRF = storedRF + totalStoredRF
- totalStoredRF = math.floor(totalStoredRF)
- totalCapacityRF = capacityRF + totalCapacityRF
- RFProc = procenty(totalCapacityRF,totalStoredRF)
- couRFM = couRFM +1
- end
- end
- if string.find(machines[i], "blockcapacitorbank") then
- periphMJ = peripheral.wrap(machines[i])
- if peripheral.isPresent(machines[i]) then
- local storedMJ = periphMJ.getMJStored("all")
- local capacityMJ = periphMJ.getMaxEnergyStored("all")
- local maxMJInput = periphMJ.getMaxMJReceived("all")
- local MJ = periphMJ.getActivationEnergy("all")
- if storedMJ <= 100 then
- print(machines[i])
- end
- totalStoredMJ = storedMJ + totalStoredMJ
- totalStoredMJ = math.floor(totalStoredMJ)
- totalCapacityMJ = capacityMJ + totalCapacityMJ
- MJProc = procenty(totalCapacityMJ,totalStoredMJ)
- couMJM = couMJM +1
- end
- end
- end
- upBridgeDis(energ,1,totalCapacity,totalStorage,couEUM,0x3366FF,false)
- enu.appendString(powerMon, palette.lime, " * EU - "..EUProc.."%" , true, offsetPos, 3)
- disTankBar(tonumber(EUProc),mon,23,37,3)
- enu.appendString(powerMon, tc, " Stored EU " .. separator, true, offsetPos, 5)
- enu.appendString(powerMon, color_reading, (enu.dot(totalStorage)), false, pwrX_Reading, 5)
- enu.appendString(powerMon, tc, " Total EU Capacity " .. separator, true, offsetPos, 6)
- enu.appendString(powerMon, color_reading, (enu.dot(totalCapacity)), false, pwrX_Reading,6 )
- enu.appendString(powerMon, tc, " Number of box " .. separator, true, offsetPos, 7)
- enu.appendString(powerMon, color_reading, (enu.dot(couEUM)), false, pwrX_Reading, 7)
- -- RF
- upBridgeDis(energ,2,totalCapacityRF,totalStoredRF,couRFM,0x3366FF,false)
- enu.appendString(powerMon, palette.lime, " * RF - "..RFProc.."%", true, offsetPos, 9)
- disTankBar(tonumber(RFProc),mon,23,37,9)
- enu.appendString(powerMon, tc, " Stored RF " .. separator, true, offsetPos, 11)
- enu.appendString(powerMon, color_reading, (enu.dot(totalStoredRF)), false, pwrX_Reading, 11)
- enu.appendString(powerMon, tc, " Total RF Capacity " .. separator, true, offsetPos, 12)
- enu.appendString(powerMon, color_reading, (enu.dot(totalCapacityRF)), false, pwrX_Reading, 12)
- enu.appendString(powerMon, tc, " Energy Cells " .. separator, true, offsetPos, 13)
- enu.appendString(powerMon, color_reading, (enu.dot(couRFM)), false, pwrX_Reading, 13)
- -- MJ
- upBridgeDis(energ,3,totalCapacityMJ,totalStoredMJ,couMJM,0x3366FF,false)
- enu.appendString(powerMon, palette.lime, " * MJ - "..MJProc.."%", true, offsetPos, 15)
- disTankBar(tonumber(MJProc),mon,23,37,15)
- enu.appendString(powerMon, tc, " Stored MJ " .. separator, true, offsetPos, 17)
- enu.appendString(powerMon, color_reading, (enu.dot(totalStoredMJ)), false, pwrX_Reading, 17)
- enu.appendString(powerMon, tc, " Total MJ Capacity " .. separator, true, offsetPos, 18)
- enu.appendString(powerMon, color_reading, (enu.dot(totalCapacityMJ)), false, pwrX_Reading, 18)
- enu.appendString(powerMon, tc, " Capacitor Banks " .. separator, true, offsetPos, 19)
- enu.appendString(powerMon, color_reading, (enu.dot(couMJM)), false, pwrX_Reading, 19)
- end
- function dispMach()
- machineDispStart = 2 -- machineDisplayXPos
- for i=1, #machines do
- local m
- for m=1, #supported_Machines do
- if string.find(machines[i], supported_Machines[m]) then
- periphM = peripheral.wrap(machines[i])
- if peripheral.isPresent(machines[i]) then
- if string.find(machines[i], "thermalcentrifuge") then
- itemStackUsed = periphM.getStackInSlot(thermCentrItemUsed)
- energyTEProc = 150
- elseif string.find(machines[i], "orewashing") then
- itemStackUsed = periphM.getStackInSlot(oreWashItemUsed)
- energyTEProc = 150
- elseif string.find(machines[i], "tile_thermalexpansion_machine_furnace_name") or string.find(machines[i], "tile_thermalexpansion_machine_pulverizer_name") or string.find(machines[i], "tile_thermalexpansion_machine_sawmill_name") or string.find(machines[i], "tile_thermalexpansion_machine_smelter_name") then
- itemStackUsed = periphM.getStackInSlot(1)
- EnergyTE = periphM["getEnergy"]()
- EnergyMaxTE = periphM["getMaxEnergyStored"]("all")
- energyTEProc = procenty(EnergyMaxTE,EnergyTE)
- --print(energyTEProc)
- elseif string.find(machines[i], "electric_furnace") or string.find(machines[i], "macerator") or string.find(machines[i], "extractor") or string.find(machines[i], "compressor")or string.find(machines[i], "metalformer")or string.find(machines[i], "canning") or string.find(machines[i], "recycler") then
- itemStackUsed = periphM.getStackInSlot(ic2ItemUsed)
- energyTEProc = 150
- else
- itemStackUsed = periphM.getStackInSlot(ic2ItemUsed)
- energyTEProc = 150
- end
- if tonumber(energyTEProc) <= 3 then
- powACT = "NO ENERGY"
- colM = palette.red
- elseif tonumber(energyTEProc) >= 2 and tonumber(energyTEProc) < 120 then
- powACT = " POWERED"
- colM = palette.yellow
- elseif tonumber(energyTEProc) == 150 then
- powACT = " NO INFO"
- colM = color_inactive
- end
- machineDispStart = machineDispStart + 1
- if itemStackUsed ~= nil then
- itemName = enu.itemRename(itemStackUsed.name)
- -- timer[2] = os.clock()
- enu.appendString(machMon, color_ores, itemName, true, orePos, machineDispStart)
- str = (pFormat(peripheral.getType(machines[i])))
- enu.appendString(machMon, tc, str, false, offsetPos, machineDispStart)
- enu.appendString(machMon, colM, powACT, false, 17, machineDispStart)
- enu.appendString(machMon, color_active, activeMsg, false, mStatusPos, machineDispStart)
- elseif itemStackUsed == nil then
- enu.appendString(machMon, color_inactive, inactiveMsg, true, mStatusPos, machineDispStart)
- str = (pFormat(peripheral.getType(machines[i])))
- enu.appendString(machMon, colM, powACT, false, 17, machineDispStart)
- enu.appendString(machMon, tc, str, false, offsetPos, machineDispStart)
- else
- end
- end
- end
- end
- end
- for i=1,10,1 do
- machineDispStart = machineDispStart + 1
- mon4.setCursorPos(1,machineDispStart)
- mon4.clearLine()
- end
- end
- enu.cString(offsetPos, 1, hc, tankMon, "-- TANK INFO --")
- enu.cString(offsetPos, 1, hc, AEMon, "-- AE INFO --")
- enu.cString(offsetPos, 1, hc, powerMon, "-- POWER INFO--")
- enu.cString(offsetPos, machinesInfoCol, hc, machMon, "-- MACHINES INFO --")
- enu.cString(offsetPos, 1, hc, reactMon, "-- Reactor INFO --")
- disBridgeInfo(energ,0,"- Power Info -",0xCC0000,false)
- disBridgeInfo(AEs,74,"- AE Info -",0xCC0000,true)
- disBridgeInfo(RactAR,130,"- Reactor Info -",0xCC0000,true)
- getInfoTankBridge()
- disBridgeInfo(tanksAR,168,"- Tank Info -",0xCC0000,false)
- -- Start
- while true do
- upMachines(false)
- disReactorIC2()
- dispAE()
- dispTanks()
- dispPower()
- dispMach()
- sleep(1.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement