Guest User

run

a guest
May 13th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. hidden = false
  2. print("Messages console:") ;
  3. if idhidden == false then
  4.   print("(ID is "..os.getComputerID()..")")
  5.   else
  6.   print("(ID is hidden)")  
  7. end
  8. print("Opening rednet on: TOP") ;
  9. rednet.open("top") ;
  10.  
  11. print("Rednet messages will now be recieved.") ;
  12. function reghandle()
  13.  
  14. while true do
  15.  
  16. end
  17. end
  18.   id, ms = rednet.receive() ;
  19.   if ms == "handle_email" then
  20.   handleEmail()
  21.  
  22.   end
  23.   print("Sending to ID: "..ms..". Now waiting for message") ;
  24.   idtwo, msg = rednet.receive() ;
  25.   print("Sending "..msg.." to "..ms.."!") ;
  26.   print("Writing to log...") ;
  27.     if readabletrack == true then
  28.     firstlog = fs.open("log", "r") ;
  29.     oldlog = firstlog.readLine()
  30.     firstlog.close() ;
  31.     log = fs.open("log", "w") ;
  32.     log.write(oldlog)
  33.     log.write(" ID "..id.." sent "..msg.." to "..ms.." Next: ") ;
  34.     log.close()
  35.     end
  36.   flog = fs.open("clog", "r") ;
  37.   coldlog = flog.readLine()
  38.   flog.close()
  39.  
  40.   complog = fs.open("clog", "w") ;
  41.   complog.writeLine(coldlog)
  42.   complog.writeLine(id)
  43.   complog.writeLine(msg)
  44.   complog.writeLine(ms)
  45.   complog.close()
  46.   print("Making the send-to ID a number")
  47.   ms = tonumber(ms)
  48.   rednet.send(ms, ""..msg.."")
  49.  
  50.  
  51.  
  52.  
  53.  
  54.    
  55.      
  56.        
  57.          
  58.            
  59.              
  60.                
  61.                  
  62. --Email system--
  63. function handleEmail()
  64.   rednet.recieve(4)
  65.   if msg == "severcmd_getmail" then
  66.  handleGetMail()
  67.   elseif msg == "servermode_send" then
  68.   sendmail()
  69.   else
  70.   rednet.send(id, "clientmsg_error") ;
  71.  
  72.   end
Advertisement
Add Comment
Please, Sign In to add comment