Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Written by MudkipTheEpic
- --If you would like to include this in your OS, that's fine, just keep these lines and credit --me.
- local oldPull = os.pullEvent --[Backup of os.pullEvent]
- os.pullEvent = os.pullEventRaw --[Ctrl-T prevention]
- historyTable = {}
- detect = shell.getRunningProgram()
- if detect ~= "fakeconsole" then
- print("File: 'fakeconsole' is not running. Please install with the installation disk.")
- sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- os.pullEvent = oldPull
- os.reboot()
- else
- end
- if fs.isDir("configfc") == false then
- fs.makeDir("configfc")
- end
- if fs.exists("configfc/password") == false then
- a = fs.open("configfc/password", "w")
- a.writeLine("fakeexit")
- a.close()
- else
- end
- b = fs.open("configfc/password", "r")
- local exit = b.readLine()
- b.close()
- term.clear()
- term.setCursorPos(1,1) --[Clears screen]
- term.setTextColor(16)
- print( os.version() )
- term.setTextColor(1) --[Imitates CraftOS]
- while true do --[Loop, prevents {Hold down enter to exit}]
- term.setTextColor(16)
- write("> ") --[Imitates CraftOS]
- term.setTextColor(1)
- readLine = read(nil, historyTable) --[Adds Up/Downarrow function! Thank GravityScore for this!
- table.insert(historyTable, readLine)
- if readLine == exit then
- term.setTextColor(2^math.random(1,14))
- print("Exiting FakeConsole...") --[Exit FakeConsole]
- sleep(2)
- os.pullEvent = oldPull --[Restore os.pullEvent]
- term.clear()
- term.setCursorPos(1,1) --[Clears screen]
- break --[Ends loop]
- elseif readLine ~= ("") then --[If the input isn't blank or the exit code then,]
- term.setTextColor(16384)
- print("No such program") --[Imitates No Program error]
- term.setTextColor(1)
- else
- end --[Keep looping if input is blank]
- end --[End program]
Add Comment
Please, Sign In to add comment