Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Welcome to HackOS.")
- while true do
- print("Please input a command.")
- input = read()
- if input:lower() == "help" then
- print("Hello. I am HackOS. I am a system that is")
- print("designed to help you out in this world.")
- print("I am NOT a replica of HAL9000, I am not")
- print("sentient and won't try to kill you. In fact,")
- print("I try to help you out with tips you ignore.")
- print("So, press any key to clear and move on.")
- print("Also: Type cmds to see the full list.")
- os.pullEvent("char")
- end
- if input:lower() == "cmds" then
- print("Commands are:")
- print("cmds -- Shows this list")
- print("help -- Shows the system helplist")
- print("exit -- Shuts down the system")
- os.pullEvent("char")
- end
- if input:lower() == "exit" then
- shell.run("shutdown")
- end
- if input:lower() == "edit" then
- print("Input passkey:")
- P = read("*")
- if P == "No" then
- print("Access granted.")
- sleep(2)
- shell.run("edit HackOS")
- else
- print("Access denied.")
- sleep(2)
- end
- end
- if input:lower() == "tips" then
- print("Checking database...")
- if fs.exists("disk/") then
- print("Downloading tip...")
- D = fs.open("disk/tip","r")
- Tr = D:readAll()
- D.close()
- T = fs.open("tips","w")
- T:write(Tr)
- T.close()
- W = true
- end
- if fs.exists("tips") then
- if W == true then
- print("Reading new tip...")
- else
- print("No new tips at this time. Reading old tip...")
- end
- E = fs.open("tips","r")
- print(E:readAll())
- E.close()
- else
- print("There are no tips at this time.")
- end
- os.pullEvent("char")
- end
- term.clear()
- term.setCursorPos(1,1)
- end
Add Comment
Please, Sign In to add comment