-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorbit.ks
46 lines (36 loc) · 1.11 KB
/
orbit.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
declare parameter compass.
sas off.
set direction to heading(compass, 0).
lock steering to direction.
clearScreen.
HUDTEXT("Welcome to space!", 8, 10, 24, rgb(1,1,0.5), true).
print "Reaching apoapsis in T-" + round(eta:apoapsis, 0) + " seconds.".
until eta:apoapsis <= 30 {
print round(eta:apoapsis, 0) + " seconds" at (23, 1).
}
print "Approaching apoapsis. Starting orbital burn...".
set direction to heading(compass, 0).
lock throttle to 1.0.
set ship:control:pilotmainthrottle to 1.0.
wait until ship:periapsis > 70000.
lock throttle to 0.
set ship:control:pilotmainthrottle to 0.
local keypress is "".
HUDTEXT("Welcome to orbit!", 8, 10, 24, rgb(1,1,0.5), true).
until keypress = "q" {
clearscreen.
print "Welcome to orbit!".
print "Ready to return to Kerbin? Type Y/n: ".
set keypress to terminal:input:getchar().
if keypress = terminal:input:enter or keypress = "Y" {
print "Proceeding to orbit!".
runPath("0:automated-rocket-control/deorbit.ks").
break.
} else if keypress = "N" {
print "When you're ready to return, type Y".
wait 3.
} else {
print "Invalid".
wait 0.5.
}
}