Skip to content

Instantly share code, notes, and snippets.

@HerrCraziDev
Created February 22, 2018 07:36
Show Gist options
  • Save HerrCraziDev/79f83aaf2f06f8452ade38e43df3fe5a to your computer and use it in GitHub Desktop.
Save HerrCraziDev/79f83aaf2f06f8452ade38e43df3fe5a to your computer and use it in GitHub Desktop.
Falcon Heavy autopilot script
//***********************************/
//* Falcon Core Test Script */
//* - */
//* Falcon Reusability System v2.3 */
//* © FAITO Aerospace Inc. - 2059*/
//***********************************/
// Author : HerrCrazi
//This document is open-source, you can redistribute and modify it as you want,
//but don't forget to mention the author.
switch to 0.
run "boot/faito_init.ks".
runoncepath("libfalcon.ks").
//Some initialization
set radarOffset to alt:radar.
set targetOrbit to 100000.
set landingTarget to getLandingSite("auto").
print "LAT : "+landingTarget:lat.
print "LONG: "+landingTarget:lng.
//Wait until launch
print "Waiting for launch. Press [SPACE] to start.".
WAIT UNTIL ship:status <> "PRELAUNCH".
if (core:tag = "main")
{
//Find the index of the Liquid Fuel in the AggregateResources resources list
set lqfResIndex to getResourceIndex("LIQUIDFUEL").
//Launch to a 100km orbit
fh_launch(100000).
}
else if (core:tag = "Right Side Core" or core:tag = "Center Core" or core:tag = "Left Side Core")
{
//Wait until the core have been staged
WAIT UNTIL stage:number <= 1.
WAIT UNTIL stage:ready.
if stage:number > 0
{
STAGE.
WAIT UNTIL stage:ready.
}
//Do the boostback and bring that impact point closer to home
fh_boostback(landingTarget).
lock steering to srfretrograde.
//Land the core (hopefully) (warranty void in case of RUD)
run hoverslam.ks(radarOffset, 8).
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment