Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --this program is the basic file manager for all programs, it can not be messed with by the user.
- local tArgs = {...} --Arguements: Mode(Used to tell the program the desired task), Target(Used to tell the program what to select), Action(Used to tell the program the destination to move to if desired, or what to change)
- local Mode = tArgs[1]
- local Target = tArgs[2]
- local Action = tArgs[3]
- start()
- function start()
- Manager()
- end
- function Manager()
- if Mode == "FirstTime" then --creates all required Folders, and Example Files
- SetupFiles()
- else if 0 == 1 then
- else if 0 == 1 then
- else if 0 == 1 then
- end
- end
- function SetupFiles()
- local h = fs.open(".SystemDefiner","r")
- local BootLoader = h.readLine(2)
- local Menu = h.readLine(6)
- local UpdateManager = h.readLine(8)
- local UpdateHandler = h.readLine(10)
- local Security = h.readLine(12)
- h.close()
- fs.makeDir("/rom/Locked/User/Programs")
- fs.makeDir("/rom/Locked/User/Account")
- fs.makeDir("/rom/Locked/User/Logs")
- fs.makeDir("/rom/Locked/User/Keys")
- fs.makeDir("/rom/Locked/User/StoredValues") --For important Files that hold values for many types of programs
- fs.makeDir("/rom/Allowed/User")
- fs.makeDir("/rom/Allowed/User/Programs")
- fs.makeDir("/rom/Allowed/User/Programs/Local_Programs")
- fs.makeDir("/rom/Allowed/User/Programs/Examples")
- fs.makeDir("/rom/Allowed/User/Programs/Examples/Basics")
- fs.makeDir("/rom/Allowed/User/Programs/Examples/Networking")
- fs.makeDir("/rom/Allowed/User/Programs/Examples/Launcher")
- fs.makeDir("/rom/Allowed/User/Programs/Examples/FileManager")
- fs.move(BootLoader,"/rom/Locked/User/Programs") --BootLoader Move
- fs.move(Menu,"/rom/Locked/User/Programs") --Menu Move
- fs.move(UpdateManager,"/rom/Locked/User/Programs") --UpdateManager Move
- fs.move(UpdateHandler,"/rom/Locked/User/Programs") --UpdateHandler Move
- fs.move(Security,"/rom/Locked/User/Programs") --Security Move
- fs.move("start","/rom/Locked/User/Programs") --start Move
- fs.move(".LockedScreen","/rom/Locked/User/Programs") --LockedScreen Move
- fs.move("","/rom/Locked/User/Programs") --login Move
- fs.move("","/rom/Locked/User/Programs") --User_FileManager Move
- fs.move(".Enc_TypeA","/rom/Locked/User/Programs") --Encryption Type A Move
- fs.move(".Account","/rom/Locked/User/Account") --Account Move
- fs.move(".SystemDefiner","/rom/Locked/User/Account/StoredValues") --System Definer Move
- CreateExamples()
- settings.set("SystemState","Ready")
- os.reboot()
- end
- function CreateExamples()
- local file = fs.open("/rom/Allowed/User/Programs/Examples/README.txt","w")
- file.writeLine("hello, this file is here to explain how to")
- file.writeLine("create your own program and have it run on this OS!")
- file.writeLine("-----step 1-------")
- file.writeLine("Create Copies of the following Examples:")
- file.writeLine("EX.ApplicationSetup(Basics)")
- file.writeLine("EX.ApplicationBoot(Basics)")
- file.writeLine("EX.ApplicationUserData(Basics)")
- file.writeLine("then put the copies in a new folder in the 'Local_Programs' folder")
- file.writeLine("-----Step 2-------")
- file.writeLine("Now change the parts of the files name that has EX to the desired name of your APP")
- file.writeLine("-----Step 3-------")
- file.writeLine("Its now time to Setup your Apps Starting phase, this is really important to get right")
- file.writeLine("1. open <AppName>.ApplicationSetup")
- file.writeLine("2. Change the output of the variable 'Launcher' to the launcher of your choice")
- file.writeLine("3. Change the settings in 'Custom' to your specifications")
- file.writeLine("4. save the file")
- file.writeLine("-----Step 4------")
- file.writeLine("Now you can finally start work on coding your Application, which will require")
- file.writeLine("you to use either a custom program or the Already Installed App Creater")
- file.writeLine("then after that you have your own App!")
- file.close()
- file = fs.open("/rom/Allowed/User/Programs/Examples/Basics/EX.ApplicationSetup.txt","w")
- file.writeLine("----DONT TOUCH----")
- file.writeLine("AppState = "Disabled"")
- file.writeLine("LastOpened = "n"")
- file.writeLine("----App Info----")
- file.writeLine("Launcher = "n" --whats used to run the apps code, and ensure security")
- file.writeLine("Creater = "n"")
- file.writeLine("AppID = "n" --used to identify the app quicker and with less memory")
- file.writeLine("----Custom----")
- file.writeLine("EncryptionType = "<empty>" --what the program uses to compress and decompress, and to secure data")
- file.writeLine("CodingLanguage = "lua" --do not mess with this unless you knw what your doing")
- file.writeLine("NetworkProtocol = "n" --dont mess with unless you know how to use Network Function, this variable is for when ever the app needs to send data wirelessly, 'n' will disable network compatibility")
- file.writeLine("AppAccess = ["n","n","n"] --used to identify what files the app can use. replace the 'n' with the names of the apps files. majority of apps are only allowed to access files and folders in the Allowed Section of Storage to prevent security risks")
- file.close()
- file = fs.open("/rom/Allowed/User/Programs/Examples/Basics/EX.ApplicationBoot.txt","w")
- file.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement