Advertisement
asshousotn

HouOS 0.1.0 Installer

Apr 30th, 2025 (edited)
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.35 KB | None | 0 0
  1. local function Question(Question, Answers)
  2.   print(Question)
  3.   local result = nil
  4.   while result == nil do
  5.     local chr = table.pack(os.pullEvent("char"))
  6.     for i, v in pairs(Answers) do
  7.       if v == string.upper(chr[2]) then result = v end
  8.     end
  9.   end
  10.   return result
  11. end
  12. local download = Question("Do you want to download HouOS BETA 0.1.0? (Y/N)", {"Y", "N"})
  13. if download == "Y" then
  14.   print("Downloading OS files...")
  15.   local OSLOCATION = "8h1b3Xe5"
  16.   shell.run("pastebin", "get", OSLOCATION, "/installerFiles")
  17.   local fil = fs.open("/installerFiles", "r")
  18.   local files = textutils.unserialize(fil.readAll())
  19.   fil.close()
  20.   print("Installing OS files...")
  21.   for i, v in pairs(files) do
  22.     local handler = fs.open(v[1], "w")
  23.     handler.write(v[2])
  24.     handler.close()
  25.     print("Installed "..v[1].. " ("..i.."/"..#files..")")
  26.   end
  27.   fs.delete("/installerFiles")
  28.   print("Done Installing OS! Now on to config")
  29.   local settings = {}
  30.   local terms = Question("Do you have a 51 x 19 terminal (N) or an emulated bigger terminal like CC-PC (B)?", {"N", "B"})
  31.   local rltime = nil
  32.   local h24 = nil
  33.   local day = nil
  34.   local tz = 0
  35.   local tzs = 0
  36.   local inf = nil
  37.   if terms == "N" then
  38.     settings.smallTermMode = true
  39.     rltime = Question("Do you want to display IRL time (R) or Ingame time (I)?", {"R", "I"})
  40.     h24 = "2"
  41.     day = "Y"
  42.     inf = "button"
  43.     if rltime == "R" then
  44.         tzs = Question("Is your time zone positive (P) negitive (N) or GMT (0)?", {"N", "P", "0"})
  45.         if tzs ~= "0" then
  46.             tz = Question("What number is your time zone? (1-9, 0 for 10)?", {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"})
  47.         end
  48.     end
  49.   else
  50.     settings.smallTermMode = false
  51.     rltime = Question("Do you want to display IRL time (R) or Ingame time (I)?", {"R", "I"})
  52.     h24 = Question("Do you want 24 hour time (2) or 12 hour time (1)?", {"2", "1"})
  53.     if rltime == "R" then
  54.         tzs = Question("Is your time zone positive (P) negitive (N) or GMT (0)?", {"N", "P", "0"})
  55.         if tzs ~= "0" then
  56.             tz = Question("What number is your time zone? (1-9, 0 for 10)?", {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"})
  57.         end
  58.     else
  59.       day = Question("Do you want to show MC years (Y) or only MC days (D)?", {"Y", "D"})
  60.     end
  61.     inf = Question("Do you want to have a shortcut menu (S) or taskbar shortcuts (T)?", {"S", "T"})
  62.   end
  63.   if day == "D" then rltime = rltime.."D" end
  64.   if h24 == "2" then rltime = rltime.."24" end
  65.   settings.timemode = rltime
  66.   if inf == "T" then settings.interface = "taskbar" else settings.interface = "button" end
  67.   timezone = tonumber(tz)
  68.   if timezone == 0 then timezone = 10 end
  69.   if tzs == "N" then timezone = timezone * -1
  70.   elseif tzs == "0" then timezone = 0 end
  71.   settings.timezone = timezone
  72.   local st = fs.open("/HouOS/.settings.set", "w")
  73.   st.write(textutils.serialize(settings))
  74.   st.close()
  75.   local pw = fs.open("/pass.word", "w")
  76.   pw.write(textutils.serialize(
  77.   {
  78.      DontUseQWERTYUIOPASDFGHJKLZXCVBNM = {
  79.       hash = "YouCanDeleteThisProfileIfYouWant",
  80.       permlvl = 1,
  81.       salt = "SampleLOL",
  82.       iter = 123,
  83.     }
  84.   }))
  85.   pw.close()
  86.   _G.OSName = "HouOS"
  87.   print("Config done! now onto password setup in 3 seconds")
  88.   sleep(3)
  89.   term.clear()
  90.   term.setCursorPos(1, 1)
  91.   shell.run("/Password.lua", "makeuser", "Admin")
  92.   term.clear()
  93.   print("Done! now rebooting in 3 seconds...")
  94.   sleep(3)
  95.   os.reboot()
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement