computercam

CCOS

Jan 9th, 2015
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. --Api Load
  2. os.loadAPI("CCOS/kernal/kernal")
  3. -- Varibles
  4. OSVer = "1.1.2"
  5. running = "1"
  6. SeverLocation = "/CCOS/ROM/LocalServer"
  7. homecol = colours.lightBlue
  8. KernalVer = "1.5"
  9.  
  10.  
  11. --Emulator id: 125
  12.  
  13. --FUNCTIONS
  14. function BG(colour)
  15. term.setBackgroundColour(colour)
  16. end
  17.  
  18. function TColour(tcol)
  19. term.setTextColour(tcol)
  20. end
  21.  
  22. function clear()
  23. shell.run("clear")
  24. end
  25.  
  26. function p(Text)
  27. print(Text)
  28. end
  29.  
  30. function reboot()
  31. BG(colours.red)
  32. term.setCursorPos(50,25)
  33. p("Really restart? (yes/no)")
  34. local rebootquestion = read()
  35. if rebootquestion == "yes" then
  36. clear()
  37. term.setCursorPos(23,05)
  38. TColour(colours.black)
  39. p("Restarting...")
  40. sleep(5)
  41. os.reboot()
  42. end
  43. shell.run("CCOS/System/OS")
  44. end
  45.  
  46. function Shutdown()
  47. BG(colours.red)
  48. term.setCursorPos(50,25)
  49. p("Really shutdown? (yes/no)")
  50. local rebootquestion = read()
  51. if rebootquestion == "yes" then
  52. clear()
  53. term.setCursorPos(23,05)
  54. TColour(colours.black)
  55. p("Powering off...")
  56. sleep(5)
  57. os.shutdown()
  58. end
  59. shell.run("CCOS/System/OS")
  60. end
  61.  
  62. function close()
  63. shell.run("startup")
  64. end
  65.  
  66. function run(app)
  67. shell.run(app)
  68. end
  69.  
  70. function requestReboot()
  71. BG(colours.red)
  72. term.setCursorPos(50,25)
  73. p("An app is trying to reboot allow? (yes/no) (SAVE FIRST!!!)")
  74. local rebootquestion = read()
  75. if rebootquestion == "yes" then
  76. clear()
  77. term.setCursorPos(23,05)
  78. TColour(colours.black)
  79. p("Restarting...")
  80. sleep(5)
  81. os.reboot()
  82. end
  83. shell.run("CCOS/System/OS")
  84. end
  85.  
  86. --Code
  87.  
  88.  
  89. print("Somethings gone wrong... The kernal has not loaded please make sure the kernal is in the CCOS/Kernal/ Folder. then reboot. If it's nots please reinstall the OS!")
  90. BG(homecol)
  91. clear()
  92. TColour(colours.white)
  93. print("CCOS Home Screen")
  94. while running == "1" do
  95. p("1 - Exit to CraftOS (Shell) (ADVANCED)")
  96. p("2 - Restart Computer")
  97. p("3 - Launch a LUA application")
  98. p("4 - Open Lua prompt")
  99. p("5 - About OS")
  100. p("6 - Developer options")
  101. p("7 - Shutdown Computer")
  102. p("8 - Reload OS file")
  103. p("9 - Wipe system cache")
  104. p("10 - Reload kernal")
  105. write("Your option: ")
  106. input = read()
  107. if input == "1" then
  108. running = "0"
  109. BG(colours.black)
  110. TColour(colours.white)
  111. clear()
  112.  
  113. else
  114. if input == "2" then
  115. running = "0"
  116. reboot()
  117. sleep(10)
  118. else
  119. if input == "3" then
  120. running = "0"
  121. clear()
  122. write("Enter the name of the applcation you want to open here: ")
  123. local AppToOpen = read()
  124. shell.run(AppToOpen)
  125. BG(colours.white)
  126. clear()
  127. print("Welcome Back restarting enviroment... please wait...")
  128. sleep(1)
  129. shell.run("OS")
  130. else
  131. if input == "4" then
  132. BG(colours.black)
  133. clear()
  134. TColour(colours.red)
  135. p("Starting Lua command promt to exit please enter close() DO NOT ENTER exit() AS THIS WILL EXIT THE OS")
  136. sleep(5)
  137. clear()
  138. shell.run("lua")
  139. else
  140. if input == "5" then
  141. BG(colours.blue)
  142. TColour(colours.yellow)
  143. term.setCursorPos(50,25)
  144. p("Programmed by: Cameron Fleming")
  145. p("OSVersion: "..OSVer)
  146. p("Kernal Version: "..KernalVer)
  147. p("Press enter to exit")
  148. read()
  149. BG(homecol)
  150. TColour(colours.white)
  151. shell.run(s)
  152. else
  153. if input == "6" then
  154. BG(colours.black)
  155. clear()
  156. run("CCOS/apps/developeroptions")
  157. else
  158. if input == "7" then
  159. Shutdown()
  160.  
  161. else
  162. if input == "8" then
  163. shell.run("CCOS/System/OS")
  164. else
  165. if input == "9" then
  166. shell.run("CCOS/System/CacheMan")
  167. BG(homecol)
  168. TColour(colours.white)
  169. shell.run(s)
  170. end
  171. if input == "10" then
  172. shell.run("kernal")
  173. end
  174. end
  175.  
  176. end
  177. end
  178. end
  179. end
  180. end
  181. end
  182. end
  183. clear()
  184. end
Advertisement
Add Comment
Please, Sign In to add comment