Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. local function makeMailString(sDst,sMsg)
  5.  
  6.  local res = "#|#$MAIL#|#"..sDst.."#|#"..os.getComputerID().."#|#"..sMsg.."#|#"
  7.  return res
  8.  
  9. end -- end makeMailString
  10.  
  11. print("Type your message here:")
  12. local msg = read()
  13. print("")
  14. print("Destination Computer ID:")
  15. local dst = read()
  16.  
  17. print("")
  18. print("")
  19. print("Message:  "..msg)
  20. print("Destination:  "..dst)
  21. sMail = makeMailString(dst,msg)
  22. print(sMail)
  23.  
  24. rednet.send(iServerID,sMail)
  25.  
  26. local a,b,c = rednet.receive("10")
  27. if b~=nil then
  28.  local header,d,e,msg = split(b)
  29.  if (header == "$REPLY") and (msg == "mail got") then
  30.   print("mail sent")
  31.  end
  32. else
  33. print("Connection timeout, try again later")
  34. end
  35.  
  36.  
  37. sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement