Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local GUI = require("GUI")
- local system = require("System")
- local workspace, window, menu = system.addWindow(GUI.filledWindow(1, 1, 60, 20, 0xE1E1E1))
- local xxx1 = window:addChild(GUI.text(2, 2, 0x4B4B4B, " "))
- local xxx2 = window:addChild(GUI.text(2, 4, 0x4B4B4B, " "))
- local xxx3 = window:addChild(GUI.text(2, 5, 0x4B4B4B, " "))
- local xxx4 = window:addChild(GUI.text(2, 7, 0x4B4B4B, " "))
- local xxx5 = window:addChild(GUI.text(2, 8, 0x4B4B4B, " "))
- window.onResize = function(newWidth, newHeight)
- window.backgroundPanel.width, window.backgroundPanel.height = newWidth, newHeight
- layout.width, layout.height = newWidth, newHeight
- end
- workspace:draw()
- local c = require "component"
- local EUx = 0
- local RFx = 0
- local space = " "
- xxx1.text = "Написал программу: StreamerYT"
- while true do
- -- ========== EU энергия ==========
- local EU = 0
- local EUmax = 0
- for a, n in c.list("mfe") do
- ec = c.proxy(a)
- EUmax = EUmax + ec.getEUCapacity()
- EU = EU + ec.getStored()
- end
- for a, n in c.list("mfsu") do
- ec = c.proxy(a)
- EUmax = EUmax + ec.getEUCapacity()
- EU = EU + ec.getStored()
- end
- EUp = math.floor((100 / EUmax) * EU)
- xxx2.text = "EU: (" .. EUp.. "%) " .. math.floor(EU) .. " / " .. math.floor(EUmax) .. "" .. space
- EUx = math.floor(EU - EUx)
- --xxx3.text = "Накапливается: " .. EUx .. " EU/s" .. space
- -- ========== ========== ==========
- -- ========== RF энергия ==========
- local RF = 0
- local RFmax = 0
- for a, n in c.list("tile_thermalexpansion_cell_resonant_name") do
- ec = c.proxy(a)
- RFmax = RFmax + ec.getMaxEnergyStored()
- RF = RF + ec.getEnergyStored()
- end
- RFp = math.floor((100 / RFmax) * RF)
- xxx4.text = "RF: (" .. RFp.. "%) " .. math.floor(RF) .. " / " .. math.floor(RFmax) .. "" .. space
- RFx = math.floor(RF - RFx)
- --xxx5.text = "Накапливается: " .. RFx .. " RF/s" .. space)
- -- ========== ========== ==========
- EUx = EU
- RFx = RF
- --os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement