Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CLEARSCREEN.
- SAS OFF.
- RUN ONCE mainlib.ks.
- DECLARE topTank TO ship:partsdubbed("topTank")[0].
- DECLARE middleTank TO ship:partsdubbed("middleTank")[0].
- DECLARE bottomTank TO ship:partsdubbed("bottomTank")[0].
- DECLARE launchTank TO ship:partsdubbed("launchTank")[0].
- DECLARE Fairing TO ship:partsdubbed("launchfairing")[0]:getmodule("moduleproceduralfairing").
- DECLARE FinDecoupler TO ship:partsdubbed("findecoupler").
- DECLARE END TO FALSE.
- PRINT "LOCKING TOP TANK.".
- FOR RES IN topTank:resources {
- SET RES:enabled TO FALSE.
- }
- PRINT "LOCKING MIDDLE TANK.".
- FOR RES IN middleTank:resources {
- SET RES:enabled TO FALSE.
- }
- // Little tank thats hanging off the launch clamps - launch when its empty, so the KW rocketry engine is on full thrust
- WHEN launchTank:resources[0]:amount < (launchTank:resources[0]:capacity*0.05) THEN {
- PRINT "LAUNCHING.".
- STAGE.
- }
- // Have the fuel tanks drain bottom to top, makes things less flippy..
- WHEN bottomTank:resources[0]:amount < (bottomTank:resources[0]:capacity*0.05) THEN {
- PRINT "BOTTOM TANK RUNNING OUT - UNLOCKING MIDDLE TANK.".
- FOR RES IN middleTank:resources {
- SET RES:enabled TO TRUE.
- }
- }
- WHEN middleTank:resources[0]:amount < (middleTank:resources[0]:capacity*0.05) THEN {
- PRINT "MIDDLE TANK RUNNING OUT - UNLOCKING TOP TANK.".
- FOR RES IN topTank:resources {
- SET RES:enabled TO TRUE.
- }
- }
- WHEN (ship:altitude > 35000) THEN {
- PRINT "DUMPING FINS.".
- FOR DECOUPLER IN FinDecoupler {
- DECOUPLER:getmodule("ModuleAnchoredDecoupler"):doevent("decouple").
- }
- }
- WHEN (ship:altitude > 80000) THEN {
- PRINT "DEPLOYING FAIRING.".
- Fairing:doevent("deploy").
- print AntennaeOnVessel.
- PRINT "ACTIVATING ANTENNAE.".
- FOR Antenna in AntennaeOnVessel {
- Antenna:getmodule("ModuleRTAntenna"):doaction("activate", True).
- }
- PRINT "Exiting.".
- SET END TO TRUE.
- }
- UNTIL END {
- WAIT 0.001.
- }
Advertisement
Add Comment
Please, Sign In to add comment