Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function DoDeorbit {
- parameter targeted is false.
- parameter tar is latlng(0,0).
- parameter lngoffset is 175.
- local deorbitlng is tar:lng - lngoffset.
- if deorbitlng < -180 {
- set deorbitlng to deorbitlng + 360.
- }
- if (targeted) {
- local warplng is 0.
- local wantedoffset is abs(ship:orbit:inclination).
- if (ship:longitude > deorbitlng - wantedoffset) {
- set warplng to 360 - ship:longitude + deorbitlng - wantedoffset.
- }
- else {
- set warplng to deorbitlng - wantedoffset - ship:longitude.
- }
- local warptime is time:seconds + warplng / (360 / ship:orbit:period - (360 / body:rotationperiod)).
- lock steering to -velocityat(ship, warptime):orbit.
- print "Re-orienting...".
- wait until vang(steering, ship:facing:vector) < 3.
- print "Warping...".
- warpto(warptime - 30).
- lock steering to retrograde.
- wait until time:seconds > warptime.
- }
- else {
- lock steering to retrograde.
- print "Re-orienting...".
- wait until vang(steering, ship:facing:vector) < 3.
- }
- if ship:maxthrust = 0 {
- toggle ag3.
- }
- lock throttle to 0.4.
- when (ship:periapsis < 42000) then {
- lock throttle to 0.
- toggle ag3.
- unlock steering.
- set PrintOut to false.
- }
- }
- Function LogToDisk { parameter volume is 1. parameter compileksm is false. local filestring is "
- if (homeConnection:isconnected AND exists(" + char(34) + "0:/boot/StableBoot.ks" + char(34) + ")) {
- copyPath(" + char(34) + "0:/boot/StableBoot.ks" + char(34) + ", " + char(34) + "1:/boot/StableBoot.ks" + char(34) + ").
- set core:bootfilename to " + char(34) + "boot/StableBoot" + char(34) + ".
- }
- wait until abs(vang(up:vector, ship:facing:vector) - 90) < 0.5
- and vang(up:vector, ship:facing:topvector) < 0.5.
- set ship:loaddistance:splashed:unpack to 0.1.
- set ship:loaddistance:splashed:pack to 0.2.
- hudtext(" + char(34) + "Barge is Stable" + char(34) + ", 4, 2, 24, white, false).
- ". if exists(volume + ":/" + "tmp.ks") { print ".ks File already exists, Overwriting.". deletepath(volume + ":/" + "tmp.ks"). } log filestring to volume + ":/" + "tmp.ks". wait 0. if (compileksm) { if exists(volume + ":/" + "tmp.ksm") { print ".ksm File already exists, Overwriting.". deletepath(volume + ":/" + "tmp.ksm"). } compile (volume + ":/" + "tmp.ks") to (volume + ":/" + "tmp.ksm").} }
Advertisement
Add Comment
Please, Sign In to add comment