I just wonder about the Lua codes.
I see Lvars, as example reading by SPADnext, "L:fgcp_autothrottle_switch1", "Int"
If I use them as example fs2020_variable_write ("L:fgcp_autothrottle_switch1", "Int", 1)
The switch is triggered and flips back at once.
Interestingly in the MaddogX_interior.xml says "bool"
<Name>fgcp_autothrottle_switch1</Name>
<AnimLength>10</AnimLength>
<Animation>
<Parameter>
<Code>10 0 (L:fgcp_autothrottle_switch1, bool) ?</Code>
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmi 0 == if{ 536870912 7 + (>L:fgcp_event, number) }
(M:Event) 'RightSingle' scmi 0 == if{ 2147483648 7 + (>L:fgcp_event,number) }
(M:Event) 'WheelUp' scmi 0 == if{ 536870912 7 + (>L:fgcp_event, number) }
(M:Event) 'WheelDown' scmi 0 == if{ 2147483648 7 + (>L:fgcp_event,number) }
Hubhob says:
MD_82_FGCP_AP_AUTOTHROTTLE_SWITCH
536870912 7 + (>L:fgcp_event, number)
or as example
MD_82_VC_PARKING_BRAKE_OFF
(L:vc_parking_brake_knob, bool) if{ 536870912 1 + (>L:cockpit_event,number) }
MD_82_VC_PARKING_BRAKE_ON
(L:vc_parking_brake_knob, bool) ! if{ 536870912 1 + (>L:cockpit_event,number) }
If I use these (Mouse events?) as RPN Scrips at Axis und Ohs it works.
How can I use these fo the LUA Code?
Thanks and regards,
Herbert
Help needed Lua codes for Leonardo MD-80
Help needed Lua codes for Leonardo MD-80
Herbert Puukka
MSFS - CRJ, X-Plane - Citation X, Air Manager, FSHud, Navigraph
MSFS - CRJ, X-Plane - Citation X, Air Manager, FSHud, Navigraph
Re: Help needed Lua codes for Leonardo MD-80
Meanwhile I´ve discovered some coding by try and error, the Autothrottle Switch looks like that.....strange but working including callback
Seems I´ll go on with this project.
function autot_click(position)
if position == 0 then
switch_set_position(autot_switch, 1)
fs2020_variable_write("L:fgcp_event", "number", 536870919)
fs2020_variable_write("L:fgcp_event", "number", 8199)
elseif position == 1 then
switch_set_position(autot_switch, 0)
fs2020_variable_write("L:fgcp_event", "number", 536870919)
fs2020_variable_write("L:fgcp_event", "number", 8199)
end
end
autot_switch = switch_add("sw_big_dwn.png", "sw_big_up.png", 18, 47, 45, 115, autot_click)
--536870912 7 + (>L:fgcp_event, number)
--8192 7 + (>L:fgcp_event, number)
function ss_at(at_on)
if at_on ==1 then
switch_set_position(autot_switch, 1)
elseif at_on ==0 then
switch_set_position(autot_switch, 0)
end
end
fs2020_variable_subscribe("L:fgcp_autothrottle_switch1", "Int", ss_at)
Seems I´ll go on with this project.
function autot_click(position)
if position == 0 then
switch_set_position(autot_switch, 1)
fs2020_variable_write("L:fgcp_event", "number", 536870919)
fs2020_variable_write("L:fgcp_event", "number", 8199)
elseif position == 1 then
switch_set_position(autot_switch, 0)
fs2020_variable_write("L:fgcp_event", "number", 536870919)
fs2020_variable_write("L:fgcp_event", "number", 8199)
end
end
autot_switch = switch_add("sw_big_dwn.png", "sw_big_up.png", 18, 47, 45, 115, autot_click)
--536870912 7 + (>L:fgcp_event, number)
--8192 7 + (>L:fgcp_event, number)
function ss_at(at_on)
if at_on ==1 then
switch_set_position(autot_switch, 1)
elseif at_on ==0 then
switch_set_position(autot_switch, 0)
end
end
fs2020_variable_subscribe("L:fgcp_autothrottle_switch1", "Int", ss_at)
Herbert Puukka
MSFS - CRJ, X-Plane - Citation X, Air Manager, FSHud, Navigraph
MSFS - CRJ, X-Plane - Citation X, Air Manager, FSHud, Navigraph