Skip to content

Instantly share code, notes, and snippets.

View SofieBrink's full-sized avatar

Sofie SofieBrink

View GitHub Profile
// !runscript XXXXXX
// Sofie's Universal Display Bootfile Version
//-------------------------------------------------------------------------------------------------
// Usage Description. Parameters with {OPT} infront can be left out.
// FormatTime(input) - Function to format a time in seconds to a 24 hour human-readable clock format
//-------------------------------------------------------------------------------------------------
// Variables
global UD_Widgets is lexicon().
// !runscript f8ea9bbc5afe2561c7b41e96fbbd0766
// Sofie's Fake Docklanding Functions
//-------------------------------------------------------------------------------------------------
// Usage Description. Parameters with {OPT} infront can be left out.
// FakeDockland({opt} localPort, {opt} tgt, {opt} tgtPort) - Function to attempt to dockland on the target as soon as its loaded.
//-------------------------------------------------------------------------------------------------
// Variables
set MinSL to -2.
set MaxSL to -0.2.
@SofieBrink
SofieBrink / SofiePlaneLib.ks
Last active November 3, 2024 19:48
SofiePlaneLib.ks
// !runscript 6fe2b31896f518880b4f7b42d04f955a
// Sofie's Plane Lib
//-------------------------------------------------------------------------------------------------
// Usage Description. Parameters with {OPT} infront can be left out.
// Takeoff({OPT}Vel, {OPT}Mode, {OPT}, {OPT}Target, {OPT}dTA) - Flight control function for taking off, from a runway if on one. at DesSp or as given by Vel (Setting Vel updates DesVV).
// Mode sets the desired autopilot mode after takeoff, options are "Slope", "Altitude" or "Alt". The selected mode will be activated with Target (Setting Target updates DesSlope or DesA depending on Mode).
// dTA determines if TerrainAvoidance should be re-enabled after takeoff (Setting dTA updates TerrainAvoidance).
// FlyRunwayApproach(Runway, {OPT}Glideslope, {OPT}FinalDistance, {OPT}dTA) - Flight control function for landing on the specified runway.
//
//gist 1d0f7f6de526f489e676a5bb4ed51c90
// This version is only good for docklandings. For anything else use gist 7944e97619657cea4a3af77cf9500c6a instead.
// Assumes stable and circular (ap - pe < 500) orbit
// Set guidanceactive to false and vacLocLanderFinished to true, if you want to take over during landing
if not (defined tgt) {
if hastarget AND target:body = body AND (target:status = "landed" OR target:status = "splashed") {
set tgt to target:geoposition.