Advertisement
sumguytwitches

Landing Info Display

Mar 6th, 2024
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set sgfirst to 0.
  2. set sgp to 0.
  3. set sggo to true.
  4. set sgf to 8.
  5. set sgpr to 4.
  6. function sgd {
  7. parameter sglabel. parameter sgdetail.
  8. If sglabel:length > sgpr set sgpr to sglabel:length.
  9. print (sglabel:padleft(sgpr) + ": " +round(sgdetail,2)):padright(terminal:width) at (0, sgp).
  10. set sgp to sgp + 1.
  11. }.
  12.  
  13. lock sgtwr to ship:availablethrust/ship:mass/body:mu*body:position:sqrmagnitude.
  14. list engines in sgengines.
  15. function sgfueltime {
  16. set sgtotal to 0.
  17. for sge in sgengines set sgtotal to choose sgtotal+sge:consumedresources["liquid fuel"]:fuelflow if sge:consumedresources:haskey("liquid fuel") else sgtotal.
  18. return choose ship:liquidfuel/sgtotal if sgtotal > 0 else -1.
  19. }
  20.  
  21.  
  22.  
  23. set sggo to false. wait 0. set sggo to true.
  24. On round(kuniverse:realtime * sgf) {
  25. set sgp to sgfirst.
  26.  
  27. sgd("Vertical Speed", ship:verticalspeed).
  28. sgd("alt radar",alt:radar).
  29. sgd("terrain alt",ship:geoposition:terrainheight).
  30. sgd("groundspeed",groundspeed).
  31. sgd("twr",sgtwr).
  32. sgd("oxidizer", ship:oxidizer).
  33. sgd("liquidfuel", ship:liquidfuel).
  34. sgd("ore", ship:ore).
  35. sgd("EC", ship:electriccharge).
  36. sgd("Fuel Time", sgfueltime()/60).
  37. sgd("eta minutes", alt:radar / -ship:verticalspeed / 60).
  38. sgd("lat", ship:geoposition:lat).
  39. sgd("long", ship:geoposition:lng).
  40. sgd("Dist", target:distance).
  41.  
  42. Print "":padright(terminal:width) at (0,sgp).
  43. Set sgp to sgp + 1.
  44. Print "":padright(terminal:width) at (0,sgp).
  45. return sggo.
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement