Advertisement
Clorith

Untitled

Sep 29th, 2013
80
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.   senderID, message, distance = rednet.receive()
  15.   print( senderID .. ": " .. message )
  16.  
  17.   for i in string.gmatch( message,  "%S+" ) do
  18.     if not device then
  19.       device = i
  20.     else
  21.       if i == "off" then
  22.         statusQuarry.setColor( 0x229000 )
  23.       else
  24.         statusQuarry.setColor( 0xFF0000 )
  25.       end
  26.     end
  27.   end
  28.  
  29.   rednet.broadcast( "get quarry" )
  30.  
  31.   sleep(10)
  32. end
  33.  
  34. rednet.close( "back" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement