-
Notifications
You must be signed in to change notification settings - Fork 0
/
munprobe.ks
50 lines (45 loc) · 1.15 KB
/
munprobe.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
42
43
44
45
46
47
48
49
50
@lazyGlobal off.
runOncePath("0:/functions.ks").
runOncePath("0:/launch.ks").
runOncePath("0:/transfer.ks").
runOncePath("0:/suicide.ks").
local j10 is ship:partsdubbed("J-10")[0].
sas off.
function courseCorrection {
parameter tgtalt.
print "Starting course correction".
lock steering to retrograde.
add node(time:seconds + eta:transition / 4, 0, 0, 0).
print nextNode.
warptonode(nextNode).
remove nextNode.
lock throttle to 0.01.
wait until ship:orbit:nextpatch:periapsis >= tgtalt.
lock throttle to 0.
}
function tweakap {
parameter tgtalt.
lock steering to retrograde.
lock throttle to 0.35.
wait until periapsis <= tgtalt.
lock throttle to 0.
unlock steering.
}
function warptomun {
wait 0.5.
set kuniverse:timewarp:mode to "RAILS".
set kuniverse:timewarp:rate to 1000.
wait until ship:body:name = "Mun".
set kuniverse:timewarp:rate to 0.
}
launch().
tranferpls(mun).
wait 1.
if ship:orbit:nextpatch:body:radius >= ship:orbit:nextpatch:periapsis { courseCorrection(35000). }
warptomun().
tweakap(20000).
set j10:thrustlimit to 30.
circ("periapsis").
wait 1.
deorbit().
suicide(0.015).