Anonomit

log

Aug 11th, 2012
1,160
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     --Created by Anonomit
  2.  
  3. rednet.open( "right" )
  4. rednet.open( "left" )
  5. rednet.open( "back" )
  6. rednet.open( "top" )
  7. rednet.open( "bottom" )
  8.  
  9. rednet.broadcast( "log" )
  10. while true do
  11.     event, param1, param2 = os.pullEvent( "rednet_message" )
  12.     if param2 == "startLogging" then
  13.         print( "Logging Started" )
  14.         break --while true
  15.     elseif param2 == "wait" then
  16.         print( "Please wait..." )
  17.        
  18.         while true do
  19.             event, param1, param2 = os.pullEvent( "rednet_message" )
  20.             if param2 == "0" then
  21.                 print( "No loggers have finished" )
  22.                 break --while true
  23.             elseif param2 == "1" then
  24.                 print( "1 logger has finished" )
  25.                 break --while true
  26.             elseif event == "rednet_message" then
  27.                 print( param2, " loggers have finished" )
  28.                 break --while true
  29.             end --if param2 == "0"
  30.         end --while true
  31.        
  32.         while true do
  33.             event, param1, param2 = os.pullEvent( "rednet_message" )
  34.             if param2 == "0" then
  35.                 break --while true
  36.             elseif param2 == "1" then
  37.                 print( "1 logger needs more saplings" )
  38.                 break --while true
  39.             elseif event == "rednet_message" then
  40.                 print( param2, " loggers need more saplings" )
  41.                 break --while true
  42.             end --if param2 == "0"
  43.         end --while true
  44.        
  45.         while true do
  46.             event, param1, param2 = os.pullEvent( "rednet_message" )
  47.             if param2 == "0" then
  48.                 break --while true
  49.             elseif param2 == "1" then
  50.                 print( "1 logger is out of saplings" )
  51.                 break --while true
  52.             else
  53.                 print( param2, " loggers have no saplings" )
  54.                 break --while true
  55.             end --if param2 == "0"
  56.         end --while true
  57.         break --while true
  58.     end --if param2 == "startLogging"
  59.    
  60. end --while true
RAW Paste Data