Guest User

Untitled

a guest
Mar 9th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. CLEARSCREEN.
  2. SAS OFF.
  3. RUN ONCE mainlib.ks.
  4.  
  5. DECLARE topTank TO ship:partsdubbed("topTank")[0].
  6. DECLARE middleTank TO ship:partsdubbed("middleTank")[0].
  7. DECLARE bottomTank TO ship:partsdubbed("bottomTank")[0].
  8. DECLARE launchTank TO ship:partsdubbed("launchTank")[0].
  9.  
  10. DECLARE Fairing TO ship:partsdubbed("launchfairing")[0]:getmodule("moduleproceduralfairing").
  11. DECLARE FinDecoupler TO ship:partsdubbed("findecoupler").
  12. DECLARE END TO FALSE.
  13.  
  14. PRINT "LOCKING TOP TANK.".
  15. FOR RES IN topTank:resources {
  16. SET RES:enabled TO FALSE.
  17. }
  18.  
  19. PRINT "LOCKING MIDDLE TANK.".
  20. FOR RES IN middleTank:resources {
  21. SET RES:enabled TO FALSE.
  22. }
  23.  
  24. // Little tank thats hanging off the launch clamps - launch when its empty, so the KW rocketry engine is on full thrust
  25. WHEN launchTank:resources[0]:amount < (launchTank:resources[0]:capacity*0.05) THEN {
  26. PRINT "LAUNCHING.".
  27. STAGE.
  28. }
  29.  
  30. // Have the fuel tanks drain bottom to top, makes things less flippy..
  31.  
  32. WHEN bottomTank:resources[0]:amount < (bottomTank:resources[0]:capacity*0.05) THEN {
  33. PRINT "BOTTOM TANK RUNNING OUT - UNLOCKING MIDDLE TANK.".
  34. FOR RES IN middleTank:resources {
  35. SET RES:enabled TO TRUE.
  36. }
  37. }
  38.  
  39. WHEN middleTank:resources[0]:amount < (middleTank:resources[0]:capacity*0.05) THEN {
  40. PRINT "MIDDLE TANK RUNNING OUT - UNLOCKING TOP TANK.".
  41. FOR RES IN topTank:resources {
  42. SET RES:enabled TO TRUE.
  43. }
  44. }
  45.  
  46.  
  47. WHEN (ship:altitude > 35000) THEN {
  48. PRINT "DUMPING FINS.".
  49. FOR DECOUPLER IN FinDecoupler {
  50. DECOUPLER:getmodule("ModuleAnchoredDecoupler"):doevent("decouple").
  51. }
  52. }
  53.  
  54. WHEN (ship:altitude > 80000) THEN {
  55. PRINT "DEPLOYING FAIRING.".
  56. Fairing:doevent("deploy").
  57. print AntennaeOnVessel.
  58.  
  59. PRINT "ACTIVATING ANTENNAE.".
  60. FOR Antenna in AntennaeOnVessel {
  61. Antenna:getmodule("ModuleRTAntenna"):doaction("activate", True).
  62. }
  63. PRINT "Exiting.".
  64. SET END TO TRUE.
  65.  
  66. }
  67.  
  68.  
  69. UNTIL END {
  70. WAIT 0.001.
  71. }
Advertisement
Add Comment
Please, Sign In to add comment