Author Topic: Check Status of AutoPilot being On or Off  (Read 1818 times)

pgilbr

  • Newbie
  • *
  • Posts: 2
Check Status of AutoPilot being On or Off
« on: January 22, 2023, 09:44:46 AM »
For MSFS2020, I'm trying to set up a check to see if the autopilot is on or off.  It sort of works.  What happens is when I first press my bound joystick button to active the autopilot it says "On Not Set" .  If I push the joystick button again to disable the autopilot it then says "Off Not Set".  But if I press the button again to activate it will say "On Not Set" and if then I do not presss the button and ask for the status it says "Off Not Set".   Should it not still be detected in an active state?  Below is my code:  [Autopilot;AP;] Status

Execute external plugin, 'MSFS Agent - v1.0' using context 'getplanestate'
Begin Boolean Compare : [MSFSAgent.PlaneState.Autopilot_Master] Equals False
    Say, 'AP on {INT:MSFSAgent.PlaneState.Autopilot_Master}'
Else
    Say, 'AP off {INT:MSFSAgent.PlaneState.Autopilot_Master}'
End Condition


Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Check Status of AutoPilot being On or Off
« Reply #1 on: January 22, 2023, 11:34:35 AM »
Hi, there.

Somebody with knowledge about the MSFS Agent plugin may come around here eventually, but the fastest route would probably be to contact the author directly.  This looks like their github:  https://github.com/jamescl604/MSFSVoiceAttackPlugin

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Check Status of AutoPilot being On or Off
« Reply #2 on: January 22, 2023, 12:28:52 PM »
Your condition checks a Boolean variable, but your "Say Something with Text-To-Speech" actions retrieve the value of an integer variable (which would be a different variable altogether; variables of different types can have the same name, but they're still completely separate variables).

Also make sure to enable (check) the "Wait for the plugin function to finish before continuing" option in your "Execute an External Plugin Function" action.

pgilbr

  • Newbie
  • *
  • Posts: 2
Re: Check Status of AutoPilot being On or Off
« Reply #3 on: January 22, 2023, 01:36:39 PM »
Thank you both for the quick replies,  I'll do some more research with the information you provided.