Advertisement
Clorith

Untitled

Sep 29th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.   end
  32.  
  33.   sleep( 10 )
  34. end
  35.  
  36. rednet.close( "back" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement