Advertisement
Guest User

Terminal

a guest
Feb 6th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.88 KB | None | 0 0
  1. drawTerminal = function()
  2. term.setBackgroundColor(colors.black)
  3. term.clear()
  4. term.setBackgroundColor(colors.gray)
  5. term.setCursorPos(1,1)
  6. term.clearLine()
  7. term.setCursorPos(1,1)
  8. term.setTextColor(colors.black)
  9. print("OSX-Terminal")
  10. end
  11.  
  12. drawTerminal()
  13.  
  14. word = function()
  15. term.setBackgroundColor(colors.black)
  16. term.setTextColor(colors.blue)
  17. term.write("OSX@user/term")
  18. term.setTextColor(colors.lime)
  19. write(" $ ")
  20. term.setTextColor(colors.white)
  21. end
  22. word()
  23. input = read()
  24. while true do
  25. if input == "exit" then
  26. shell.run("OSX")
  27. elseif input == "back" then
  28. shell.run("OSX")
  29. elseif input == "download" then
  30. print("write the ID")
  31. word()
  32. input1 = read()
  33. print("write the name")
  34. word()
  35. input2 = read()
  36. shell.run("pastebin get "..input1.." "..input2)
  37. word()
  38. input = read()
  39. elseif input == "help" then
  40. print("write 'exit' to exit the terminal")
  41. print("write 'download' to download a file from pastebin")
  42. print("write 'back' to exit the terminal")
  43. print("write 'clear' to clear the Terminal")
  44. print("write 'delete' to delete a custom file")
  45. print("write 'help2' for more info")
  46. word()
  47. input = read()
  48. elseif input == "clear" then
  49. drawTerminal()
  50. word()
  51. input = read()
  52. elseif input == "delete" then
  53. print("write the file u will delete")
  54. word()
  55. input3 = read()
  56. fs.delete(input3)
  57. print("deleted "..input3)
  58. word()
  59. input = read()
  60. elseif input == "run" then
  61. print("what file will u run?")
  62. word()
  63. input4 = read()
  64. print("Running the file")
  65. sleep(2)
  66. shell.run(input4)
  67. shell.run("Terminal")
  68. break
  69. elseif input == "edit" then
  70. print("what file will u edit?")
  71. word()
  72. input5 = read()
  73. shell.run("edit "..input5)
  74. shell.run("Terminal")
  75. elseif input == "help2" then
  76. print("write 'run' to run a custom file")
  77. print("write 'edit' to edit a custom file")
  78. word()
  79. input = read()
  80. elseif input == "ls" then
  81. shell.run("ls")
  82. word()
  83. input = read()
  84. else
  85. word()
  86. input = read()
  87. end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement