Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clearscreen.
- on ag10 {
- aborttest().
- }
- prep().
- fuel().
- preburner().
- detanking().
- function prep {
- print "Welcome to Starship Test Software V2!".
- print "Running hardware, preparings for software...".
- wait 1.
- set teststatus to "Preparations".
- wait until teststatus = "Preparations".
- wait 1.
- set goal to "Static fire".
- if goal = "Preburner" {
- set n to 95.
- } else if goal = "Static fire" {
- set n to 0.9.
- }
- set northPole TO latlng(90,0).
- set head TO mod(360 - northPole:bearing,360).
- lock steering to heading(head, 90).
- set lenght to 13.
- set engList to list().
- set i to -1.
- until i >= 32 {
- set i to i + 1.
- engList:add(ship:partstagged("Vector" + i)[0]).
- }
- if goal = "Preburner" {
- set tthr to 0.05.
- } else if goal = "Static fire" {
- set tthr to 0.9.
- }
- for eng in engList { eng:shutdown. }
- print "Goal: " + goal.
- print "Lenght: " + lenght + " Seconds".
- 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 ag1.
- toggle ag2.
- wait 6.
- set teststatus to goal + " go".
- }
- function preburner {
- lock throttle to 0.05.
- 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(tthr, t/0.3).
- wait 0.5.
- lock throttle to tthr.
- ship:partstagged("Vector29")[0]:activate.
- ship:partstagged("Vector19")[0]:activate.
- ship:partstagged("Vector10")[0]:activate.
- ship:partstagged("Vector12")[0]:activate.
- ship:partstagged("Vector4")[0]:activate.
- ship:partstagged("Vector6")[0]:activate.
- wait 0.2.
- ship:partstagged("Vector16")[0]:activate.
- set n to time:seconds.
- lock t to time:seconds - n.
- print "Test began".
- until t > lenght - 0.0000001 {
- clearscreen.
- print "Test lenght: " + t + " Seconds".
- wait 0.01.
- }
- set n to time:seconds.
- lock t to time:seconds - n.
- toggle ag1.
- toggle ag2.
- lock throttle to max(0.05, 1-(t/0.3)).
- wait 0.5.
- print "Test completed".
- lock throttle to 0.
- set teststatus to "Completed, detanking".
- }
- function detanking {
- print "Test status: " + teststatus.
- toggle ag1.
- toggle ag2.
- for eng in engList { eng:shutdown. }
- wait 1.
- toggle ag9.
- wait 400.
- toggle ag1.
- toggle ag2.
- }
- function printing {
- clearscreen.
- print "Time from test beginning: " + testtime + " Seconds".
- print "Test status: " + teststatus.
- print "Goal: " + goal.
- print "Lenght of test: " + lenght + " Seconds".
- print "Time(KSC): " + time:clock.
- wait 0.1.
- }
- function aborttest {
- print "Abort".
- for eng in engList { eng:shutdown. }
- lock throttle to 0.
- unlock steering.
- wait 1.
- unlock throttle.
- set teststatus to "Detanking".
- detanking().
- }
Advertisement
Add Comment
Please, Sign In to add comment