View difference between Paste ID: ixCryhur and f8DPGG9C
SHOW: | | - or go back to the newest paste.
1
local s = "back"
2
local m = peripheral.find "modem"
3
local name = os.getComputerLabel()
4
local o = peripheral.wrap(s)
5
6
local function send_metric(...)
7
	m.transmit(3054, 3054, {...})
8
end
9
10
while true do
11
    local l = o.getEnergyStored() / o.getEnergyCapacity()
12
	send_metric("reactor_energy/" .. name, "energy stored by reactor", "set", l)
13
    print(l)
14
    rs.setOutput(s, l < 0.8)
15
    sleep(0.5)
16
end