computercraft/dig.lua
2023-10-07 23:52:54 -04:00

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