SHOW:
|
|
- or go back to the newest paste.
1 | local GUI = require("GUI") | |
2 | - | -- Import libraries |
2 | + | local system = require("System") |
3 | - | local GUI = require("GUI") |
3 | + | |
4 | - | local system = require("System") |
4 | + | local workspace, window, menu = system.addWindow(GUI.filledWindow(1, 1, 60, 20, 0xE1E1E1)) |
5 | ||
6 | - | --------------------------------------------------------------------------------- |
6 | + | local xxx1 = window:addChild(GUI.text(2, 2, 0x4B4B4B, " ")) |
7 | local xxx2 = window:addChild(GUI.text(2, 4, 0x4B4B4B, " ")) | |
8 | - | -- Add a new window to MineOS workspace |
8 | + | local xxx3 = window:addChild(GUI.text(2, 5, 0x4B4B4B, " ")) |
9 | - | local workspace, window, menu = system.addWindow(GUI.filledWindow(1, 1, 60, 20, 0xE1E1E1)) |
9 | + | local xxx4 = window:addChild(GUI.text(2, 7, 0x4B4B4B, " ")) |
10 | local xxx5 = window:addChild(GUI.text(2, 8, 0x4B4B4B, " ")) | |
11 | - | -- Add single cell layout to window |
11 | + | |
12 | - | --local layout = window:addChild(GUI.layout(1, 1, window.width, window.height, 1, 1)) |
12 | + | window.onResize = function(newWidth, newHeight) |
13 | window.backgroundPanel.width, window.backgroundPanel.height = newWidth, newHeight | |
14 | - | -- Add nice gray text object to layout |
14 | + | layout.width, layout.height = newWidth, newHeight |
15 | - | window:addChild(GUI.text(1, 1, 0x4B4B4B, "qwe")) |
15 | + | end |
16 | ||
17 | - | window.onResize = function(newWidth, newHeight) |
17 | + | workspace:draw() |
18 | - | window.backgroundPanel.width, window.backgroundPanel.height = newWidth, newHeight |
18 | + | |
19 | - | layout.width, layout.height = newWidth, newHeight |
19 | + | |
20 | - | end |
20 | + | local c = require "component" |
21 | ||
22 | - | --------------------------------------------------------------------------------- |
22 | + | local EUx = 0 |
23 | local RFx = 0 | |
24 | - | -- Draw changes on screen after customizing your window |
24 | + | local space = " " |
25 | - | workspace:draw() |
25 | + | |
26 | xxx1.text = "Написал программу: StreamerYT" | |
27 | ||
28 | while true do | |
29 | -- ========== EU энергия ========== | |
30 | ||
31 | local EU = 0 | |
32 | local EUmax = 0 | |
33 | ||
34 | for a, n in c.list("mfe") do | |
35 | ec = c.proxy(a) | |
36 | EUmax = EUmax + ec.getEUCapacity() | |
37 | EU = EU + ec.getStored() | |
38 | end | |
39 | ||
40 | for a, n in c.list("mfsu") do | |
41 | ec = c.proxy(a) | |
42 | EUmax = EUmax + ec.getEUCapacity() | |
43 | EU = EU + ec.getStored() | |
44 | end | |
45 | ||
46 | EUp = math.floor((100 / EUmax) * EU) | |
47 | xxx2.text = "EU: (" .. EUp.. "%) " .. math.floor(EU) .. " / " .. math.floor(EUmax) .. "" .. space | |
48 | EUx = math.floor(EU - EUx) | |
49 | --xxx3.text = "Накапливается: " .. EUx .. " EU/s" .. space | |
50 | ||
51 | -- ========== ========== ========== | |
52 | ||
53 | ||
54 | ||
55 | -- ========== RF энергия ========== | |
56 | ||
57 | local RF = 0 | |
58 | local RFmax = 0 | |
59 | ||
60 | for a, n in c.list("tile_thermalexpansion_cell_resonant_name") do | |
61 | ec = c.proxy(a) | |
62 | RFmax = RFmax + ec.getMaxEnergyStored() | |
63 | RF = RF + ec.getEnergyStored() | |
64 | end | |
65 | ||
66 | RFp = math.floor((100 / RFmax) * RF) | |
67 | xxx4.text = "RF: (" .. RFp.. "%) " .. math.floor(RF) .. " / " .. math.floor(RFmax) .. "" .. space | |
68 | RFx = math.floor(RF - RFx) | |
69 | --xxx5.text = "Накапливается: " .. RFx .. " RF/s" .. space) | |
70 | ||
71 | -- ========== ========== ========== | |
72 | ||
73 | EUx = EU | |
74 | RFx = RF | |
75 | --os.sleep(1) | |
76 | end | |
77 |