Initial import
This commit is contained in:
60
boot/kh-1.ks
Normal file
60
boot/kh-1.ks
Normal file
@@ -0,0 +1,60 @@
|
||||
@lazyglobal off.
|
||||
wait until ship:unpacked.
|
||||
rcs off.
|
||||
|
||||
runoncepath("0:/lib/common.ks").
|
||||
runoncepath("0:/lib/stage/thor.ks").
|
||||
runoncepath("0:/lib/stage/agena.ks").
|
||||
|
||||
local target_inclination is 90.
|
||||
local target_alt is 150_000.
|
||||
|
||||
local hdg is launch_azimuth(target_inclination, target_alt).
|
||||
|
||||
thor:launch(hdg, target_alt, 9.3).
|
||||
stage.
|
||||
agena:orbit(hdg).
|
||||
agena:power_down().
|
||||
print "Waiting for film or batteries to run out".
|
||||
|
||||
wait 1.
|
||||
set warpmode to "rails".
|
||||
set warp to 4.
|
||||
|
||||
local cam is ship:partsdubbed("RO-BasicFilmCamera")[0]:getmodule("Experiment").
|
||||
until false {
|
||||
if agena:low_power() {
|
||||
break.
|
||||
}
|
||||
local done is false.
|
||||
for evt in cam:allevents {
|
||||
if evt:contains("depleted") {
|
||||
set done to true.
|
||||
}
|
||||
}
|
||||
if done {
|
||||
break.
|
||||
}
|
||||
wait 1.
|
||||
}
|
||||
|
||||
set warp to 0.
|
||||
wait until kuniverse:timewarp:issettled.
|
||||
print "Transferring data to return capsule".
|
||||
wait until ship:rootpart:getmodule("HardDrive"):hasevent("transfer data here").
|
||||
ship:rootpart:getmodule("HardDrive"):doevent("Transfer data here").
|
||||
|
||||
print "Aligning for return".
|
||||
agena:power_up().
|
||||
rcs on.
|
||||
lock steering to ship:retrograde.
|
||||
wait 20.
|
||||
wait until steering_locked(0.001).
|
||||
|
||||
print "Deorbit!".
|
||||
stage.
|
||||
|
||||
// Stage parachute
|
||||
wait until ship:altitude < 25000.
|
||||
print "Parachute deploy".
|
||||
stage.
|
||||
Reference in New Issue
Block a user