Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Alternative shell from CraftOS shell
- termutils = {}
- termutils.clear = function()
- term.clear()
- term.setCursorPos(1,1)
- end
- termutils.clearColor = function()
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- end
- function checkDisk()
- if not fs.exists("/disk/") then
- print("No disk found. Running no-os...")
- shell.run("no-os")
- return false -- Disk is not found
- end
- return true -- Disk is found
- end
- function input()
- if not checkDisk() then
- return -- Exit input function if no disk is found
- end
- term.setTextColor(colors.yellow)
- local dir = shell.dir().."".."> "
- write(dir)
- termutils.clearColor()
- command = io.read()
- if command and command ~= "" then
- shell.run(command)
- end
- end
- termutils.clear()
- print("Doggy OS has booted without any issues")
- while true do
- input()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement