29 lines
517 B
Lua
29 lines
517 B
Lua
local args = { ... }
|
|
|
|
modem_location = "right"
|
|
lns_server = "default"
|
|
|
|
rednet.open(modem_location)
|
|
receiverID = rednet.lookup("lns", lns_server)
|
|
current_time = os.time()
|
|
|
|
|
|
data = {
|
|
["action"] = "lookup",
|
|
["hostname"] = args[1]
|
|
}
|
|
|
|
rednet.send(receiverID, data)
|
|
|
|
while true do
|
|
id, msg = rednet.receive()
|
|
if id == receiverID then
|
|
if msg == nil then
|
|
print("Hostname not found!")
|
|
break
|
|
else
|
|
io.write(msg .. "\n")
|
|
break
|
|
end
|
|
end
|
|
end |