Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clearscreen.
- on ag10 {
- abortflight().
- }
- prep().
- fuel().
- flight().
- detanking().
- function prep {
- print "Welcome to Starship Flight Software V1!".
- print "Running hardware, preparings for software...".
- wait 1.
- set teststatus to "Preparations".
- wait until teststatus = "Preparations".
- wait 1.
- set goal to "Launch".
- rcs on.
- set targetPe to 125000.
- set targetAp to 40000.
- set Azimuth to 110.
- set topv to ship:facing:topvector.
- lock steering to lookdirup(up:vector,topv).
- set h to alt:radar.
- lock altit to alt:radar-h.
- set engList to list().
- set i to -1.
- until i >= 32 {
- set i to i + 1.
- engList:add(ship:partstagged("Vector" + i)[0]).
- }
- for eng in engList { eng:shutdown. }
- print "Goal: " + goal.
- print "Press 9".
- wait 1.
- wait until ag9.
- set now to time:seconds.
- lock testtime to time:seconds - now.
- wait 1.
- toggle ag9.
- set teststatus to "Fueling".
- print "Go for test".
- }
- function fuel {
- print "Beginning fueling".
- wait 1.
- print "Awaiting for fueling end, press 9 to end".
- wait 1.
- until ag9 {
- printing().
- }
- set teststatus to goal + " preparing".
- wait 1.
- toggle ag1.
- toggle ag2.
- toggle ag9.
- print "Fueling finished, press 9".
- wait 1.
- until ag9 {
- printing().
- }
- toggle ag9.
- toggle ag1.
- toggle ag2.
- wait 6.
- set teststatus to goal + " go".
- }
- function flight {
- print "Hold for final GO/NO GO, press 9".
- set teststatus to goal + "GO/NO GO POLL".
- until ag9 {
- printing().
- }
- toggle ag9.
- set teststatus to goal.
- print "Countdown initiated, T-10".
- set now to time:seconds.
- lock t to time:seconds-now.
- until t >= 7 {
- clearscreen.
- print "T-" + (10-t).
- wait 1.
- }
- lock throttle to 0.05.
- wait 0.5.
- set now to time:seconds.
- lock t to time:seconds-now.
- ship:partstagged("Vector0")[0]:activate.
- ship:partstagged("Vector1")[0]:activate.
- ship:partstagged("Vector2")[0]:activate.
- ship:partstagged("Vector20")[0]:activate.
- ship:partstagged("Vector18")[0]:activate.
- ship:partstagged("Vector28")[0]:activate.
- ship:partstagged("Vector30")[0]:activate.
- lock throttle to min(0.4, t/0.3).
- wait 0.5.
- print "T-2".
- lock throttle to 0.45.
- ship:partstagged("Vector29")[0]:activate.
- ship:partstagged("Vector19")[0]:activate.
- ship:partstagged("Vector10")[0]:activate.
- ship:partstagged("Vector12")[0]:activate.
- ship:partstagged("Vector5")[0]:activate.
- ship:partstagged("Vector7")[0]:activate.
- wait 0.2.
- ship:partstagged("Vector16")[0]:activate.
- ship:partstagged("Vector11")[0]:activate.
- ship:partstagged("Vector6")[0]:activate.
- ship:partstagged("Vector21")[0]:activate.
- ship:partstagged("Vector17")[0]:activate.
- ship:partstagged("Vector27")[0]:shutdown.
- ship:partstagged("Vector31")[0]:activate.
- wait 0.2.
- ship:partstagged("Vector15")[0]:activate.
- ship:partstagged("Vector14")[0]:activate.
- ship:partstagged("Vector25")[0]:activate.
- ship:partstagged("Vector24")[0]:activate.
- ship:partstagged("Vector23")[0]:activate.
- ship:partstagged("Vector13")[0]:activate.
- wait 0.2.
- ship:partstagged("Vector26")[0]:shutdown.
- ship:partstagged("Vector22")[0]:activate.
- ship:partstagged("Vector32")[0]:activate.
- ship:partstagged("Vector9")[0]:activate.
- ship:partstagged("Vector3")[0]:activate.
- ship:partstagged("Vector8")[0]:activate.
- ship:partstagged("Vector4")[0]:activate.
- wait 0.4.
- print "T-1".
- set now to time:seconds.
- lock testtime to time:seconds - now.
- print "Full Ignition".
- until testtime > 7 {
- printing().
- }
- lock throttle to min(0.85, 0.4+t/0.3).
- until ship:verticalspeed > 1 {
- printing().
- }
- ship:partstagged("Vector0")[0]:shutdown.
- print "Liftoff".
- wait 0.1.
- until altit > 150 {
- printing().
- }
- lock gravityturn to 90-(((ship:apoapsis/TargetPe)^0.6)*90).
- lock steering to heading(Azimuth, gravityturn, 40).
- until altit > 520 {
- printing().
- }
- ag8 on.
- ship:partstagged("Vector0")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector1")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector2")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector3")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector4")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector5")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector6")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector7")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector8")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector9")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector10")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector11")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- ship:partstagged("Vector12")[0]:getmodule("ModuleGimbal"):setfield("Предел вектора тяги", 50).
- until altit > 2380 {
- printing().
- set ship:partstagged("Vector19")[0]:thrustlimit to random()*100.
- }
- ship:partstagged("Vector19")[0]:shutdown.
- until altit > 1700 {
- printing().
- set ship:partstagged("Vector32")[0]:thrustlimit to random()*100.
- }
- lock throttle to 0.75.
- until altit > 2800 {
- printing().
- set ship:partstagged("Vector32")[0]:thrustlimit to random()*100.
- }
- ship:partstagged("Vector22")[0]:shutdown.
- set oldq to ship:q.
- wait 0.1.
- set newq to ship:q.
- until newq < oldq {
- printing().
- set ship:partstagged("Vector32")[0]:thrustlimit to random()*100.
- set oldq to ship:q.
- wait 0.1.
- set newq to ship:q.
- }
- print "Max-Q".
- lock throttle to 0.85.
- set ship:partstagged("Vector32")[0]:thrustlimit to 100.
- until altit > 8230 {
- printing().
- }
- set ship:partstagged("Vector2")[0]:thrustlimit to random()*100.
- wait 2.
- until altit > 10173 {
- printing().
- set ship:partstagged("Vector2")[0]:thrustlimit to random()*100.
- set ship:partstagged("Vector23")[0]:thrustlimit to random()*100.
- }
- toggle ag5.
- until altit > 12000 {
- printing().
- set ship:partstagged("Vector2")[0]:thrustlimit to random()*100.
- }
- ship:partstagged("Vector2")[0]:shutdown.
- until altit > 14000 {
- printing().
- }
- unlock steering.
- set ship:control:pitch to -1.
- set ship:control:yaw to 1.
- set ship:control:roll to 0.5.
- wait 5.
- set ship:control:pitch to 0.
- set ship:control:yaw to 0.
- set ship:control:roll to 0.
- until ship:verticalspeed < 40 {
- printing().
- }
- for eng in engList { set eng:thrustlimit to 41. }
- lock throttle to 1.
- until ship:verticalspeed < 1 {
- printing().
- }
- ship:partsdubbed("FTSE1")[0]:activate.
- ship:partsdubbed("FTSE2")[0]:activate.
- for eng in engList { set eng:thrustlimit to 33. }
- until altit < 15000 and ship:verticalspeed < -20 {
- printing().
- }
- set teststatus to "FTS activated".
- set testtime to testtime.
- ag4 on.
- wait 3.
- ag7 on.
- stage.
- until altit < 50 or ship:verticalspeed > -5 and ship:verticalspeed < 5 {
- printing().
- }
- }
- function detanking {
- print "Test status: " + teststatus.
- ag1 off.
- ag2 off.
- for eng in engList { eng:shutdown. }
- }
- function printing {
- clearscreen.
- print "Time from test beginning: " + testtime + " Seconds".
- print "Test status: " + teststatus.
- print "Goal: " + goal.
- print "Time(KSC): " + time:clock.
- wait 0.1.
- }
- function abortflight {
- print "Abort".
- for eng in engList { eng:shutdown. }
- lock throttle to 0.
- unlock steering.
- wait 1.
- unlock throttle.
- set teststatus to "Detanking".
- detanking().
- }
Add Comment
Please, Sign In to add comment