Advertisement
dradra1

SecretChat

Apr 30th, 2023 (edited)
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.open("top")
  2. while true do
  3. message=0
  4. os.queueEvent("randomEvent")
  5. os.pullEvent()
  6. print("do you want to resive or send message?")
  7. print("1 for send and 2 for resive")
  8. a=read()
  9. a=tonumber(a)
  10.  
  11. if a==1 then
  12. print("type in your message")
  13. msg=read()
  14. rednet.broadcast(msg)
  15. end
  16.  
  17. if a==2 then
  18. print("waiting for the message")
  19. while message == 0 do
  20. id,message=rednet.receive()
  21. print("here is your message")
  22. print(message)
  23. end
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement