SHOW:
|
|
- or go back to the newest paste.
| 1 | -- wireless info-- | |
| 2 | local modemSide = "left" | |
| 3 | ||
| 4 | local canvas = peripheral.wrap("back").canvas()
| |
| 5 | canvas.clear() | |
| 6 | local group = canvas.addGroup({0, 0})
| |
| 7 | local react1Info = nil | |
| 8 | local react1Status = nil | |
| 9 | ||
| 10 | function init() | |
| 11 | group.addRectangle(0, 0, 100, 50, 0xDDDDDD) | |
| 12 | rednet.open(modemSide) | |
| 13 | end | |
| 14 | ||
| 15 | function run() | |
| 16 | init() | |
| 17 | react1Info = group.addText({5, 5}, "Reactor Info")
| |
| 18 | react1Info.setScale(.75) | |
| 19 | react1Status = group.addText({5, 12}, "Reactor status")
| |
| 20 | react1Status.setScale(.5) | |
| 21 | ||
| 22 | while true do | |
| 23 | id, msg = rednet.receive("reactor")
| |
| 24 | react1Info.setText(msg["current"].. " / ".. msg["max"]) | |
| 25 | react1Status.setText("Is on: "..tostring(msg["active"]))
| |
| 26 | sleep(.2) | |
| 27 | end | |
| 28 | ||
| 29 | end | |
| 30 | ||
| 31 | run() | |
| 32 | ||
| 33 |