Advertisement
pfgpastebin

Mailserver

Sep 20th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. people = {
  2. pfgminecraft=1
  3. }
  4.  
  5. function string:split(inSplitPattern, outResults)
  6. if not outResults then
  7. outResults = {}
  8. end
  9. local theStart = 1
  10. local theSplitStart, theSplitEnd = string.find(self, inSplitPattern, theStart)
  11. while theSplitStart do
  12. table.insert(outResults,string.sub(self,theStart,theSplitStart - 1))
  13. theStart = theSplitEnd+1
  14. theSplitStart,theSplitEnd = string.find(self,inSplitPattern,theStart)
  15.  
  16. end
  17. table.insert(outResults, string.sub(self,theStart))
  18. return outResults
  19. end
  20.  
  21. rednet.open('bottom')
  22. while true do
  23. local senderid, message, protocol = rednet.receive("mailreq")
  24. rednet.send(people[message.split(',')[1]],senderid .. "," .. (string.gsub(message.split(',')[2],",",'[comma]')), 'mailreq')
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement