Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ver a0.001.2 (17.10.2018) by marko_rus
- --lua5.2 code dd.mm.yyyy
- local com =require("component")
- local event =require("event")
- local pc = require("computer")
- local ip,mod,message,address
- local dns ="b0ace49e-5bce-4474-8f8d-af2f235cc8d5"
- if com.isAvailable("modem") then
- mod =com.modem
- mod.open(110)
- else print("Для работы программы нужен модем или безпроводная карта.")end
- while true do
- os.sleep(1)
- ip = io.read()
- mod.send(dns, 110, ip)
- _, _, _, _, _, message =event.pull("modem_message")
- message = "0"
- os.sleep(0,1)
- _, _, _, _, _, message =event.pull("modem_message")
- print(message)
- mod.send(message, 110, " ")
- _, address, _, _, _, message =event.pull(10, "modem_message")
- if address ~= message and message ~= nil then
- print(message)
- else print("Ошибка: сервер оффлайн или не существует.") end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement