Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("ondOS") then
- fs.makeDir("ondOS")
- fs.makeDir("ondOS/Users")
- fs.makeDir("ondOS/Lua")
- end
- if not fs.exists("ondOS/Lua/lang") then
- shell.run("pastebin get qVbWnL4N ondOS/Lua/lang")
- end
- shell.run("ondOS/Lua/lang")
- shell.run("clear")
- local l = lang
- local function newSession(title, subtitle)
- term.setBackgroundColor(colors.blue)
- paintutils.drawFilledBox(1, 1, 51, 19)
- term.setBackgroundColor(colors.cyan)
- paintutils.drawFilledBox(1, 1, 51, 3)
- term.setTextColor(colors.white)
- local pos = #title / 3
- term.setCursorPos(pos, 2)
- write(title)
- term.setCursorPos(1, 4)
- term.setBackgroundColor(colors.blue)
- print(subtitle)
- return true
- end
- newSession(l.setup1_title, l.setup1_subtitle)
- redo = true
- local function iGetCode()
- term.setCursorPos(1, 8)
- print(l.setup1_info)
- write(l.setup1_code .. ": ")
- term.setTextColor(colors.yellow)
- term.setCursorPos(7, 9)
- input = read()
- if input ~= "cancel" and input ~= "terminal" then
- num = math.random(100, 999)
- term.setCursorPos(10, 10)
- term.setTextColor(colors.yellow)
- write("Verifying.. ")
- if input == "" or string.find(input, " ") then
- sleep(.3)
- term.setCursorPos(10, 10)
- term.setTextColor(colors.red)
- write(l.setup1_novar .. " ")
- redo = true
- sleep(2)
- term.setTextColor(colors.white)
- iGetCode()
- return
- end
- term.setCursorPos(1, 15)
- term.setTextColor(colors.blue)
- shell.run("pastebin get " .. input .. " testlang" .. num)
- local file = fs.open("testlang" .. num, "r")
- local content = file.readAll()
- if not string.find(content, "lang") then
- term.setCursorPos(10, 10)
- term.setTextColor(colors.orange)
- write(l.setup1_nolang .. " ")
- term.setTextColor(colors.white)
- sleep(.5)
- redo = true
- else
- term.setCursorPos(10, 10)
- term.setTextColor(colors.green)
- write(l.setup1_set .. " ")
- if fs.exists("ondOS/Lua/lang") then
- fs.delete("ondOS/Lua/lang")
- end
- shell.run("testlang" .. num)
- l = lang
- shell.run("copy testlang" .. num .. " ondOS/Lua/lang")
- term.setTextColor(colors.white)
- sleep(3)
- redo = false
- end
- elseif input == "terminal" then
- shell.run("ondOS/Lua/cmdprompt")
- return
- elseif input == "cancel" then
- redo = false
- end
- if redo == true then
- redo = false
- iGetCode()
- return
- end
- end
- iGetCode()
- local function contains(text, char)
- if string.find(text, char) then
- return true
- else
- return false
- end
- end
- local function getUserInfo()
- redo = false
- newSession(l.setup2_title, l.setup2_subtitle)
- term.setTextColor(colors.yellow)
- term.setCursorPos(12, 7)
- write(l.setup2_name)
- term.setTextColor(colors.white)
- term.setCursorPos(4, 8)
- username = read()
- term.setTextColor(colors.yellow)
- term.setCursorPos(12, 9)
- write(l.setup2_password)
- term.setTextColor(colors.white)
- term.setCursorPos(4, 10)
- password = read()
- if contains(username, "/") or contains(username, "*") or contains(username, "!") or contains(username, "rom") or contains(username, " ") then
- term.setCursorPos(8, 12)
- term.setTextColor(colors.red)
- write(l.setup2_userinnapt .. " ")
- sleep(2)
- redo = true
- end
- if username == "" then
- term.setCursorPos(8, 12)
- term.setTextColor(colors.red)
- write(l.setup2_nouser .. " ")
- sleep(2)
- redo = true
- end
- if fs.exists("ondOS/Users/" .. username) then
- term.setCursorPos(8, 12)
- term.setTextColor(colors.red)
- write(l.setup2_userexists .. " ")
- sleep(2)
- redo = false
- end
- if contains(password, "/") or contains(password, "*") or contains(password, "!") or contains(password, "rom") or contains(password, " ") then
- term.setCursorPos(8, 12)
- term.setTextColor(colors.red)
- write(l.setup2_passinnapt .. " ")
- sleep(2)
- redo = true
- end
- if redo == true then
- getUserInfo()
- return
- end
- newSession(l.settingup, l.wait)
- sleep(.75)
- fs.makeDir("ondOS/Users/" .. username)
- sleep(.75)
- fs.makeDir("ondOS/Users/" .. username .. "/pass_" .. password)
- sleep(.75)
- fs.makeDir("ondOS/Users/" .. username .. "/admin")
- end
- getUserInfo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement