Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bridge = peripheral.wrap("top")
- local cell1 = peripheral.wrap("cofh_thermalexpansion_energycell_0")
- local mfe1 = peripheral.wrap("mfe_0")
- bridge.clear()
- -- Variabeln --
- local height = 150
- local width = 30
- reset = 0
- if cell1:match"thermalexpansion_energycell" then
- rfp = bridge.addText(19,173, "0", 0xffffff)
- back = bridge.addBox(9, 14, 0, 5, 0x000000, 1)
- cap = bridge.addGradientBox(10, 15, 0, 5, 0xff0038, 1, 0x37c500, 1, 1)
- cap.setWidth(width)
- cap.setHeight(height)
- back.setWidth(width+2)
- back.setHeight(height+2)
- label = bridge.addText(19,5,"RF",0xffffff)
- else
- print("kein rf")
- end
- eup = bridge.addText(19, 373, "0", 0xffffff)
- back = bridge.addBox(9, 214, 0, 5, 0x000000, 1)
- cap = bridge.addGradientBox(10, 215, 0, 5, 0xff0038, 1, 0x37c500, 1, 1)
- cap.setWidth(width)
- cap.setHeight(height)
- back.setWidth(width+2)
- back.setHeight(height+2)
- label = bridge.addText(19,205,"EU",0xffffff)
- while true do
- --math --
- rfs = cell1.getEnergyStored("west")
- rfm = cell1.getMaxEnergyStored("west")
- rfb = rfs/rfm*100
- rfa = math.floor(rfb+0.5)
- heightrf = height*((100-rfa)/100)
- eus = mfe1.getEUStored()
- eum = mfe1.getEUCapacity()
- eub = eus/eum*100
- eua = math.floor(eub+0.5)
- heighteu = height*((100-eua)/100)
- -- draw text --
- rfp.setText(tostring(rfa).."%")
- eup.setText(tostring(eua).."%")
- -- draw box --
- amorf = bridge.addBox(9, 14, 0, 61.5, 0x000000, 1)
- amorf.setHeight(heightrf)
- amorf.setWidth(width+2)
- amoeu = bridge.addBox(9, 214, 0, 61.5, 0x000000, 1)
- print("1")
- amoeu.setHeight(heighteu)
- amoeu.setWidth(width+2)
- reset = reset+1
- if reset == 2400 then
- shell.run("selbst2")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment