diff --git a/lns.lua b/lns.lua index 8a54437..cfe2c54 100644 --- a/lns.lua +++ b/lns.lua @@ -2,7 +2,21 @@ args = { ... } cache = {} -allow_dynamic_lns_hosts = false + +settings.define("lns_client.allow_dynamic_lns_hosts", { + description = "Allow dynamic LNS hosts", + type = "boolean", + default = false +}) + +settings.define("lns_client.lns_server", { + description = "LNS Server Rednet ID", + type = "number", + default = 8 +}) + +allow_dynamic_lns_hosts = settings.get("lns_client.allow_dynamic_lns_hosts") +lns_server_id = settings.get("lns_client.lns_server") function lns_lookup(remote_hostname) local data = { @@ -10,7 +24,6 @@ function lns_lookup(remote_hostname) ["hostname"] = remote_hostname } - local lns_server_id = 8 if allow_dynamic_lns_hosts then lns_server_id = rednet.lookup("lns", lns_server) if lns_server_id == nil then