matrosov Posted January 8, 2022 Report Share Posted January 8, 2022 (edited) Is there something special going on the Lua scripting? When I try to bind commands or datarefs thru lua the switch freezes up. It can't be moved interactively in cockpit and does not respond to the controller input. It works fine if I try to manipulate it thru DataRef Tool. Here's the quick example -- define the joystick offsets (for button assignments) if PLANE_ICAO == "CL60" and AIRCRAFT_FILENAME == "CL650.acf" then -- Bind datrefs to working variables Nav_On="sim/lights/nav_lights_on" Nav_Off="sim/lights/nav_lights_off" dataref("Nav","CL650/overhead/ext_lts/nav","writable") function CL60_NavLogo_On() command_once(Nav_On) end function CL60_NavLogo_Off() command_once(Nav_Off) end create_command("FlyWithLua/CL60_macros/01", "Nav_On", "CL60_NavLogo_On())", "", "") create_command("FlyWithLua/CL60_macros/02", "Nav_Off", "CL60_NavLogo_Off())", "", "") end It works just fine if I assign it directly but if it's in lua it freezes. switch up. Edited January 9, 2022 by Pils Link to comment Share on other sites More sharing options...
Pils Posted January 8, 2022 Report Share Posted January 8, 2022 You have one too many close parentheses in your create_command functions. Link to comment Share on other sites More sharing options...
matrosov Posted January 8, 2022 Author Report Share Posted January 8, 2022 1 hour ago, Pils said: You have one too many close parentheses in your create_command functions. Ugh duh. I am blind. Thanks a lot. Link to comment Share on other sites More sharing options...
Recommended Posts