xXm0dzXx

Untitled

Nov 25th, 2012
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. -- Proxy Server v1.0
  2. rednet.open("top")
  3.  
  4. while true do
  5. id, message = rednet.receive()
  6. if message == "PROXY_SERVER" then
  7. id2, message = rednet.receive(0)
  8. if id2 == id then
  9. local tWords = {}
  10. for match in string.gmatch( _sLine, "[^<PROXY>\t]+" ) do
  11. table.insert( tWords, match )
  12. end
  13. if #tWords >= 2 then
  14. local tID = tWords[1]
  15. local msg = {}
  16. for i=2,#tWords do
  17. msg[ #msg+1 ] = tWords[i]
  18. end
  19. local sMessage = table.concat( msg, "<PROXY>" )
  20. rednet.send( tonumber( tID ), sMessage )
  21. end
  22. end
  23. end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment