Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Api Load
- os.loadAPI("CCOS/kernal/kernal")
- -- Varibles
- OSVer = "1.1.2"
- running = "1"
- SeverLocation = "/CCOS/ROM/LocalServer"
- homecol = colours.lightBlue
- KernalVer = "1.5"
- --Emulator id: 125
- --FUNCTIONS
- function BG(colour)
- term.setBackgroundColour(colour)
- end
- function TColour(tcol)
- term.setTextColour(tcol)
- end
- function clear()
- shell.run("clear")
- end
- function p(Text)
- print(Text)
- end
- function reboot()
- BG(colours.red)
- term.setCursorPos(50,25)
- p("Really restart? (yes/no)")
- local rebootquestion = read()
- if rebootquestion == "yes" then
- clear()
- term.setCursorPos(23,05)
- TColour(colours.black)
- p("Restarting...")
- sleep(5)
- os.reboot()
- end
- shell.run("CCOS/System/OS")
- end
- function Shutdown()
- BG(colours.red)
- term.setCursorPos(50,25)
- p("Really shutdown? (yes/no)")
- local rebootquestion = read()
- if rebootquestion == "yes" then
- clear()
- term.setCursorPos(23,05)
- TColour(colours.black)
- p("Powering off...")
- sleep(5)
- os.shutdown()
- end
- shell.run("CCOS/System/OS")
- end
- function close()
- shell.run("startup")
- end
- function run(app)
- shell.run(app)
- end
- function requestReboot()
- BG(colours.red)
- term.setCursorPos(50,25)
- p("An app is trying to reboot allow? (yes/no) (SAVE FIRST!!!)")
- local rebootquestion = read()
- if rebootquestion == "yes" then
- clear()
- term.setCursorPos(23,05)
- TColour(colours.black)
- p("Restarting...")
- sleep(5)
- os.reboot()
- end
- shell.run("CCOS/System/OS")
- end
- --Code
- print("Somethings gone wrong... The kernal has not loaded please make sure the kernal is in the CCOS/Kernal/ Folder. then reboot. If it's nots please reinstall the OS!")
- BG(homecol)
- clear()
- TColour(colours.white)
- print("CCOS Home Screen")
- while running == "1" do
- p("1 - Exit to CraftOS (Shell) (ADVANCED)")
- p("2 - Restart Computer")
- p("3 - Launch a LUA application")
- p("4 - Open Lua prompt")
- p("5 - About OS")
- p("6 - Developer options")
- p("7 - Shutdown Computer")
- p("8 - Reload OS file")
- p("9 - Wipe system cache")
- p("10 - Reload kernal")
- write("Your option: ")
- input = read()
- if input == "1" then
- running = "0"
- BG(colours.black)
- TColour(colours.white)
- clear()
- else
- if input == "2" then
- running = "0"
- reboot()
- sleep(10)
- else
- if input == "3" then
- running = "0"
- clear()
- write("Enter the name of the applcation you want to open here: ")
- local AppToOpen = read()
- shell.run(AppToOpen)
- BG(colours.white)
- clear()
- print("Welcome Back restarting enviroment... please wait...")
- sleep(1)
- shell.run("OS")
- else
- if input == "4" then
- BG(colours.black)
- clear()
- TColour(colours.red)
- p("Starting Lua command promt to exit please enter close() DO NOT ENTER exit() AS THIS WILL EXIT THE OS")
- sleep(5)
- clear()
- shell.run("lua")
- else
- if input == "5" then
- BG(colours.blue)
- TColour(colours.yellow)
- term.setCursorPos(50,25)
- p("Programmed by: Cameron Fleming")
- p("OSVersion: "..OSVer)
- p("Kernal Version: "..KernalVer)
- p("Press enter to exit")
- read()
- BG(homecol)
- TColour(colours.white)
- shell.run(s)
- else
- if input == "6" then
- BG(colours.black)
- clear()
- run("CCOS/apps/developeroptions")
- else
- if input == "7" then
- Shutdown()
- else
- if input == "8" then
- shell.run("CCOS/System/OS")
- else
- if input == "9" then
- shell.run("CCOS/System/CacheMan")
- BG(homecol)
- TColour(colours.white)
- shell.run(s)
- end
- if input == "10" then
- shell.run("kernal")
- end
- end
- end
- end
- end
- end
- end
- end
- end
- clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment