Advertisement
-10k-

Untitled

Feb 14th, 2021 (edited)
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. local WIFI = peripheral.find("modem")
  2. local port = 6352
  3.  
  4. if (WIFI == nil) then
  5. print("Could not find wireless modem") return nil
  6. end
  7.  
  8. WIFI.closeAll()
  9.  
  10. WIFI.open(port)
  11.  
  12. if not(WIFI.isOpen(port)) then
  13. print("could not open port:"..tostring(port).." on wireless modem") return nil
  14. end
  15.  
  16. while true do
  17. WIFI.transmit(port,port,read())
  18.  
  19. local _,_,_,_,msg = os.pullEvent("modem_message")
  20. print(textutils.serialise(msg))
  21. end
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement