Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- HouseShell
- -- As a part of HouseOS
- -- Made by houseofkraft
- -- Dependices
- fs = require("filesystem")
- os = require("os")
- shell = require("shell")
- event = require("event")
- term = require("term")
- shell = require("shell")
- gpu = term.gpu()
- local motd = {
- "We hope you enjoy HouseOS!",
- "Have fun!",
- "Did you know, this is a customized Shell!",
- "Muhahahaahahah",
- "If you find any bugs, please tell House (houseofkraft)"
- }
- -- Init
- --term.clear()
- --print("----- " .._OSVERSION.. " -----")
- --print(motd[math.random(1, #motd)])
- function startProgramR()
- shell.execute(cmd)
- end
- function startProgram()
- local ok, err = pcall(startProgram)
- if err then
- print("[ERROR]: "..err)
- end
- end
- function loop()
- gpu.setForeground(0xcc0202)
- if shell.getWorkingDirectory() == "/" then
- -- Do nothing
- else
- io.write(shell.getWorkingDirectory())
- end
- gpu.setForeground(0xd7ea07)
- io.write("/")
- gpu.setForeground(0x03ba55)
- io.write("# ")
- gpu.setForeground(0xffffff)
- cmd = io.read()
- if fs.exists(cmd) == false then
- if fs.exists("/bin/"..cmd..".lua") then
- startProgram("/bin/" ..cmd.. ".lua")
- elseif fs.exists("/lib/"..cmd..".lua") then
- startProgram("/lib/"..cmd.. ".lua")
- else
- print("The program does not exist!")
- end
- else
- startProgram(cmd)
- end
- loop()
- end
- term.clear()
- --term.setCursorPos(1,1)
- print("------ ".._OSVERSION.." ------")
- print(motd[math.random(1, #motd)])
- loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement