Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inputTable = {
- SOtop = "if rs.getOutput(\"top\") then\
- \
- rs.setOutput( \"top\", false )\
- \
- else\
- \
- rs.setOutput( \"top\", true )\
- \
- end",
- onSetting = "os.pullEvent = os.pullEventRaw\
- \
- term.setTextColor( colours.red )\
- print(\"Lights On!\")\
- \
- if fs.exists(\"/.onA1\") then\
- \
- shell.run(\"SOtop\")\
- \
- end\
- \
- if fs.exists(\"/.onA2\") then\
- \
- shell.run(\"SOright\")\
- \
- end\
- \
- if fs.exists(\"/.onA3\") then\
- \
- shell.run(\"SObottom\")\
- \
- end\
- \
- if fs.exists(\"/.onA4\") then\
- \
- shell.run(\"SOleft\")\
- \
- end\
- \
- if fs.exists(\"/.onA5\") then\
- \
- shell.run(\"SOback\")\
- \
- end\
- \
- shell.run(\"afterPass\")\
- term.setCursorPos( 5, 15 )\
- shell.run(\"OSterm\")",
- startScreen = "os.pullEvent = os.pullEventRaw\
- \
- function SS()\
- \
- term.setCursorPos( 1, 1 )\
- term.setBackgroundColor( colours.blue )\
- term.setTextColor( colours.lime )\
- term.clear()\
- \
- shell.run(\"OSsig\")\
- print()\
- \
- term.setTextColor( colours.black )\
- print(\"Welcome to Kersey operating system!\")\
- print(\"accessing files, please wait...\")\
- print()\
- \
- end\
- \
- function perc()\
- \
- SS()\
- term.setTextColor( colours.white )\
- \
- end\
- \
- sleep(1)\
- perc()\
- print(\" 2 %\")\
- print(\"--------------------\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 5 %\")\
- print(\"+-------------------\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 12 %\")\
- print(\"++------------------\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 19 %\")\
- print(\"+++-----------------\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 31 %\")\
- print(\"++++++--------------\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 46 %\")\
- print(\"+++++++++-----------\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 58 %\")\
- print(\"+++++++++++---------\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 70 %\")\
- print(\"++++++++++++++------\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 83 %\")\
- print(\"++++++++++++++++----\")\
- sleep(1)\
- SS()\
- perc()\
- print(\" 95 %\")\
- print(\"+++++++++++++++++++-\")\
- sleep(1)\
- SS()\
- perc()\
- print(\"100 %\")\
- print(\"====================\")\
- sleep(1)\
- print()\
- \
- term.setTextColor( colours.black )\
- print(\"Files found, applying.\")\
- sleep(2)\
- shell.run(\"beforePass\")",
- onSetup = "os.pullEvent = os.pullEventRaw\
- \
- if fs.exists(\"/.yes2\") then\
- \
- shell.run(\"pass4\")\
- \
- elseif fs.exists(\"/.no2\") then\
- \
- term.setTextColor( colours.red )\
- print(\"Door Open!\")\
- shell.run(\"RSmenu1\")\
- \
- else\
- \
- term.clear()\
- shell.run(\"afterPass\")\
- term.setCursorPos( 5, 15 )\
- term.setTextColor( colours.lime )\
- \
- print(\"Would you like to\")\
- print(\" password this file?\")\
- print()\
- \
- yes = \"yes\"\
- no = \"no\"\
- \
- term.setTextColor( colours.blue )\
- write(\"yes/no: \")\
- \
- term.setTextColor( colours.lime )\
- input = read()\
- \
- if input == yes then\
- \
- file = fs.open( \"/.yes2\", \"w\" )\
- file.write(input)\
- file.close()\
- \
- shell.run(\"pass4\")\
- \
- elseif input == no then\
- \
- file = fs.open( \"/.no2\", \"w\" )\
- file.write(input)\
- file.close()\
- \
- shell.run(\"RSmenu1\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"That is not an option!\")\
- sleep(2)\
- \
- shell.run(\"onSetup\")\
- \
- end\
- end",
- openSetting = "os.pullEvent = os.pullEventRaw\
- \
- term.setTextColor( colours.red )\
- print(\"Door Open!\")\
- \
- if fs.exists(\"/.openA1\") then\
- \
- shell.run(\"outputTop\")\
- \
- end\
- \
- if fs.exists(\"/.openA2\") then\
- \
- shell.run(\"outputRight\")\
- \
- end\
- \
- if fs.exists(\"/.openA3\") then\
- \
- shell.run(\"outputBottom\")\
- \
- end\
- \
- if fs.exists(\"/.openA4\") then\
- \
- shell.run(\"outputLeft\")\
- \
- end\
- \
- if fs.exists(\"/.openA5\") then\
- \
- shell.run(\"outputBack\")\
- \
- end\
- \
- shell.run(\"afterPass\")\
- term.setCursorPos( 5, 15 )\
- shell.run(\"OSterm\")",
- outputBottom = "rs.setOutput(\"bottom\", true )\
- sleep(3)\
- rs.setOutput(\"bottom\", false )",
- afterPass = "term.setBackgroundColor( colours.black )\
- term.setCursorPos( 1, 1 )\
- term.clear()\
- \
- shell.run(\"OSsig\")\
- print()\
- \
- term.setTextColor( colours.blue )\
- \
- -- 32 spaces --\
- \
- print(\" +----------------------------------+\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" +----------------------------------+\")\
- print()\
- \
- term.setTextColor( colours.red )\
- \
- term.setCursorPos( 4, 5 )\
- print(\"Open Door ................. open\")\
- print()\
- \
- term.setCursorPos( 4, 7 )\
- print(\"Lights On/Off ........... lights\")\
- print()\
- \
- term.setCursorPos( 4, 9 )\
- print(\"Change User Setting ..... change\")\
- print()\
- \
- term.setCursorPos( 4, 11 )\
- print(\"Uninstall ............ uninstall\")\
- term.setCursorPos( 5, 15 )",
- acc2 = "--------[ ACCOUNT 1 SETUP ]--------\
- \
- term.setBackgroundColor( colours.white )\
- term.setTextColor( colours.lime )\
- term.setCursorPos( 1, 1 )\
- term.clear()\
- shell.run(\"OSsig\")\
- \
- function acc2()\
- \
- if fs.exists(\"/.account2\") then\
- \
- term.setTextColor( colours.blue )\
- \
- print()\
- write(\"Username: \")\
- file = fs.open(\"/.account2\",\"r\")\
- acc1 = file.readAll()\
- file.close()\
- \
- term.setTextColor( colours.black )\
- \
- acc1A = read()\
- \
- if acc1A == acc1 then\
- \
- shell.run(\"pass2\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"Account does not exist!\")\
- sleep(2)\
- shell.run(\"acc2\")\
- \
- end\
- \
- elseif not fs.exists(\"/.account2\") then\
- \
- term.setTextColor( colours.blue )\
- \
- print()\
- write(\"New Username: \")\
- \
- term.setTextColor( colours.black )\
- \
- newUser1 = read()\
- file = fs.open(\"/.account2\",\"w\")\
- file.write(newUser1)\
- file.close()\
- \
- if not fs.exists(\"/.iopen\") then\
- \
- file = fs.open(\"/.iopen\", \"w\")\
- file.write(input)\
- file.close()\
- \
- end\
- \
- if not fs.exists(\"/.ion\") then\
- \
- file = fs.open(\"/.ion\", \"w\")\
- file.write(input)\
- file.close()\
- \
- end\
- \
- term.setTextColor( colours.red )\
- \
- print(\"New Username is set.\")\
- sleep(2)\
- acc2()\
- \
- end\
- end\
- \
- acc2()",
- outputLeft = "rs.setOutput(\"left\", true )\
- sleep(3)\
- rs.setOutput(\"left\", false )",
- RSmenu1 = "term.setBackgroundColor( colours.black )\
- term.setCursorPos( 1, 1 )\
- term.clear()\
- \
- shell.run(\"OSsig\")\
- print()\
- \
- term.setTextColor( colours.blue )\
- \
- -- 32 spaces --\
- \
- print(\" +----------------------------------+\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" +----------------------------------+\")\
- print()\
- \
- term.setTextColor( colours.red )\
- \
- term.setCursorPos( 4, 5 )\
- print(\"Output top ................. top\")\
- print()\
- \
- term.setCursorPos( 4, 7 )\
- print(\"Output Right ............. right\")\
- print()\
- \
- term.setCursorPos( 4, 9 )\
- print(\"Output Bottom ........... bottom\")\
- print()\
- \
- term.setCursorPos( 4, 11 )\
- print(\"Output Left ............... left\")\
- print()\
- \
- term.setCursorPos( 4, 13 )\
- print(\"Output Back ............... back\")\
- term.setCursorPos( 5, 17 )\
- shell.run(\"OOselect\")",
- pass3 = "--------[ ACCOUNT 1 SETUP ]--------\
- \
- function pass3()\
- \
- if fs.exists(\"/.password3\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"Password: \")\
- term.setTextColor( colours.lime )\
- acc1A = read(\"*\")\
- \
- file = fs.open(\"/.password3\",\"r\")\
- acc1 = file.readAll()\
- file.close()\
- \
- if acc1A == acc1 then\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"Access Denied!\")\
- sleep(2)\
- shell.run(\"pass3\")\
- \
- end\
- \
- elseif not fs.exists(\"/.password3\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"New Password: \")\
- term.setTextColor( colours.black )\
- newUser1 = read(\"*\")\
- \
- file = fs.open(\"/.password3\",\"w\")\
- file.write(newUser1)\
- file.close()\
- \
- term.setTextColor( colours.red )\
- print(\"New Password is set.\")\
- sleep(2)\
- \
- pass3()\
- \
- end\
- end\
- \
- pass3()\
- \
- if not fs.exists(\"/.iopen\") then\
- \
- shell.run(\"openSetting\")\
- \
- end\
- \
- if fs.exists(\"/.iopen\") then\
- \
- shell.run(\"RSmenu\")\
- \
- end",
- outputBack = "rs.setOutput(\"back\", true )\
- sleep(3)\
- rs.setOutput(\"back\", false )",
- pass5 = "--------[ ACCOUNT 1 SETUP ]--------\
- \
- function pass5()\
- \
- if fs.exists(\"/.password5\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"Password: \")\
- term.setTextColor( colours.lime )\
- acc1A = read(\"*\")\
- \
- file = fs.open(\"/.password5\",\"r\")\
- acc1 = file.readAll()\
- file.close()\
- \
- if acc1A == acc1 then\
- \
- term.setTextColor( colours.red )\
- print(\"Ready to change!\")\
- sleep(2)\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"Access Denied!\")\
- sleep(2)\
- shell.run(\"pass5\")\
- \
- end\
- \
- elseif not fs.exists(\"/.password5\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"New Password: \")\
- term.setTextColor( colours.black )\
- newUser1 = read(\"*\")\
- \
- file = fs.open(\"/.password5\",\"w\")\
- file.write(newUser1)\
- file.close()\
- \
- term.setTextColor( colours.red )\
- print(\"New Password is set.\")\
- sleep(2)\
- \
- pass5()\
- \
- end\
- end\
- \
- pass5()\
- shell.run(\"change\")",
- beforePass = "os.pullEvent = os.pullEventRaw\
- \
- in1 = \"1\"\
- in2 = \"2\"\
- \
- term.setTextColor( colours.red )\
- print()\
- \
- write(\"Select Account ( 1/2 ): \")\
- input = read()\
- \
- if input == in1 then\
- \
- shell.run(\"acc1\")\
- \
- elseif input == in2 then\
- \
- shell.run(\"acc2\")\
- \
- else\
- \
- print(\"Account does not exist!\")\
- sleep(2)\
- shell.run(\"beforePass\")\
- \
- end",
- outputTop = "rs.setOutput(\"top\", true )\
- sleep(3)\
- rs.setOutput(\"top\", false )",
- pass4 = "--------[ ACCOUNT 1 SETUP ]--------\
- \
- function pass4()\
- \
- if fs.exists(\"/.password4\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"Password: \")\
- term.setTextColor( colours.lime )\
- acc1A = read(\"*\")\
- \
- file = fs.open(\"/.password4\",\"r\")\
- acc1 = file.readAll()\
- file.close()\
- \
- if acc1A == acc1 then\
- \
- term.setTextColor( colours.red )\
- print(\"Lights On!\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"Access Denied!\")\
- sleep(2)\
- shell.run(\"pass4\")\
- \
- end\
- \
- elseif not fs.exists(\"/.password4\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"New Password: \")\
- term.setTextColor( colours.black )\
- newUser1 = read(\"*\")\
- \
- file = fs.open(\"/.password4\",\"w\")\
- file.write(newUser1)\
- file.close()\
- \
- term.setTextColor( colours.red )\
- print(\"New Password is set.\")\
- sleep(2)\
- \
- pass4()\
- \
- end\
- end\
- \
- pass4()\
- shell.run(\"RSmenu1\")",
- uninstall = "os.pullEvent = os.pullEventRaw\
- \
- term.setTextColor( colours.lime )\
- term.setCursorPos( 5, 15 )\
- \
- in1 = \"yes\"\
- in2 = \"no\"\
- \
- print(\"Are you sure you want\")\
- print(\" to uninstall your OS?\")\
- print()\
- \
- term.setTextColor( colours.blue )\
- write(\"yes/no: \")\
- term.setTextColor( colours.lime )\
- input = read()\
- \
- if input == in1 then\
- \
- if fs.exists(\"/.account1\") then\
- fs.delete(\"/.account1\")\
- end\
- \
- if fs.exists(\"/.account2\") then\
- fs.delete(\"/.account2\")\
- end\
- \
- if fs.exists(\"/.password2\") then\
- fs.delete(\"/.password2\") \
- end\
- \
- if fs.exists(\"/.password3\") then\
- fs.delete(\"/.password3\")\
- end\
- \
- if fs.exists(\"/.password5\") then\
- fs.delete(\"/.password5\")\
- end\
- \
- if fs.exists(\"/.yes1\") then\
- fs.delete(\"/.yes1\")\
- end\
- \
- \
- if fs.exists(\"/.yes2\") then\
- fs.delete(\"/.yes2\")\
- end\
- \
- if fs.exists(\"/.yes3\") then\
- fs.delete(\"/.yes3\")\
- end\
- \
- if fs.exists(\"/.no1\") then\
- fs.delete(\"/.no1\")\
- end\
- \
- if fs.exists(\"/.no2\") then\
- fs.delete(\"/.no2\")\
- end\
- \
- if fs.exists(\"/.no3\") then\
- fs.delete(\"/.no3\")\
- end\
- \
- if fs.exists(\"/.password1\") then\
- fs.delete(\"/.password1\")\
- end\
- \
- if fs.exists(\"/.password4\") then\
- fs.delete(\"/.password4\")\
- end\
- \
- if fs.exists(\"/.iopen\") then\
- fs.delete(\"/.iopen\")\
- end\
- \
- if fs.exists(\"/.openA1\") then\
- fs.delete(\"/.openA1\")\
- end\
- \
- if fs.exists(\"/.openA2\") then\
- fs.delete(\"/.openA2\")\
- end\
- \
- if fs.exists(\"/.openA3\") then\
- fs.delete(\"/.openA3\")\
- end\
- \
- if fs.exists(\"/.openA4\") then\
- fs.delete(\"/.openA4\")\
- end\
- \
- if fs.exists(\"/.openA5\") then\
- fs.delete(\"/.openA5\")\
- end\
- \
- if fs.exists(\"/.onA1\") then\
- fs.delete(\"/.onA1\")\
- end\
- \
- if fs.exists(\"/.onA2\") then\
- fs.delete(\"/.onA2\")\
- end\
- \
- if fs.exists(\"/.onA3\") then\
- fs.delete(\"/.onA3\")\
- end\
- \
- if fs.exists(\"/.onA4\") then\
- fs.delete(\"/.onA4\")\
- end\
- \
- if fs.exists(\"/.onA5\") then\
- fs.delete(\"/.onA5\")\
- end\
- \
- if fs.exists(\"uninstall\") then\
- fs.delete(\"uninstall\")\
- end\
- \
- if fs.exists(\"/.ion\") then\
- fs.delete(\"/.ion\")\
- end\
- \
- fs.delete(\"startup\")\
- fs.delete(\"startScreen\")\
- fs.delete(\"acc1\")\
- fs.delete(\"acc2\")\
- fs.delete(\"pass1\")\
- fs.delete(\"pass2\")\
- fs.delete(\"pass3\")\
- fs.delete(\"pass4\")\
- fs.delete(\"pass5\")\
- fs.delete(\"beforePass\")\
- fs.delete(\"afterPass\")\
- fs.delete(\"changeSetup\")\
- fs.delete(\"openSetup\")\
- fs.delete(\"onSetup\")\
- fs.delete(\"change\")\
- fs.delete(\"OSsig\")\
- fs.delete(\"OSterm\")\
- fs.delete(\"ROselect\")\
- fs.delete(\"RSmenu\")\
- fs.delete(\"openSetting\")\
- fs.delete(\"outputTop\")\
- fs.delete(\"outputRight\")\
- fs.delete(\"outputBottom\")\
- fs.delete(\"outputLeft\")\
- fs.delete(\"outputBack\")\
- fs.delete(\"onSetting\")\
- fs.delete(\"RSmenu1\")\
- fs.delete(\"OOselect\")\
- fs.delete(\"SOtop\")\
- fs.delete(\"SOright\")\
- fs.delete(\"SObottom\")\
- fs.delete(\"SOleft\")\
- fs.delete(\"SOback\")\
- os.shutdown()\
- \
- elseif input == in2 then\
- \
- shell.run(\"afterPass\")\
- shell.run(\"OSterm\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"that is not an option\")\
- sleep(2)\
- shell.run(\"afterPass\")\
- shell.run(\"OSterm\")\
- shell.run(\"uninstall\")\
- \
- end\
- ",
- startup = "os.pullEvent = os.pullEventRaw\
- \
- if fs.exists(\"startup\") then\
- \
- function S() \
- \
- term.clear()\
- term.setCursorPos( 1, 1 )\
- term.setTextColor( colours.lime )\
- print(\"There is already an OS!\")\
- print()\
- term.setTextColor( colours.blue )\
- print(\"Delete old OS to install\")\
- print(\"Kersey Operating System\")\
- sleep(1)\
- S()\
- \
- end\
- \
- S()\
- \
- else\
- \
- function h1() \
- \
- term.setBackgroundColor( colours.blue )\
- term.setTextColor( colours.lime )\
- term.setCursorPos( 1, 1 )\
- term.clear()\
- \
- print(\"Installing KerseyOS\")\
- term.setTextColor( colours.black )\
- print()\
- print(\"accessing KerseyOS files,\")\
- print(\"please wait...\")\
- print()\
- term.setTextColor( colours.black )\
- \
- end\
- \
- function h2()\
- \
- term.setTextColor( colours.white )\
- \
- end\
- \
- print()\
- sleep(1)\
- h1()\
- sleep(1)\
- \
- print(\"accounts\")\
- h2()\
- print(\" 0 %\")\
- print(\"--------------------\")\
- sleep(1)\
- h1()\
- \
- print(\"passwords\")\
- h2()\
- print(\" 1 %\")\
- print(\"--------------------\")\
- sleep(1)\
- h1()\
- \
- print(\"startup\")\
- h2()\
- print(\" 2 %\")\
- print(\"--------------------\")\
- print()\
- sleep(1)\
- h1()\
- \
- print(\"redstone\")\
- h2()\
- print(\" 32 %\")\
- print(\"++++++--------------\")\
- sleep(1)\
- h1()\
- \
- print(\"routine sys\")\
- h2()\
- print(\" 78 %\")\
- print(\"+++++++++++++++-----\")\
- sleep(1)\
- h1()\
- \
- print(\"uninstall\")\
- h2()\
- print(\" 81 %\")\
- print(\"++++++++++++++++----\")\
- sleep(1)\
- h1()\
- \
- print(\"uninstall\")\
- h2()\
- print(\" 100 %\")\
- print(\"====================\")\
- sleep(1)\
- print()\
- \
- term.setTextColor( colours.lime )\
- \
- fs.copy(\"disk/1\", \"startup\")\
- fs.copy(\"disk/acc1\", \"acc1\")\
- fs.copy(\"disk/acc2\", \"acc2\")\
- fs.copy(\"disk/pass1\", \"pass1\")\
- fs.copy(\"disk/pass2\", \"pass2\")\
- fs.copy(\"disk/OSsig\", \"OSsig\")\
- fs.copy(\"disk/OSterm\", \"OSterm\")\
- fs.copy(\"disk/beforePass\", \"beforePass\")\
- fs.copy(\"disk/afterPass\", \"afterPass\")\
- fs.copy(\"disk/changeSetup\", \"changeSetup\")\
- fs.copy(\"disk/openSetup\", \"openSetup\")\
- fs.copy(\"disk/change\", \"change\")\
- fs.copy(\"disk/uninstall\", \"uninstall\")\
- fs.copy(\"disk/pass3\", \"pass3\")\
- fs.copy(\"disk/pass4\", \"pass4\")\
- fs.copy(\"disk/pass5\", \"pass5\")\
- fs.copy(\"disk/startScreen\", \"startScreen\")\
- fs.copy(\"disk/outputTop\", \"outputTop\")\
- fs.copy(\"disk/outputRight\", \"outputRight\")\
- fs.copy(\"disk/outputBottom\", \"outputBottom\")\
- fs.copy(\"disk/outputLeft\", \"outputLeft\")\
- fs.copy(\"disk/outputBack\", \"outputBack\")\
- fs.copy(\"disk/RSmenu\", \"RSmenu\")\
- fs.copy(\"disk/ROselect\", \"ROselect\")\
- fs.copy(\"disk/openSetting\", \"openSetting\")\
- fs.copy(\"disk/onSetup\", \"onSetup\")\
- fs.copy(\"disk/OOselect\", \"OOselect\")\
- fs.copy(\"disk/onSetting\", \"onSetting\")\
- fs.copy(\"disk/RSmenu1\", \"RSmenu1\")\
- fs.copy(\"disk/SOtop\", \"SOtop\")\
- fs.copy(\"disk/SOright\", \"SOright\")\
- fs.copy(\"disk/SObottom\", \"SObottom\")\
- fs.copy(\"disk/SOleft\", \"SOleft\")\
- fs.copy(\"disk/SOback\", \"SOback\")\
- \
- print(\"Kersey Operating System installed!\")\
- sleep(2)\
- shell.run(\"startup\")\
- \
- end",
- change = "os.pullEvent = os.pullEventRaw\
- \
- term.setTextColor( colours.red )\
- \
- if fs.exists(\"/.account1\") then\
- fs.delete(\"/.account1\")\
- end\
- \
- print(\"account1 deleted\")\
- \
- if fs.exists(\"/.password1\") then\
- fs.delete(\"/.password1\")\
- end\
- \
- print(\"password1 deleted\")\
- \
- if fs.exists(\"/.account2\") then\
- fs.delete(\"/.account2\")\
- end\
- \
- print(\"account2 deleted\") \
- \
- if fs.exists(\"/.password2\") then\
- fs.delete(\"/.password2\")\
- end\
- \
- print(\"password2 deleted\")\
- \
- term.setTextColor( colours.red )\
- print(\"Ready to change\")\
- \
- shell.run(\"afterPass\")\
- shell.run(\"OSterm\")",
- SOback = "if rs.getOutput(\"back\") then\
- \
- rs.setOutput( \"back\", false )\
- \
- else\
- \
- rs.setOutput( \"back\", true )\
- \
- end",
- pass2 = "--------[ ACCOUNT 1 SETUP ]--------\
- \
- function pass2()\
- \
- if fs.exists(\"/.password2\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"Password: \")\
- file = fs.open(\"/.password2\",\"r\")\
- acc1 = file.readAll()\
- file.close()\
- \
- term.setTextColor( colors.black )\
- \
- acc1A = read(\"*\")\
- \
- if acc1A == acc1 then\
- \
- term.setTextColor( colours.lime )\
- print(\"Door Open!\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"Access Denied!\")\
- sleep(2)\
- os.shutdown()\
- \
- end\
- \
- elseif not fs.exists(\"/.password2\") then\
- \
- term.setTextColor( colours.blue )\
- \
- print()\
- write(\"New Password: \")\
- \
- term.setTextColor( colours.black )\
- \
- newUser1 = read(\"*\")\
- \
- term.setTextColor( colours.black )\
- \
- file = fs.open(\"/.password2\",\"w\")\
- file.write(newUser1)\
- file.close()\
- term.setTextColor( colours.red )\
- print(\"New Password is set.\")\
- sleep(2)\
- pass2()\
- \
- end\
- end\
- \
- pass2()\
- shell.run(\"afterPass\")\
- shell.run(\"OSterm\")",
- SOleft = "if rs.getOutput(\"left\") then\
- \
- rs.setOutput( \"left\", false )\
- \
- else\
- \
- rs.setOutput( \"left\", true )\
- \
- end",
- SOright = "if rs.getOutput(\"right\") then\
- \
- rs.setOutput( \"right\", false )\
- \
- else\
- \
- rs.setOutput( \"right\", true )\
- \
- end",
- OOselect = "os.pullEvent = os.pullEventRaw\
- \
- if fs.exists(\"/.ion\") then\
- \
- fs.delete(\"/.ion\")\
- \
- in1 = \"top\"\
- in2 = \"right\"\
- in3 = \"bottom\"\
- in4 = \"left\"\
- in5 = \"back\"\
- \
- term.setTextColor( colours.lime )\
- write(\"\")\
- \
- term.setTextColor( colours.lime )\
- input = read()\
- \
- if input == in1 then\
- \
- shell.run(\"SOtop\")\
- file = fs.open(\"/.onA1\", \"w\")\
- file.write(input)\
- file.close()\
- \
- elseif input == in2 then\
- \
- shell.run(\"SOright\")\
- file = fs.open(\"/.onA2\", \"w\")\
- file.write(input)\
- file.close()\
- \
- elseif input == in3 then\
- \
- shell.run(\"SObottom\")\
- file = fs.open(\"/.onA3\", \"w\")\
- file.write(input)\
- file.close()\
- \
- elseif input == in4 then\
- \
- shell.run(\"SOleft\")\
- file = fs.open(\"/.onA4\", \"w\")\
- file.write(input)\
- file.close()\
- \
- elseif input == in5 then\
- \
- shell.run(\"SOback\")\
- file = fs.open(\"/.onA5\", \"w\")\
- file.write(input)\
- file.close()\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"That is not an option!\")\
- sleep(2)\
- term.clear()\
- shell.run(\"RSmenu1\")\
- term.setCursorPos( 5, 17 )\
- \
- shell.run(\"OOselect\")\
- \
- end\
- \
- else\
- \
- shell.run(\"afterPass\")\
- shell.run(\"onSetting\")\
- \
- end\
- \
- shell.run(\"afterPass\")\
- term.setCursorPos( 5, 15 )\
- shell.run(\"OSterm\") ",
- openSetup = "os.pullEvent = os.pullEventRaw\
- \
- if fs.exists(\"/.yes1\") then\
- \
- shell.run(\"pass3\")\
- \
- elseif fs.exists(\"/.no1\") then\
- \
- shell.run(\"openSetting\")\
- \
- else\
- \
- term.clear()\
- shell.run(\"afterPass\")\
- term.setCursorPos( 5, 15 )\
- term.setTextColor( colours.lime )\
- \
- print(\"Would you like to\")\
- print(\" password this file?\")\
- print()\
- \
- yes = \"yes\"\
- no = \"no\"\
- \
- term.setTextColor( colours.blue )\
- write(\"yes/no: \")\
- \
- term.setTextColor( colours.lime )\
- input = read()\
- \
- if input == yes then\
- \
- file = fs.open( \"/.yes1\", \"w\" )\
- file.write(input)\
- file.close()\
- \
- shell.run(\"pass3\")\
- \
- elseif input == no then\
- \
- file = fs.open( \"/.no1\", \"w\" )\
- file.write(input)\
- file.close()\
- \
- shell.run(\"RSmenu\")\
- term.setCursorPos( 5, 17 )\
- shell.run(\"ROselect\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"That is not an option!\")\
- sleep(2)\
- \
- shell.run(\"openSetup\")\
- \
- end\
- end",
- OSsig = "term.setTextColor( colours.lime )\
- print(\"KerseyOS v5.0\")",
- OSterm = "os.pullEvent = os.pullEventRaw\
- \
- in1 = \"open\"\
- in2 = \"lights\"\
- in4 = \"change\"\
- in5 = \"uninstall\"\
- \
- term.setTextColor( colours.lime )\
- write(\"\")\
- \
- term.setTextColor( colours.lime )\
- input = read()\
- \
- if input == in1 then\
- \
- shell.run(\"openSetup\")\
- \
- elseif input == in2 then\
- \
- shell.run(\"onSetup\")\
- \
- elseif input == in4 then\
- \
- shell.run(\"changeSetup\")\
- \
- elseif input == in5 then\
- \
- shell.run(\"uninstall\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"Program does not exist!\")\
- sleep(2)\
- term.clear()\
- shell.run(\"afterPass\")\
- term.setCursorPos( 5, 15 )\
- \
- shell.run(\"OSterm\")\
- \
- end",
- pass1 = "--------[ ACCOUNT 1 SETUP ]--------\
- \
- function pass1()\
- \
- if fs.exists(\"/.password1\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"Password: \")\
- file = fs.open(\"/.password1\",\"r\")\
- acc1 = file.readAll()\
- file.close()\
- \
- term.setTextColor( colors.black )\
- \
- acc1A = read(\"*\")\
- \
- if acc1A == acc1 then\
- \
- term.setTextColor( colours.lime )\
- print(\"Granted Succsess\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"Access Denied!\")\
- sleep(2)\
- os.shutdown()\
- \
- end\
- \
- elseif not fs.exists(\"/.password1\") then\
- \
- term.setTextColor( colours.blue )\
- \
- write(\"New Password: \")\
- \
- term.setTextColor( colours.black )\
- \
- newUser1 = read(\"*\")\
- \
- term.setTextColor( colours.black )\
- \
- file = fs.open(\"/.password1\",\"w\")\
- file.write(newUser1)\
- file.close()\
- term.setTextColor( colours.red )\
- print(\"New Password is set.\")\
- sleep(2)\
- \
- pass1()\
- \
- end\
- end\
- \
- pass1()\
- shell.run(\"afterPass\")\
- shell.run(\"OSterm\")",
- off = "term.setTextColor( colours.red )\
- print(\"Lights Off!\")\
- rs.setOutput( \"back\", false )\
- sleep(2)\
- \
- shell.run(\"afterPass\")\
- shell.run(\"OSterm\")",
- outputRight = "rs.setOutput(\"right\", true )\
- sleep(3)\
- rs.setOutput(\"right\", false )",
- ROselect = "os.pullEvent = os.pullEventRaw\
- \
- if fs.exists(\"/.iopen\") then\
- \
- fs.delete(\"/.iopen\")\
- \
- in1 = \"top\"\
- in2 = \"right\"\
- in3 = \"bottom\"\
- in4 = \"left\"\
- in5 = \"back\"\
- \
- term.setTextColor( colours.lime )\
- write(\"\")\
- \
- term.setTextColor( colours.lime )\
- input = read()\
- \
- if input == in1 then\
- \
- shell.run(\"outputTop\")\
- file = fs.open(\"/.openA1\", \"w\")\
- file.write(input)\
- file.close()\
- \
- elseif input == in2 then\
- \
- shell.run(\"outputRight\")\
- file = fs.open(\"/.openA2\", \"w\")\
- file.write(input)\
- file.close()\
- \
- elseif input == in3 then\
- \
- shell.run(\"outputBottom\")\
- file = fs.open(\"/.openA3\", \"w\")\
- file.write(input)\
- file.close()\
- \
- elseif input == in4 then\
- \
- shell.run(\"outputLeft\")\
- file = fs.open(\"/.openA4\", \"w\")\
- file.write(input)\
- file.close()\
- \
- elseif input == in5 then\
- \
- shell.run(\"outputBack\")\
- file = fs.open(\"/.openA5\", \"w\")\
- file.write(input)\
- file.close()\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"That is not an option!\")\
- sleep(2)\
- term.clear()\
- shell.run(\"RSmenu\")\
- term.setCursorPos( 5, 17 )\
- \
- shell.run(\"ROselect\")\
- \
- end\
- \
- else\
- \
- shell.run(\"openSetting\")\
- \
- end\
- \
- shell.run(\"afterPass\")\
- term.setCursorPos( 5, 15 )\
- shell.run(\"OSterm\") ",
- changeSetup = "os.pullEvent = os.pullEventRaw\
- \
- if fs.exists(\"/.yes3\") then\
- \
- shell.run(\"pass5\")\
- \
- elseif fs.exists(\"/.no3\") then\
- \
- term.setTextColor( colours.red )\
- print(\"Door Open!\")\
- shell.run(\"change\")\
- \
- else\
- \
- term.clear()\
- shell.run(\"afterPass\")\
- term.setCursorPos( 5, 15 )\
- term.setTextColor( colours.lime )\
- \
- print(\"Would you like to\")\
- print(\" password this file?\")\
- print()\
- \
- yes = \"yes\"\
- no = \"no\"\
- \
- term.setTextColor( colours.blue )\
- write(\"yes/no: \")\
- \
- term.setTextColor( colours.lime )\
- input = read()\
- \
- if input == yes then\
- \
- file = fs.open( \"/.yes3\", \"w\" )\
- file.write(input)\
- file.close()\
- \
- shell.run(\"pass5\")\
- \
- elseif input == no then\
- \
- file = fs.open( \"/.no3\", \"w\" )\
- file.write(input)\
- file.close()\
- \
- shell.run(\"change\")\
- \
- else\
- \
- term.setTextColor( colours.red )\
- print(\"That is not an option!\")\
- sleep(2)\
- \
- shell.run(\"changeSetup\")\
- \
- end\
- end",
- RSmenu = "term.setBackgroundColor( colours.black )\
- term.setCursorPos( 1, 1 )\
- term.clear()\
- \
- shell.run(\"OSsig\")\
- print()\
- \
- term.setTextColor( colours.blue )\
- \
- -- 32 spaces --\
- \
- print(\" +----------------------------------+\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" | |\")\
- print(\" +----------------------------------+\")\
- print()\
- \
- term.setTextColor( colours.red )\
- \
- term.setCursorPos( 4, 5 )\
- print(\"Output top ................. top\")\
- print()\
- \
- term.setCursorPos( 4, 7 )\
- print(\"Output Right ............. right\")\
- print()\
- \
- term.setCursorPos( 4, 9 )\
- print(\"Output Bottom ........... bottom\")\
- print()\
- \
- term.setCursorPos( 4, 11 )\
- print(\"Output Left ............... left\")\
- print()\
- \
- term.setCursorPos( 4, 13 )\
- print(\"Output Back ............... back\")\
- term.setCursorPos( 5, 17 )\
- shell.run(\"ROselect\")",
- SObottom = "if rs.getOutput(\"bottom\") then\
- \
- rs.setOutput( \"bottom\", false )\
- \
- else\
- \
- rs.setOutput( \"bottom\", true )\
- \
- end",
- }
- local function writeFile(path,content)
- local file = fs.open(path,"w")
- file.write(content)
- file.close()
- end
- function writeDown(input,dir)
- for i,v in pairs(input) do
- if type(v) == "table" then
- writeDown(v,dir.."/"..i)
- elseif type(v) == "string" then
- writeFile(dir.."/"..i,v)
- end
- end
- end
- args = {...}
- if #args == 0 then
- print("Please input a destination folder.")
- else
- writeDown(inputTable,args[1])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement