Advertisement
abstract_abstract

domain_registry.lua

Oct 8th, 2024
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. rednet.open("left")
  2.  
  3. if #arg == 0 then
  4.     print("Error: domain name not specified")
  5.     return
  6. end
  7.  
  8. local name = arg[1]
  9. local id = os.getComputerID()
  10.  
  11. local data = {name = name, id = id}
  12. local message = textutils.serialise(data)
  13.  
  14. rednet.send(126, message, "dns_register")
  15.  
  16. local senderID, message, protocol = rednet.receive("dns_ack")
  17. print(message)
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement