Advertisement
TechnicCoder

setup/console

Jun 1st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. shell.run("hidden/api/all")
  2. if fs.exists("/hidden/CompletedSetups/.setupFinished") then
  3. cls()
  4. shell.run("hidden/main/boot")
  5. else
  6. write("Setup > ")
  7. cmd=read()
  8. m = " : "
  9. s = " "
  10.  
  11. function cls()
  12. shell.run("clear")
  13. term.setTextColor( colors.blue )
  14. print("Hidden OS")
  15. term.setTextColor( colors.white )
  16. end
  17.  
  18. if string.find(cmd, "Hidden>") then
  19. cmd = cmd:gsub("Hidden>", "")
  20.  
  21. if string.find(cmd, "Admin>") then
  22. cmd = cmd:gsub("Admin>", "")
  23.  
  24. if cmd=="help" then
  25. print("HiddenOS (Hidden > Admin > )")
  26. print("-------------------------")
  27. print("help", m, "Shows a list of all commands.")
  28. print("version", m, "Show a little version list.")
  29. print("CreateUser", m, "Creating a user.")
  30. elseif cmd=="version" then
  31. print("")
  32. term.setTextColor( colors.green )
  33. print("Hidden OS")
  34. term.setTextColor( colors.purple )
  35. print("-------------------------------------")
  36. term.setTextColor( colors.pink )
  37. print("Version: 1.0.0")
  38. print("Terminal Interface: 1.4.6")
  39. print("CodeSnipper: 1.0.0")
  40. term.setTextColor( colors.purple )
  41. print("-------------------------------------")
  42. term.setTextColor( colors.white )
  43. print("")
  44. elseif cmd=="CreateUser" then
  45. shell.run("hidden/api/CreateUser")
  46. elseif cmd=="setup.finish()" then
  47. if fs.exists("/hidden/CompletedSetups/.firstUserSetupDone") then
  48. local setupDone = fs.open("/hidden/CompletedSetups/.setupFinished", "w")
  49. setupDone.writeLine("state=true")
  50. setupDone.close()
  51. shell.run("hidden/main/boot")
  52. else
  53. print("You haven't completed first user setup, write \"Instructions\" for more help.")
  54. end
  55.  
  56. else
  57. term.setTextColor( colors.red )
  58. print("Hidden > Admin > \"", cmd, "\" is not a command")
  59. term.setTextColor( colors.white )
  60. end
  61. elseif cmd=="help" then
  62. term.setTextColor( colors.red )
  63. print("Sorry, there is no help menu in SETUP for \"Hidden>\"")
  64. term.setTextColor( colors.white )
  65. else
  66. term.setTextColor( colors.red )
  67. print("Hidden > \"", cmd, "\" is not a command")
  68. term.setTextColor( colors.white )
  69. end
  70. elseif cmd=="help" then
  71. print("")
  72. print("Help menu")
  73. print("------------------------")
  74. print("help", m, "Brings up a list with basic commands.")
  75. term.setTextColor( colors.yellow ) print("---") term.setTextColor( colors.white )
  76. print("cls", m, "It do the same thing as \"clear\" but faster to \n type.")
  77. term.setTextColor( colors.yellow ) print("---") term.setTextColor( colors.white )
  78. print("instructions", m, "This shows you how you create a user\n and how you finish the setup!")
  79. print("Categorizations")
  80. term.setTextColor( colors.lime )
  81. print("----------------------------")
  82. term.setTextColor( colors.white )
  83. print(s, "Hidden>")
  84. print(s, s, "Admin>")
  85. print(s, s, s, "help")
  86. print(s, s, s, "version")
  87. print(s, s, s, "CreateAdmin")
  88. print("")
  89. elseif cmd=="cls" then
  90. cls()
  91. elseif cmd=="instructions" then
  92. cls()
  93. term.setTextColor( colors.lime )
  94. print("Hidden OS Instructions")
  95. term.setTextColor( colors.red )
  96. print("---------------------------------------------------")
  97. term.setTextColor( colors.orange )
  98. print("Creating a user")
  99. term.setTextColor( colors.purple )
  100. print("-----------------------------")
  101. term.setTextColor( colors.white )
  102. print("To create a user you will need to write: \"Hidden>Admin>CreateUser\" in order to create an Owner account!")
  103. print("")
  104. term.setTextColor( colors.orange )
  105. print("Finish setup")
  106. term.setTextColor( colors.purple )
  107. print("-----------------------------")
  108. term.setTextColor( colors.white )
  109. print("After that you will need to finish the setup by typing: \"Hidden>Admin>setup.finish()\" to end the setup mode.")
  110. else
  111. term.setTextColor( colors.red )
  112. print("\"", cmd, "\" is not a command")
  113. term.setTextColor( colors.white )
  114. end
  115. shell.run("hidden/setup/console")
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement