Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Question(Question, Answers)
- print(Question)
- local result = nil
- while result == nil do
- local chr = table.pack(os.pullEvent("char"))
- for i, v in pairs(Answers) do
- if v == string.upper(chr[2]) then result = v end
- end
- end
- return result
- end
- local download = Question("Do you want to download HouOS BETA 0.1.0? (Y/N)", {"Y", "N"})
- if download == "Y" then
- print("Downloading OS files...")
- local OSLOCATION = "8h1b3Xe5"
- shell.run("pastebin", "get", OSLOCATION, "/installerFiles")
- local fil = fs.open("/installerFiles", "r")
- local files = textutils.unserialize(fil.readAll())
- fil.close()
- print("Installing OS files...")
- for i, v in pairs(files) do
- local handler = fs.open(v[1], "w")
- handler.write(v[2])
- handler.close()
- print("Installed "..v[1].. " ("..i.."/"..#files..")")
- end
- fs.delete("/installerFiles")
- print("Done Installing OS! Now on to config")
- local settings = {}
- local terms = Question("Do you have a 51 x 19 terminal (N) or an emulated bigger terminal like CC-PC (B)?", {"N", "B"})
- local rltime = nil
- local h24 = nil
- local day = nil
- local tz = 0
- local tzs = 0
- local inf = nil
- if terms == "N" then
- settings.smallTermMode = true
- rltime = Question("Do you want to display IRL time (R) or Ingame time (I)?", {"R", "I"})
- h24 = "2"
- day = "Y"
- inf = "button"
- if rltime == "R" then
- tzs = Question("Is your time zone positive (P) negitive (N) or GMT (0)?", {"N", "P", "0"})
- if tzs ~= "0" then
- tz = Question("What number is your time zone? (1-9, 0 for 10)?", {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"})
- end
- end
- else
- settings.smallTermMode = false
- rltime = Question("Do you want to display IRL time (R) or Ingame time (I)?", {"R", "I"})
- h24 = Question("Do you want 24 hour time (2) or 12 hour time (1)?", {"2", "1"})
- if rltime == "R" then
- tzs = Question("Is your time zone positive (P) negitive (N) or GMT (0)?", {"N", "P", "0"})
- if tzs ~= "0" then
- tz = Question("What number is your time zone? (1-9, 0 for 10)?", {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"})
- end
- else
- day = Question("Do you want to show MC years (Y) or only MC days (D)?", {"Y", "D"})
- end
- inf = Question("Do you want to have a shortcut menu (S) or taskbar shortcuts (T)?", {"S", "T"})
- end
- if day == "D" then rltime = rltime.."D" end
- if h24 == "2" then rltime = rltime.."24" end
- settings.timemode = rltime
- if inf == "T" then settings.interface = "taskbar" else settings.interface = "button" end
- timezone = tonumber(tz)
- if timezone == 0 then timezone = 10 end
- if tzs == "N" then timezone = timezone * -1
- elseif tzs == "0" then timezone = 0 end
- settings.timezone = timezone
- local st = fs.open("/HouOS/.settings.set", "w")
- st.write(textutils.serialize(settings))
- st.close()
- local pw = fs.open("/pass.word", "w")
- pw.write(textutils.serialize(
- {
- DontUseQWERTYUIOPASDFGHJKLZXCVBNM = {
- hash = "YouCanDeleteThisProfileIfYouWant",
- permlvl = 1,
- salt = "SampleLOL",
- iter = 123,
- }
- }))
- pw.close()
- _G.OSName = "HouOS"
- print("Config done! now onto password setup in 3 seconds")
- sleep(3)
- term.clear()
- term.setCursorPos(1, 1)
- shell.run("/Password.lua", "makeuser", "Admin")
- term.clear()
- print("Done! now rebooting in 3 seconds...")
- sleep(3)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement