LuaScripts/linkedGet.lua

17 lines
506 B
Lua
Raw Normal View History

2021-01-07 23:30:28 +00:00
local event = require("event")
local keyboard = require("keyboard")
local component = require("component")
2021-01-07 23:57:07 +00:00
local internet = require("internet")
2021-01-07 23:30:28 +00:00
local tunnel = component.tunnel
while true do
local _, _, _, _, _, message = event.pull("modem_message")
2021-01-07 23:57:07 +00:00
local result = ""
local handle = internet.request("http://worldtimeapi.org/api/timezone/Europe/Moscow")
for chunk in handle do
result = result..chunk
end
local mt = getmetatable(handle)
print(result..message)
2021-01-07 23:30:28 +00:00
tunnel.send("succes!")
end