Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Flight Status Script for kOS mod for Kerbal Space Program
- // by Niwo
- // Version: 0.2
- // TODO: Sort and Group and Space Sections.
- // Declaration:
- // SET vStat TO SHIP:PARTSDUBBED("Flight.Status")[0]. // Todo later
- set panel to 0.
- on ship:panels {
- set panel to 1.
- }
- clearscreen.
- //Print data to screen.
- UNTIL FALSE { // CTRL+C to break out
- // print "Running Module " + vStat + " " at (2,1).
- // Line 1
- print "Flight Status: " + status + " " at (2,1).
- // Line 2
- if SESSIONTIME < 59 {
- print "Session Time: " + round(SESSIONTIME) + " s" at (2,2).
- }.
- else {
- print "Session Time: " + round(SESSIONTIME / 60 )+ " min" at (2,2).
- }.
- // Line 3
- print "================================================" at (2,3).
- // Line 4
- if ALT:RADAR < 1000 {
- print "ALTITUDE (RADAR): " + round(ALT:RADAR) + " m " at (2,4).
- }.
- else if ALT:RADAR < 1000000{
- print "ALTITUDE (RADAR): " + round(ALT:RADAR / 1000) + " km " at (2,4).
- }
- else {
- print "ALTITUDE (RADAR): " + round(ALT:RADAR / 1000000) + " Mm " at (2,4).
- }
- // Line 5 .
- if SHIP:ALTITUDE < 1000 {
- print "ALTITUDE (ASL): " + round(SHIP:ALTITUDE) + " m " at (2,5).
- }.
- else if SHIP:ALTITUDE < 1000000{
- print "ALTITUDE (ASL): " + round(SHIP:ALTITUDE / 1000) + " km " at (2,5).
- }.
- else {
- print "ALTITUDE (ASL): " + round(SHIP:ALTITUDE / 1000000) + " Mm " at (2,5).
- }.
- // Line 6
- if SHIP:APOAPSIS > 1000000 or SHIP:APOAPSIS < -1000000{
- print "APOAPSIS: " + round(SHIP:APOAPSIS / 1000000) + " Mm " at (2,6).
- }.
- else if SHIP:APOAPSIS > 1000 {
- print "APOAPSIS: " + round(SHIP:APOAPSIS / 1000) + " km " at (2,6).
- }.
- else {
- print "APOAPSIS: " + round(SHIP:APOAPSIS) + " m " at (2,6).
- }.
- // Line 7
- if SHIP:PERIAPSIS > 1000000 or SHIP:PERIAPSIS < -1000000 {
- print "PERIAPSIS: " + round(SHIP:PERIAPSIS / 1000000, 1) + " Mm " at (2,7).
- }.
- else if SHIP:PERIAPSIS > 1000 or SHIP:PERIAPSIS < -1000 {
- print "PERIAPSIS: " + round(SHIP:PERIAPSIS / 1000) + " km " at (2,7).
- }.
- else {
- print "PERIAPSIS: " + round(SHIP:PERIAPSIS) + " m " at (2,7).
- }.
- // Line 8 // Fix hours
- if ETA:APOAPSIS < 59 {
- print "ETA to AP: " + round(ETA:APOAPSIS) + " s " at (2,8).
- }.
- else if ETA:APOAPSIS < 3600 {
- print "ETA to AP: " + round(ETA:APOAPSIS / 60 ) + " m " at (2,8).
- // print "ETA to AP: " + round(ETA:APOAPSIS / 60 ) + ":" + ((ETA:APOAPSIS / 60 ) - round(ETA:APOAPSIS / 60 )) + " min " at (2,8).
- }.
- else if ETA:APOAPSIS < 86400 {
- print "ETA to AP: " + round(ETA:APOAPSIS / 3600, 1 ) + " h " at (2,8).
- }.
- else if ETA:APOAPSIS > 86400 {
- print "ETA to AP: " + round(ETA:APOAPSIS / 3600 / 24 ) + " d " at (2,8).
- }.
- // Line 9
- print "Ambient Temp.: " + round(Ship:Sensors:TEMP) + " K " at (2,9).
- // Line 10
- print "Pressure: " + round(Ship:Sensors:pres) + " atm " at (2,10).
- // Line 11
- set lChrg to 11.
- print "Electric Charge: " + round(Ship:electricCharge) + " " at (2,lChrg).
- // Line 12
- set lExp to 12.
- print "Sun Exposure: " + round(Ship:Sensors:Light) + " " at (2,lExp).
- if round(Ship:Sensors:Light) < 2 {
- print "low " at (28,lExp).
- }.
- else if round(Ship:Sensors:Light) < 6 {
- print "med " at (28,lExp).
- }.
- else if round(Ship:Sensors:Light) > 6 {
- print "High" at (28,lExp).
- }.
- // Line 13
- // Line 14
- // TODO FUEL BAR:
- set lFuel to 13.
- if ship:liquidfuel > 0.1 {
- print "Liquid Fuel: " + round(ship:liquidfuel) + " " at (2,lFuel).
- // print "Liquid Fuel: " + round(ship:liquidfuel*2.5693) + " Liter" at (2,15).
- if ship:liquidfuel < 100 {
- print "WARNING! FUEL LOW!" at (28,lFuel).
- }.
- }.
- // Line 15
- // ...
- if ALT:RADAR < 5000 and ALT:RADAR > 50 {
- print "WARNING! ALTITUDE LOW!" at (28,4).
- }.
- // Charging?
- set sChrg to ship:ELECTRICCHARGE.
- wait 0.05.
- if ship:ELECTRICCHARGE > sChrg {
- print "Charging. " at (28,lChrg).
- // set sChrg to ship:ELECTRICCHARGE. // Obsolete.
- set charging to 1.
- wait 0.5.
- }.
- else if ship:ELECTRICCHARGE < sChrg{
- print "Discharging. " at (28,lChrg).
- set charging to 0.
- wait 0.5.
- // set sChrg to ship:ELECTRICCHARGE. // Obsolete.
- }.
- // else if (ship:ELECTRICCHARGE / sChrg) = 1 {
- else if ship:ELECTRICCHARGE = sChrg {
- print "Battery Full. " at (28,lChrg).
- set sChrg to ship:ELECTRICCHARGE. // Obsolete.
- }.
- if ship:ELECTRICCHARGE < 100 {
- print "WARNING! BATTERY LOW!" at (28,lChrg).
- wait 0.5.
- // print " " at (28,lChrg).
- // wait 0.5.
- }.
- when ship:ELECTRICCHARGE < 100 and charging = 0 then {
- if warp > 0 {
- set WARP to 0.
- }.
- // set WARP to 0.
- preserve.
- }.
- // ON AG99 {
- // PRINT "Action Group 99 Activated!".
- // clearscreen.
- // set false to 1.
- // break.
- // }
- // ON AG99 {
- // PRINT "Action Group 99 activated.".
- // PRESERVE.
- // }
- if false = 1 {
- clearscreen. // Is not captured when escaping with ctrl + c :(
- }.
- }.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement