-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathland.ks
41 lines (30 loc) · 990 Bytes
/
land.ks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@lazyglobal off.
parameter myMaxThrust.
wait until altitude < 30000.
set warp to 0.
clearscreen.
print "alt:radar :" at (2, 10).
print "tgtVel :" at (2, 11).
print "tgtAccel :" at (2, 12).
print "gHere :" at (2, 13).
print "throt :" at (2, 14).
local lock tgtVel to -alt:radar / 10 - 2.
local lock maxEngineAccel to myMaxThrust / mass.
local gHere to body:mu / (body:radius ^ 2).
sas off.
lock steering to lookdirup(-ship:obt:velocity:surface, ship:facing:topvector).
local throt to 1.
lock throttle to throt.
when (alt:radar < 500) then gear on.
when (ship:obt:velocity:surface:mag < 5) then lock steering to lookdirup(up:vector, ship:facing:topvector).
until status = "Landed" {
local tgtAccel to tgtVel + ship:obt:velocity:surface:mag.
set throt to (tgtAccel + gHere) / maxEngineAccel.
print alt:radar at (15, 10).
print tgtVel at (15, 11).
print tgtAccel at (15, 12).
print gHere at (15, 13).
print throt at (15, 14).
wait 0.05.
}
set throt to 0.