Advertisement
marko_rus

web browser

Oct 16th, 2018
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. --ver a0.001.2 (17.10.2018) by marko_rus
  2. --lua5.2 code   dd.mm.yyyy
  3. local com =require("component")
  4. local event =require("event")
  5. local pc = require("computer")
  6. local ip,mod,message,address
  7.  
  8. local dns ="b0ace49e-5bce-4474-8f8d-af2f235cc8d5"
  9. if com.isAvailable("modem") then
  10. mod =com.modem
  11. mod.open(110)
  12. else print("Для работы программы нужен модем или безпроводная карта.")end
  13.  
  14. while true do
  15. os.sleep(1)
  16. ip = io.read()
  17. mod.send(dns, 110, ip)
  18. _, _, _, _, _, message =event.pull("modem_message")
  19. message = "0"
  20. os.sleep(0,1)
  21. _, _, _, _, _, message =event.pull("modem_message")
  22. print(message)
  23. mod.send(message, 110, " ")
  24.  
  25. _, address, _, _, _, message =event.pull(10, "modem_message")
  26. if address ~= message and message ~= nil then
  27. print(message)
  28. else print("Ошибка: сервер оффлайн или не существует.") end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement