sumguytwitches

Untitled

Oct 30th, 2020
1,028
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. set menu to gui(200, 30). Set menu:x to -30. set menu:y to 300. menu:show.
  3. menu:addlabel("<b><color=yellow>VTOL 2-axis script</color></b>").
  4. set m0 to menu:addlabel("Mode:").
  5. set m1 to menu:addlabel("SL:").
  6. set m2 to menu:addlabel("HDG:").
  7. set m3 to menu:addlabel("Height:").
  8. set m4 to menu:addlabel("tAltOverride:").
  9. set m5 to menu:addlabel("vsOverride:").
  10. set m6 to menu:addlabel("alt:radar:").
  11. set m7 to menu:addlabel("trackCam:").
  12. set m8 to menu:addlabel("alignTerrainHeight:").
  13. set m9 to menu:addlabel("tiltOutwards:").
  14. set m10 to menu:addlabel("Localport:").
  15. set mLast to menu:addlabel("Functions: <color=white>goToTarget(), goToPosition(<geopos or position>), resetSteering()</color>").
  16. set mLast2 to menu:addlabel("Additional vars: <color=white>vsMin, vsMax, sideTiltMult</color>").
  17. set mLast3 to menu:addlabel("").
  18. set mLast4 to menu:addlabel("").
  19.  
  20. for txt in menu:widgets { set txt:style:fontsize to 10. set txt:style:padding:v to 1. }
  21. set m3:style:margin:top to 15.
  22. set m5:style:margin:bottom to 15.
  23. on time:second {
  24.     set m0:text to "Mode: <color=yellow>" + mode + "</color>".
  25.     set m1:text to "SL: <color=white>" + round(sl,2) + "m/s</color> (" + round(tvCopyMag,1) + ")".
  26.     set m2:text to "HDG: <color=white>" + round(hdg,2) + "</color>".
  27.    
  28.     set m3:text to (choose "<color=#222>Height: </color>" if vsOverride <> 0 or tAltOverride <> 0 else "Height: ") + "<color=white>" + height + "</color> (priority #3)".
  29.     set m4:text to (choose "<color=#222>tAltOverride: </color>" if vsOverride <> 0 or tAltOverride = 0 else "tAltOverride: ")+ "<color=white>" + tAltOverride + "</color> (priority #2 if <> 0)".
  30.     set m5:text to (choose "<color=#222>vsOverride: </color>" if vsOverride = 0  else "vsOverride: ") + "<color=white>" + vsOverride + "</color> (priority #1 if <> 0)".
  31.    
  32.     set m7:text to "TrackCam: <color=white>" + trackCam + "</color>".
  33.     set m8:text to "alignTerrainHeight: <color=white>" + alignTerrainHeight + "m</color> (match slope if height below this value)".
  34.     set m9:text to "tiltOutwards: <color=white>" + tiltOutwards + "</color>".
  35.     set m10:text to "Localport: <color=white>" + localport + "</color>".
  36.     return menu:visible.
  37. }
  38. when true then {
  39.     set m6:text to "Alt:radar: " + round(alt:radar,2) + "m".
  40.     set mLast3:text to "vs err: " + round(vsErr,3) + ", cur: " + round(verticalspeed,3).
  41.     set mLast4:text to "mul: " + round(mul,2) + ", tpid:iterm: " + round(tpid:iterm,4).
  42.     return menu:visible.
  43. }
  44. on vtol menu:dispose.
  45. clearscreen.
  46. print "VTOL hover script running. See GUI for available variables and functions.".
  47.  
  48.  
  49.  
  50.  
  51. // [Camera steering, uncomment to enable]
  52. //showVD().
  53. //trackcam off.
  54. //when true then {
  55. //  set sl to max(0,sl + (cam:distance - bnds:size:mag) * -3).
  56. //  set cam:distance to bnds:size:mag.
  57. //  set m1:text to "SL: <color=white>" + round(sl,2) + "m/s</color> (" + round(tvCopyMag,1) + ")".
  58. //  return lights.
  59. //}
  60. //lock hdg to cam:heading. trackCam off.
  61.  
RAW Paste Data