Jump to content
Sign in to follow this  
Barlow

Aerosoft A320 - FSUIPC and LUA

Recommended Posts

Hello.
I am trying to map the main functions of the Aerosoft A320 to my Keyboard using FSUIPC and Lua-Scripts.
I am having some trouble with it, because some functions work and some dont.

For example, the FD can be turned on and off without any problem, but I cannot toggle it. 

 

function Autopilot_FD_on ()
    LVarSet = "L:AB_MPL_FD"
    ipc.writeLvar(LVarSet, 1)
    SmallOverheadPushButtons ()
    DspShow ("FD", "on")
end

function Autopilot_FD_off ()
    LVarSet = "L:AB_MPL_FD"
    ipc.writeLvar(LVarSet, 0)
    SmallOverheadPushButtons ()
    DspShow ("FD", "off")
end

function Autopilot_FD_toggle ()
	if _tl("AB_MPL_FD", 0) then
		Autopilot_FD_on ()
	else
		Autopilot_FD_off ()
	end
end

event.flag(0, "Autopilot_FD_off")
event.flag(1, "Autopilot_FD_on")
event.flag(2, "Autopilot_FD_toggle")

It's the case with many more functions. Strangely, I found one toggle function which is using the same syntax as above and it works. Why does the FD toggle function not work for example?

I took this code from the LINDA forum.

 

Thank you in advance. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...