Sign in to follow this  

Aerosoft A320 - FSUIPC and LUA

Recommended Posts

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")

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

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

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
Help AVSIM continue to serve you!
Please donate today!

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