SHOW:
|
|
- or go back to the newest paste.
| 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 | - | rednet.send(ms, ""..msg.."") |
| 48 | + | |
| 49 | print("Writing to log...") ;
| |
| 50 | if readabletrack == true then | |
| 51 | firstlog = fs.open("log", "r") ;
| |
| 52 | oldlog = firstlog.readLine() | |
| 53 | firstlog.close() ; | |
| 54 | - | |
| 54 | + | |
| 55 | - | |
| 55 | + | |
| 56 | - | |
| 56 | + | |
| 57 | - | |
| 57 | + | |
| 58 | - | |
| 58 | + | |
| 59 | - | |
| 59 | + | |
| 60 | - | |
| 60 | + | |
| 61 | - | |
| 61 | + | |
| 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.."") |