Advertisement
MarcoPolo0306

M-Shell

May 7th, 2017
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.69 KB | None | 0 0
  1. term.clear()
  2. term.setTextColor(colors.white)
  3. term.setCursorPos(1,1)
  4. print("M-Shell v1.0")
  5. print("By MarcoPolo0306")
  6. print("Type 'cmds' for all of the commands.")
  7. term.setCursorBlink(true)
  8. write("$> ")
  9. while true do
  10.     input = read()
  11.     if input == "cmds" then
  12.         print("Commands:")
  13.         sleep(0.1)
  14.         print("exit - Exit the shell")
  15.         sleep(0.1)
  16.         print("about - Open the about menu")
  17.         sleep(0.1)
  18.         print("shutdown - Shutdowns the computer")
  19.         sleep(0.1)
  20.         print("reboot - Reboots the computer")
  21.         sleep(0.1)
  22.         print("clear - Clears the screen")
  23.         if fs.exists("m-os") then
  24.             sleep(0.1)
  25.             print("mos - Run M-OS")
  26.         end
  27.     elseif input == "mos" and fs.exists("m-os") then
  28.         shell.run("m-os/boot")
  29.     elseif input == "clear" then
  30.         term.clear()
  31.         term.setCursorPos(1,1)
  32.     elseif input == "exit" then
  33.         term.clear()
  34.         term.setCursorPos(1,1)
  35.         break
  36.     elseif input == "about" then
  37.         print("About M-Shell")
  38.         print("Created by MarcoPolo0306")
  39.         print("(C) MarcoSoft 2016, 2017")
  40.         print("Version 1.0_r1")
  41.         print("Type 'cmds' to show all of the commands.")
  42.         print("Type 'marcosoft' to show everything made my Marcosoft.")
  43.     elseif input == "marcosoft" then
  44.         print("MARCOSOFT")
  45.         textutils.slowPrint("-------------------",10)
  46.         print("OS`s:")
  47.         write("M-OS -")
  48.         if term.isColor() then
  49.             term.setTextColor(colors.green)
  50.             write(" M-Shell")
  51.         else
  52.             write(" M-Shell")
  53.         end
  54.         print(" ")
  55.         term.setTextColor(colors.white)
  56.         print("Programs:")
  57.     elseif input == "shutdown" then
  58.         print("Shutting down...")
  59.         sleep(0.89278217)
  60.         os.shutdown()
  61.     elseif input == "reboot" then
  62.         print("Rebooting...")
  63.         sleep(0.89278217)
  64.         os.reboot()
  65.     else
  66.         shell.run(input)
  67.     end
  68.     write("$> ")
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement