Advertisement
Kosinth

KaiOSLite

Jan 30th, 2019 (edited)
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.73 KB | None | 0 0
  1. #Kai's heart.break OS
  2. var version = "1.1"
  3.  
  4. # *** PROGRAM NOTES ***
  5. #This is the lighter, faster version.
  6. #For immersion purposes, it has fewer
  7. #programs in the directory.
  8. #Default password is still "pingas"
  9. #If you assigned another "OS Password"
  10. #memory, it will still be there.
  11.  
  12. # *** SYSTEM REQUIREMENTS ***
  13.  
  14. #Required APIs:
  15. #EnableAPI("internet")
  16. #EnableAPI("memory")
  17. #SetMhz(30)
  18.  
  19. #Install these codes into a screwdriver and use
  20. #it on the PC you wish to install this OS into.
  21.  
  22. # *** PATCH NOTES***
  23. #Version 1.0: release as a light version
  24. #Version 1.1: Re-release with password function.
  25.  
  26. # *** SECURE STARTUP ***
  27. #Cleans the screen and connections.
  28. #Adds user variable for the secure user check.
  29. var user = GetUser()
  30.  
  31. # *** CHANGEABLE PASSWORD SYSTEM ***
  32. #Checks if a password has been assigned.
  33. #If there is no password, uses the default.
  34. If HasMemory("OS Password") == false
  35.     SaveMemory("OS Password", "pingas")
  36. end
  37. var password()
  38.     LoadMemory("OS Password")
  39. end
  40.  
  41. DisconnectAll()
  42. ClearText()
  43.  
  44. #User Check! This OS quits for anyone but Sebastian.
  45. #System if argument 1. Must be ended last.
  46. #The addition of sound and an extra wait per program
  47. #gives the illusion of a boot up time.
  48. if user == "Sebastian"
  49.     PlaySound("ComputerSound 2")
  50.     Print("Booting...")
  51.     Sleep(1)
  52.     Print("Loading slurp...")
  53.     Sleep(0.92)
  54.     Print("Loading net directory...")
  55.     Sleep(0.3)
  56.     Print("Loading recharge...")
  57.     Sleep(0.51)
  58.     Print("Loading bedtime...")
  59.     Sleep(0.1)
  60.     Print("Loading pass...")
  61.     Sleep(0.63)
  62.     Print("Done!")
  63.     PlaySound("Coin 2")
  64.     Sleep(0.25)
  65.  
  66.  
  67. #Password check if argument, number 2.
  68. #If argument 2 must be ended before argument 1.
  69. #Features a loop for a retry feature.
  70. #Loop must be ended after the if else.
  71. loop
  72.  
  73.     # *** BOOT SECTION ***
  74.     ClearText()
  75.     PlaySound("Coin 2")
  76.     Print("KaiOSLite")
  77.     Print("OS Version: " + version)
  78.     Print("")
  79.     Print("Username: " + user)
  80.     var try = Input("Password: ")
  81. if try == password()
  82.     Print("Log in successful!")
  83.     Print("Type command or dir for a list")
  84.     Print("of all available programs!")
  85.     Print("")
  86.  
  87. # *** OPERATING SYSTEM FUNCTIONS ***
  88. #After a program is run, the system returns to the
  89. #command prompt for another program.
  90. loop
  91.  
  92. #The input provides the illusion of a file system.
  93. string cmd = Input("run C:/")
  94. #Provides a list of programs, to be updated as new
  95. #functionality is added.
  96. if cmd == "dir"
  97.     ClearText()
  98.     Print("Directory:")
  99.     Sleep(0.1)
  100.     Print(" - slurp, teleport")
  101.     Sleep(0.1)
  102.     Print(" - recharge, restore stats")
  103.     Sleep(0.1)
  104.     Print(" - bedtime, become sleepy")
  105.     Sleep(0.1)
  106.     Print(" - pass, change password")
  107.        
  108. else if cmd == "slurp"
  109.     #The slurp command, with clean connection list.
  110.     #This one is for casual slurps.
  111.     ClearText()
  112.     Print("See ya!")
  113.     PlaySound("ComputerSound 3")
  114.     DisconnectAll()
  115.     Connect("DesolateHouseLobby_TriPodComputer_TriPodComputer_1")
  116.     Connect("Lodge_Room1_ModernComputer_1")
  117.     Connect("Cafe_Exterior_CurcuitLocker_3")
  118.     Connect("HarborNorth_CurcuitLocker_1")
  119.     Connect("SICP")
  120.     Sleep(0.5)
  121.     Slurp()
  122.  
  123. else if cmd == "recharge"
  124.     #Command performs the stat restore effect.
  125.     #The light version only applies to
  126.     #fatigue and corruption.
  127.     ClearText()
  128.     var h = Connect("Heart")
  129.     h.SetNumericData(user,"sleepiness",0)
  130.     h.SetNumericData(user,"corruption",0)
  131.     Print("Body recharged and restored!")
  132.     PlaySound("Coin 2")
  133.  
  134. else if cmd == "bedtime"
  135.     #Program literally just makes you sleepy enough
  136.     #to sleep through the night.
  137.     var h = Connect("Heart")
  138.     ClearText()
  139.     h.SetNumericData(user,"sleepiness",90)
  140.     Print("Drowsiness administered!")
  141.  
  142. else if cmd == "pass"
  143.     SaveMemory("OS Password",Input("New password: "))
  144.     PlaySound("Coin 2")
  145.     Print("New password saved: " + LoadMemory("OS Password"))
  146.  
  147.  
  148.  
  149. #========================================
  150. #Program list divider.
  151. #The following calls whenever
  152. #the input does not match
  153. #any given program names.
  154. #========================================
  155.  
  156.  
  157.  
  158. else
  159.     #The default end of the input check.
  160.     #Notes the error and offers help.
  161.     ClearText()
  162.     Print("Invalid command!")
  163.     Sleep(0.1)
  164.     Print("")
  165.     Sleep(0.1)
  166.     Print("Type command or type dir for a list")
  167.     Sleep(0.1)
  168.     Print("of all available programs!")
  169.     Sleep(0.1)
  170.     Print("")
  171.     Sleep(0.1)
  172.  
  173. #End of program list.
  174. end
  175.  
  176. #End of command prompt loop.
  177. end
  178.  
  179. # *** PASSWORD RETRY LOOP ***
  180. #This code will have the process start over.
  181. else
  182.     Print("Wrong password!")
  183.     Sleep(0.75)
  184. #if argument end
  185. end
  186.  
  187. #Operating system loop end
  188. #Putting the OS on a loop lets
  189. #the password prompt start over
  190. #over again in the even of an
  191. #incorrect password.
  192. end
  193.  
  194. # *** SECURITY DENIAL CODE ***
  195. #This code will loop on an else.
  196. else
  197.     ClearText()
  198.     Print("You are not an authorized user of")
  199.     Print("this system! Lockout, sucker!")
  200.     Sleep(3)
  201. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement