Advertisement
niwo

status_0.1.ks

Aug 20th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.58 KB | None | 0 0
  1. // Flight Status Script for kOS mod for Kerbal Space Program
  2. // by Niwo
  3. // Declaration:
  4. // SET vStat TO SHIP:PARTSDUBBED("Flight.Status")[0]. // Todo later
  5.  
  6.  
  7. clearscreen.
  8.  
  9.     //Print data to screen.
  10.     UNTIL FALSE { // CTRL+C to break out
  11.     // print "Running Module " + vStat + "      " at (5,1).
  12.     print "Flight Status:    " + status + "      " at (5,1).
  13.     if SESSIONTIME < 59 {
  14.     print "Session Time:     " + round(SESSIONTIME) + " s    " at (5,2).
  15.     }.
  16.     else {
  17.     print "Session Time:     " + round(SESSIONTIME / 60 )+ " min  " at (5,2).
  18.     }.
  19.     print "===============================" at (5,3).
  20.     if ALT:RADAR < 1000 {
  21.     print "ALTITUDE:         " + round(ALT:RADAR) + " m    " at (5,4).
  22.     }.
  23.         else {
  24.         print "ALTITUDE:         " + round(ALT:RADAR / 1000) + " km   " at (5,4).
  25.         }.
  26.     if SHIP:ALTITUDE < 1000 {
  27.         print "ALTITUDE (ASL):   " + round(SHIP:ALTITUDE) + " m    " at (5,5).
  28.     }.
  29.         else {
  30.         print "ALTITUDE (ASL):   " + round(SHIP:ALTITUDE / 1000) + " km   " at (5,5).
  31.         }.
  32.        
  33.     if SHIP:APOAPSIS > 1000000 {
  34.         print "APOAPSIS:         " + round(SHIP:APOAPSIS / 1000000, 1) + " Mm     " at (5,6).
  35.     }
  36.     else if SHIP:APOAPSIS > 1000 {
  37.     print "APOAPSIS:         " + round(SHIP:APOAPSIS / 1000) + " km     " at (5,6).
  38.     }.
  39.         else {
  40.         print "APOAPSIS:         " + round(SHIP:APOAPSIS) + " m     " at (5,6).
  41.         }.
  42.    
  43.     if SHIP:PERIAPSIS > 1000000 or SHIP:PERIAPSIS < -1000000 {
  44.     print "PERIAPSIS:        " + round(SHIP:PERIAPSIS / 1000000, 2) + " Mm      " at (5,7).
  45.     }.
  46.     else if SHIP:PERIAPSIS > 1000 or SHIP:PERIAPSIS < -1000 {
  47.         print "PERIAPSIS:        " + round(SHIP:PERIAPSIS / 1000) + " km      " at (5,7).
  48.     }.
  49.         else {
  50.         print "PERIAPSIS:        " + round(SHIP:PERIAPSIS) + " m     " at (5,7).
  51.         }.
  52.    
  53.     if ETA:APOAPSIS < 59 {
  54.     print "ETA to AP:        " + round(ETA:APOAPSIS) + " s     " at (5,8).
  55.     }.
  56.     else {
  57.     print "ETA to AP:        " + round(ETA:APOAPSIS / 60) + " min  " at (5,8).
  58.     }.
  59.    
  60.     print "OAT:              " + round(Ship:Sensors:TEMP) + "      " at (5,9).
  61.     // print "PRESS:     " + round(Ship:Sensors:press) + "      " at (5,10).
  62.     // TODO FUEL BAR:
  63.     print "Liquid Fuel:      " + round(ship:liquidfuel) + "      " at (5,10).
  64.     if ship:liquidfuel < 100  {
  65.         print "WARNING! FUEL LOW!" at (5,12).
  66.  
  67.     }.
  68.     if ALT:RADAR < 5000 {
  69.         print "WARNING! ALTITUDE LOW!" at (5,13).
  70.  
  71.     }.
  72.     if ship:ELECTRICCHARGE < 100 {
  73.     print "WARNING! BATTERY LOW!" at (5,14).
  74.     wait 0.3.
  75.     print "                              "  at (5,14).
  76.     wait 0.3.
  77.     }.
  78.     // clearscreen.
  79.     // if false = 1 {
  80.         // clearscreen. // Is not captured when escaping with ctrl + c :(
  81.         // }.
  82.         }.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement