Hello.
With the help of the Aerosoft A320 LVar list I wrote some LUA-Code to assign Keyboard-Buttons via the FSUIPC "Key Presses" Tab. In additon I found some other code on the internet that I use.
For example, turning the flight director on or off does work without any problems. But to toggle the FD does not work at all. It's the case with many more functions, too. Some work and some don't
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("L: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")
Is there an error in this code?
The lua-file is added to the fsuipc.ini file as followed.
[LuaFiles]
1=actions
2=autobreak
3=engine
4=lights
5=spoilers
6=autopilot
7=autopilot_BACK
[Auto]
1=Lua actions
2=Lua autobreak
3=Lua engine
4=Lua lights
5=Lua spoilers
6=Lua autopilot
Are the lua-files added correctly?
I am using the Aerosoft A320 v1.30 and FSUIPC.
Thank you for your help.