computercam

CCOSForPG

Mar 12th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 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("5 - About OS")
  99. p("7 - Shutdown Computer")
  100. p("8 - Open Chat")
  101. write("Your option: ")
  102. input = read()
  103. if input == "1" then
  104. running = "0"
  105. BG(colours.black)
  106. TColour(colours.white)
  107. clear()
  108.  
  109. else
  110. if input == "2" then
  111. running = "0"
  112. reboot()
  113. sleep(10)
  114. else
  115. if input == "3" then
  116. running = "0"
  117. clear()
  118. write("Enter the name of the applcation you want to open here: ")
  119. local AppToOpen = read()
  120. shell.run(AppToOpen)
  121. BG(colours.white)
  122. clear()
  123. print("Welcome Back restarting enviroment... please wait...")
  124. sleep(1)
  125. shell.run("OS")
  126. else
  127. if input == "5" then
  128. BG(colours.blue)
  129. TColour(colours.yellow)
  130. term.setCursorPos(50,25)
  131. p("Programmed by: Cameron Fleming")
  132. p("OSVersion: "..OSVer)
  133. p("Kernal Version: "..KernalVer)
  134. p("Press enter to exit")
  135. read()
  136. BG(homecol)
  137. TColour(colours.white)
  138. shell.run(s)
  139. else
  140. if input == "6" then
  141. BG(colours.black)
  142. clear()
  143. run("CCOS/apps/developeroptions")
  144. else
  145. if input == "7" then
  146. Shutdown()
  147.  
  148. else
  149. if input == "8" then
  150. shell.run("CCOS/apps/client")
  151. else
  152. end
  153.  
  154. end
  155. end
  156. end
  157. end
  158. end
  159. end
  160. end
  161. clear()
  162. end
Advertisement
Add Comment
Please, Sign In to add comment