Jump to content

Aerosoft A320 - FSUIPC and LUA


Recommended Posts

Posted

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. :)

Archived

This topic is now archived and is closed to further replies.

  • 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...