5bitesofcookies

run_edit

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