SHOW:
|
|
- or go back to the newest paste.
| 1 | glass = peripheral.wrap("bottom")
| |
| 2 | ||
| 3 | rednet.open( "back" ) | |
| 4 | ||
| 5 | -- We always reset when starting back up | |
| 6 | glass.clear() | |
| 7 | ||
| 8 | -- Quarry status | |
| 9 | statusQuarry = glass.addText( 40, 55, "Quarry", 0xFF0000 ) | |
| 10 | ||
| 11 | while true do | |
| 12 | device = "" | |
| 13 | ||
| 14 | rednet.broadcast( "get quarry" ) | |
| 15 | ||
| 16 | sleep( 1 ) | |
| 17 | ||
| 18 | senderID, message, distance = rednet.receive() | |
| 19 | print( senderID .. ": " .. message ) | |
| 20 | ||
| 21 | for i in string.gmatch( message, "%S+" ) do | |
| 22 | if not device then | |
| 23 | device = i | |
| 24 | else | |
| 25 | if i == "off" then | |
| 26 | statusQuarry.setColor( 0x229000 ) | |
| 27 | else | |
| 28 | statusQuarry.setColor( 0xFF0000 ) | |
| 29 | end | |
| 30 | end | |
| 31 | - | sleep(10) |
| 31 | + | |
| 32 | ||
| 33 | sleep( 10 ) | |
| 34 | end | |
| 35 | ||
| 36 | rednet.close( "back" ) |