Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Functions--
- --Email system--
- function handleEmail()
- rednet.recieve(4)
- if msg == "severcmd_getmail" then
- handleGetMail()
- elseif msg == "servermode_send" then
- sendmail()
- else
- rednet.send(id, "clientmsg_error") ;
- end
- --end of email system--
- --test
- hidden = false
- print("Messages console:") ;
- if idhidden == false then
- print("(ID is "..os.getComputerID()..")")
- else
- print("(ID is hidden)")
- end
- print("Opening rednet on: TOP") ;
- rednet.open("top") ;
- print("Rednet messages will now be recieved.") ;
- function reghandle()
- while true do
- end
- end
- id, ms = rednet.receive() ;
- if ms == "handle_email" then
- handleEmail()
- end
- print("Sending to ID: "..ms..". Now waiting for message") ;
- idtwo, msg = rednet.receive() ;
- print("Sending "..msg.." to "..ms.."!") ;
- print("Writing to log...") ;
- if readabletrack == true then
- firstlog = fs.open("log", "r") ;
- oldlog = firstlog.readLine()
- firstlog.close() ;
- log = fs.open("log", "w") ;
- log.write(oldlog)
- log.write(" ID "..id.." sent "..msg.." to "..ms.." Next: ") ;
- log.close()
- end
- flog = fs.open("clog", "r") ;
- coldlog = flog.readLine()
- flog.close()
- complog = fs.open("clog", "w") ;
- complog.writeLine(coldlog)
- complog.writeLine(id)
- complog.writeLine(msg)
- complog.writeLine(ms)
- complog.close()
- print("Making the send-to ID a number")
- ms = tonumber(ms)
- rednet.send(ms, ""..msg.."")
Advertisement
Add Comment
Please, Sign In to add comment