Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- DONT EDIT THIS OR UPDATE / CHECKUPDATE IS RUINED
- version = "1.0.0"
- -- From here its safe ;)
- term.clear()
- term.setCursorPos(1,1)
- print("Do you want to install Linux OS? ")
- ia = read()
- if ia == "yes" then
- -- Making database
- shell.run("mkdir", "addons")
- shell.run("mkdir", "db")
- shell.run("mkdir", "db/users")
- shell.run("mkdir", "db/users/level")
- shell.run("mkdir", "db/users/pass")
- shell.run("mkdir", "db/users/blocked")
- shell.run("mkdir", "db/sys")
- shell.run("mkdir", "db/sys/config")
- file = io.open("db/sys/config/ap", "w")
- file : write('5')
- file : close()
- -- Asking admin data
- print("Admin username? ")
- ian = read()
- print("Admin password?")
- iap = read()
- -- Registering admin data
- file = io.open("session", "w")
- file : write(ian)
- file : close()
- file = io.open("db/users/pass/"..ian, "w")
- file : write(iap)
- file : close()
- file = io.open("db/users/level/".. ian, "w")
- file : write('6')
- file : close()
- -- File installation
- --between file
- file = io.open("startup", "w")
- file : write([[
- sleep(.001)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Main menu ]--------------------")
- print("I")
- print("I [1] login")
- print("I [2] Register")
- print("I")
- print("-----------------------------------------------")
- stop = false
- while not stop do
- event, char = os.pullEvent()
- if event == "key" and char == 2 then
- shell.run("login")
- stop = true
- elseif event == "key" and char == 3 then
- shell.run("register")
- stop = true
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("register", "w")
- file : write([[
- function acc()
- event = os.pullEvent()
- if event == "char" or event == "key" then
- shell.run("startup")
- end
- end
- function error()
- event = os.pullEvent()
- if event == "char" or event == "key" then
- shell.run("register")
- end
- end
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - register ]---------------------")
- print("I Type back at the username to go back")
- print("I Username:")
- print("I Password:")
- print("I Error:")
- print("I At a error press any key to continue")
- print("-----------------------------------------------")
- term.setCursorPos(13,3)
- rname = read()
- if rname == "back" then
- shell.run("startup")
- end
- term.setCursorPos(13,4)
- rpass = read()
- if fs.exists("db/users/pass/"..rname) then
- term.setCursorPos(10,5)
- print("Username exists")
- error()
- else
- if fs.exists("db/users/blocked/"..rname) then
- term.setCursorPos(10,5)
- print("This user is blocked")
- error()
- else
- file = io.open("db/users/pass/"..rname, "w")
- file : write(rpass)
- file : close()
- file = io.open("db/users/level/"..rname, "w")
- file : write('1')
- file : close()
- term.setCursorPos(3,5)
- print("Account created: Press any key to continue")
- acc()
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("login", "w")
- file : write([[
- function error()
- event = os.pullEvent()
- if event == "char" or event == "key" then
- shell.run("login")
- end
- end
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Login ]------------------------")
- print("I Enter at username: back, to go back")
- print("I Username:")
- print("I Password:")
- print("I Error:")
- print("I At a error press any key to continue")
- print("-----------------------------------------------")
- term.setCursorPos(13,3)
- lname = read()
- if lname == "back" then
- shell.run("startup")
- end
- term.setCursorPos(13,4)
- lpass = read()
- if fs.exists("db/users/pass/"..lname) then
- if fs.exists("db/users/blocked/"..lname) then
- term.setCursorPos(10,5)
- print("This user is blocked")
- error()
- else
- file = io.open("db/users/pass/"..lname, "r")
- gpass = file : read()
- file : close()
- if gpass == lpass then
- file = io.open("session", "w")
- file : write(lname)
- file : close()
- shell.run("loggedin")
- else
- term.setCursorPos(10,5)
- print("Password incorrect")
- error()
- end
- end
- else
- term.setCursorPos(10,5)
- print("Unknown username")
- error()
- end
- ]])
- file : close()
- --between file
- file = io.open("loggedin", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- -- Recieving data
- file = io.open("session", "r")
- sname = file : read()
- file : close()
- file = io.open("db/users/level/"..sname, "r")
- slevel = file : read()
- file : close()
- file = io.open("db/sys/config/ap", "r")
- rpanel = file : read()
- file : close()
- if slevel>rpanel then
- term.setCursorPos(3,12)
- print("[8] Admin panel")
- end
- -- End data, starting GUI
- term.setCursorPos(1,1)
- print("-----------------------------------------------")
- print("I Name: ".. sname)
- term.setCursorPos(38, 2)
- print("Level: "..slevel.." I")
- term.setCursorPos(1,3)
- print("---[ Linux OS - Logged in ]--------------------")
- print("I")
- print("I [1] Addons ")
- print("I [2] User CP ")
- print("I [3] Games ")
- print("I [4] About ")
- print("I [5] System Data ")
- print("I [6] Handy items ")
- print("I [7] Logout ")
- print("I")
- print("I")
- print("-----------------------------------------------")
- stop = false
- while not stop do
- event, char = os.pullEvent()
- if event == "key" and char == 2 then
- shell.run("addon")
- stop = true
- end
- if event == "key" and char == 3 then
- shell.run("ucp")
- stop = true
- end
- if event == "key" and char == 4 then
- shell.run("games")
- stop = true
- end
- if event == "key" and char == 5 then
- shell.run("about")
- stop = true
- end
- if event == "key" and char == 6 then
- shell.run("sd")
- stop = true
- end
- if event == "key" and char == 7 then
- shell.run("hi")
- stop = true
- end
- if event == "key" and char == 8 then
- shell.run("logout")
- stop = true
- end
- if slevel>rpanel then
- if event == "key" and char == 9 then
- shell.run("ap")
- stop = true
- end
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("addon", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Addons ]----------------")
- print("I")
- print("I [1] List addons")
- print("I [2] Select a addon")
- print("I [3] Go back")
- print("----------------------------------------")
- stop = false
- while not stop do
- event, char = os.pullEvent()
- if event == "key" and char == 2 then
- shell.run("list_addon")
- stop = true
- end
- if event == "key" and char == 3 then
- shell.run("select_addon")
- stop = true
- end
- if event == "key" and char == 4 then
- shell.run("loggedin")
- stop = true
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("list_addon", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Addon list ]------------")
- shell.run("list", "addons")
- print("Press any key to continue")
- stop = false
- while not stop do
- event = os.pullEvent()
- if event == "char" or event == "key" then
- shell.run("addon")
- stop = true
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("select_addon", "w")
- file : write([[
- function error()
- event = os.pullEvent()
- if event == "char" or event == "key" then
- shell.run("addon")
- end
- end
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Selecting Addon ]-------")
- print("I")
- print("I Addon: ")
- print("I Error: ")
- print("I BUG: You need to type a working addon")
- print("I twice to run it!")
- print("I At any error code press any key to")
- print("I continue.")
- print("----------------------------------------")
- term.setCursorPos(10,3)
- answer = read()
- if fs.exists("addons/"..answer) then
- shell.run("addons/"..answer)
- else
- term.setCursorPos(10,4)
- print("Unknown addon name")
- error()
- end
- ]])
- file : close()
- --between file
- file = io.open("about", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - About ]-----------------")
- print("I")
- print("I Linux Minecraftus is made on ")
- print("I the Lets Code - server")
- print("I The company makes more systems")
- print("I The main developer is Rickydaan")
- print("I Someone else working on this project")
- print("I is Sgt ")
- print("I LinuxOS is to make CC easyer, ")
- print("I and is the only OS allows you to make ")
- print("I addons, and let them run easy")
- print("I Linux Minecraftus is a multi-script")
- print("I CC maker.")
- print("I Press any key to continue")
- print("----------------------------------------")
- stop = false
- while not stop do
- event = os.pullEvent()
- if event == "key" or event == "char" then
- shell.run("loggedin")
- stop = true
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("games", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Games ]-----------------")
- print("I")
- print("I [1] Snake")
- print("I [2] Adventure")
- print("I [3] Go back")
- print("I COMMENT: Our scripters are making")
- print("I more games!")
- print("I")
- print("----------------------------------------")
- stop = false
- while not stop do
- event, char = os.pullEvent()
- if event == "key" and char == 2 then
- shell.run("clear")
- shell.run("worm")
- stop = true
- end
- if event == "key" and char == 3 then
- shell.run("clear")
- shell.run("adventure")
- stop = true
- end
- if event == "key" and char == 4 then
- shell.run("loggedin")
- stop = true
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("hi", "w")
- file : write([[
- term.clear()
- sleep(.1)
- term.setCursorPos(1,1)
- print("---[ Linux OS - Handy items ]-----------")
- print("I")
- print("I [1] Calculator")
- print("I [2] Go back")
- print("I")
- print("----------------------------------------")
- stop = false
- while not stop do
- event, char = os.pullEvent()
- if event == "key" and char == 2 then
- shell.run("hi_calc")
- stop = true
- end
- if event == "key" and char == 3 then
- shell.run("loggedin")
- stop = true
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("hi_calc", "w")
- file : write([[
- function con()
- event = os.pullEvent()
- if event == "key" or event == "char" then
- shell.run("hi")
- end
- end
- function error()
- event = os.pullEvent()
- if event == "key" or event == "char" then
- shell.run("hi_calc")
- end
- end
- function plus()
- term.setCursorPos(11,12)
- answer = ba + bb
- print(answer)
- con()
- end
- function times()
- term.setCursorPos(11,12)
- answer = ba * bb
- print(answer)
- con()
- end
- function slash()
- term.setCursorPos(11,12)
- answer = ba / bb
- print(answer)
- con()
- end
- function minus()
- term.setCursorPos(11,12)
- answer = ba - bb
- print(answer)
- con()
- end
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Calculator ]------------")
- print("I Say back / exit at q1 to exit")
- print("I Enter a +, -, /, or *")
- print("I ")
- print("I Number one?")
- print("I")
- print("I Number two?")
- print("I")
- print("I Error:")
- print("I If error / answer,")
- print("I press any key to continue")
- print("I Answer: ")
- print("I")
- print("----------------------------------------")
- term.setCursorPos(3,4)
- aa = read()
- term.setCursorPos(3,6)
- ba = read()
- term.setCursorPos(3,8)
- bb = read()
- if aa == "+" then
- plus()
- elseif aa == "-" then
- minus()
- elseif aa == "/" then
- slash()
- elseif aa == "*" then
- times()
- elseif aa == "exit" or aa == "back" then
- shell.run("hi")
- else
- term.setCursorPos(10,9)
- print("Unknown command")
- error()
- end
- ]])
- file : close()
- --between file
- file = io.open("logout", "w")
- file : write([[
- sleep(.1)
- fs.delete("session")
- file = io.open("session", "w")
- file : write()
- file : close()
- shell.run("startup")
- ]])
- file : close()
- --between file
- file = io.open("sd", "w")
- file : write([[
- sleep(.005)
- term.clear()
- term.setCursorPos(15,4)
- file = io.open("db/sys/version", "r")
- cversion = file : read()
- file : close()
- print(cversion)
- if not http then
- term.setCursorPos(17,3)
- print("No")
- term.setCursorPos(19,5)
- print("HTTP is disabled")
- else
- term.setCursorPos(17,3)
- print("Yes")
- site = http.get("http://www.linuxos.vacau.com/programs/curv")
- update = site:readAll()
- if update == cversion then
- term.setCursorPos(19,5)
- print("No")
- else
- term.setCursorPos(19,5)
- print("Yes")
- end
- end
- term.setCursorPos(1,1)
- print("---[ Linux OS - System data ]-----------")
- print("I")
- print("I HTTP enabled: ")
- print("I OS version: ")
- print("I Update avaible: ")
- print("I Press any key to continue")
- print("----------------------------------------")
- -- key detection
- event = os.pullEvent()
- if event == "key" or event == "char" then
- shell.run("loggedin")
- end
- ]])
- file : close()
- --between file
- file = io.open("ucp", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - User CP ]---------------")
- print("I")
- print("I [1] Change password")
- print("I [2] Delete account NOT YET RELEASED")
- print("I [3] Go back")
- print("----------------------------------------")
- stop = false
- while not stop do
- event, char = os.pullEvent()
- if event == "key" and char == 2 then
- shell.run("ucp_cp")
- stop = true
- end
- --if event == "key" and char == 3 then
- --shell.run("ucp_dl")
- --stop = true
- --end
- if event == "key" and char == 4 then
- shell.run("loggedin")
- stop = true
- end
- end
- ]])
- file : close()
- --between file
- file = io.open("ucp_cp", "w")
- file : write([[
- sleep(.1)
- function error()
- event = os.pullEvent()
- if event == "char" or event == "key" then
- shell.run("ucp_cp")
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Change password ]-------")
- print("I")
- print("I Currecent pass:")
- print("I New pass:")
- print("I Retype new pass: ")
- print("I Error:")
- print("I At any error press any key to continue")
- print("I")
- print("----------------------------------------")
- --get data
- file = io.open("session", "r")
- sname = file : read()
- file : close()
- file = io.open("db/users/pass/"..sname, "r")
- cpass = file : read()
- file : close()
- -- end data
- term.setCursorPos(19,3)
- cupass = read()
- term.setCursorPos(13,4)
- anpass = read()
- term.setCursorPos(20,5)
- bnpass = read()
- if cupass == cpass then
- if anpass == bnpass then
- file = io.open("db/users/pass/"..sname, "w")
- file : write(anpass)
- file : close()
- shell.run("ucp")
- else
- term.setCursorPos(9,6)
- print("New passwords doesnt match")
- error()
- end
- else
- term.setCursorPos(9,6)
- print("Currecent password doesnt match")
- error()
- end
- ]])
- file : close()
- file = io.open("ap", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Admin panel ]-----------")
- print("I")
- print("I [1] Block usernames")
- print("I [2] System data / update")
- print("I [3] Change levels")
- print("I [4] Maintenance")
- print("I [5] Change admin panel config")
- print("I [6] Back")
- print("I ")
- print("----------------------------------------")
- stop = false
- while not stop do
- event , char = os.pullEvent()
- if event == "key" and char == 2 then
- shell.run("ap_bu")
- stop = true
- end
- if event == "key" and char == 3 then
- shell.run("ap_sdu")
- stop = true
- end
- if event == "key" and char == 4 then
- shell.run("ap_cl")
- stop = true
- end
- if event == "key" and char == 5 then
- stop = true
- end
- if event == "key" and char == 6 then
- shell.run("ap_con")
- stop = true
- end
- if event == "key" and char == 7 then
- shell.run("loggedin")
- stop = true
- end
- end
- ]])
- file : close()
- file = io.open("ap_bu", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Block user ]------------")
- print("I")
- print("I Username to block: ")
- print("I")
- print("I")
- print("----------------------------------------")
- term.setCursorPos(22,3)
- ub = read()
- file = io.open("db/users/blocked/"..ub, "w")
- file : write()
- file : close()
- shell.run("ap")
- ]])
- file : close()
- file = io.open("ap_cl", "w")
- file : write([[
- function error()
- event = os.pullEvent()
- if event == "char" or event == "key" then
- shell.run("ap_cl")
- end
- end
- file = io.open("session", "r")
- cname = file : read()
- file : close()
- file = io.open("db/users/level/"..cname, "r")
- clevel = file : read()
- file : close()
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Linux OS - Change level ]----------")
- print("I")
- print("I Username: ")
- print("I To level: ")
- print("I Error:")
- print("I At any error press any key to continue")
- print("I")
- print("----------------------------------------")
- term.setCursorPos(13,3)
- tname = read()
- term.setCursorPos(13,4)
- slevel = read()
- term.setCursorPos(10,5)
- if fs.exists("db/users/pass/"..tname) then
- if tname == cname then
- print("You cant change your own level")
- error()
- else
- if slevel>clevel then
- print("Target level too high")
- error()
- else
- file = io.open("db/users/level/"..tname, "w")
- file : write(slevel)
- file : close()
- shell.run("ap")
- end
- end
- else
- print("Username unknown")
- error()
- end
- ]])
- file : close()
- file = io.open("ap_con", "w")
- file : write([[
- sleep(.1)
- term.clear()
- term.setCursorPos(1,1)
- print("---[ Admin panel config ]---------------")
- print("I")
- print("I From what level: ")
- print("I")
- print("----------------------------------------")
- term.setCursorPos(20,3)
- answer = read()
- ganswer = answer - 1
- file = io.open("db/sys/config/ap", "w")
- file : write(ganswer)
- file : close()
- shell.run("ap")
- ]])
- file : close()
- file = io.open("ap_sdu", "w")
- file : write([[
- if not http then
- term.setCursorPos(17,3)
- print("No")
- file = io.open("db/sys/version", "r")
- cver = file : read()
- file : close()
- term.setCursorPos(22,4)
- print(cver)
- else
- siteone = http.get("http://www.linuxos.vacau.com/programs/curv")
- verone = siteone:readAll()
- sitetwo = http.get("http://www.linuxos.vacau.com/programs/losr")
- vertwo = sitetwo:readAll()
- term.setCursorPos(17,3)
- print("Yes")
- file = io.open("db/sys/version", "r")
- cver = file : read()
- file : close()
- if vertwo == cver then
- term.setCursorPos(18,5)
- print("No")
- else
- term.setCursorPos(18,5)
- print("Yes")
- end
- term.setCursorPos(22,4)
- print(cver)
- term.setCursorPos(22,6)
- print(vertwo)
- term.setCursorPos(18,7)
- print(verone)
- end
- -- End of all the shit o.0
- sleep(.1)
- term.setCursorPos(1,1)
- print("---[ Linux OS - S data / update ]-------")
- print("I")
- print("I Http enabled:")
- print("I Currecent version: ")
- print("I Update avaible")
- print("I Recommended build:")
- print("I Newest build")
- print("I")
- print("I If update, rec and newest build ")
- print("I are empty, then you need to put on")
- print("I the Http api")
- print("I")
- print("I [1] NOT YET ADDED")
- print("I [2] NOT YET ADDED")
- print("I [3] Exit")
- print("I")
- print("----------------------------------------")
- stop = false
- while not stop do
- event, char = os.pullEvent()
- if event == "key" and char == 2 then
- updaten()
- stop = true
- end
- end
- ]])
- file : close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement