Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Quest Privacy Addon: By Atenefyr
- local restricted = true --if "false" then pick from ~60 septillion registers (create new every boot), if "true" then pick from 20 registers (create 20 at setup and pick from those)
- local debug = false --show debug lines when choosing IP; true or false
- if not fs.exists(".quest_ips") and restricted then
- print("Setting up Quest Privacy Addon, please wait..")
- shell.run("/rom/programs/http/pastebin", "run", "XvEebm4K", "20", "silent")
- end
- if not fs.exists("/.Quest.settings") then
- local open = fs.open("/.Quest.settings", "w")
- open.write(textutils.serialize({Home = 'http://thehub.qst/', ClientIdentifier = nil}))
- open.close()
- end
- local open = fs.open("/.Quest.settings", "r")
- local all = open.readAll()
- open.close()
- local t = textutils.unserialize(all)
- if restricted then
- local open = fs.open("/.quest_ips", "r")
- local c = tonumber(open.readLine())
- local mn = math.random(1, c)
- if debug then
- print("Picking IP " .. mn .. "/" .. c)
- end
- for i = 1, mn do
- l = open.readLine()
- end
- if debug then
- print("IP " .. mn .. "/" .. c .. " is ".. l)
- end
- open.close()
- else
- if debug then
- print("Creating IP..")
- end
- l = http.get("http://quest.net76.net/registerClient.php").readAll()
- if debug then
- print("Using IP " .. l .. " (generated from the web)")
- end
- end
- t["ClientIdentifier"] = l
- local open = fs.open("/.Quest.settings", "w")
- open.write(textutils.serialize(t))
- open.close()
- if debug then
- print("Set IP, booting Quest")
- sleep(1) --to see the text
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement