October 4, 20241 yr I made for myself a few FSUIPC lua files and a macro file to enable keyboard/button programming lights and battery switch toggling. Figured I'd share in case any one would like to use them or their code: function dashlightland () ipc.lineDisplay("All LANDING Toggle") ipc.sleep(2000) Lights_Approach_Toggle () ipc.sleep(500) Lights_Flare_Toggle () end function Lights_Approach_On () ipc.writeLvar("L:OHD_EXT_LIGHTS_L_APPR_SW", 1) end function Lights_Approach_Off () ipc.writeLvar("L:OHD_EXT_LIGHTS_L_APPR_SW", 0) end function Lights_Approach_Toggle () if ipc.readLvar("L:OHD_EXT_LIGHTS_L_APPR_SW") == 0 then Lights_Approach_On () else Lights_Approach_Off () end end --- function Lights_Flare_On () ipc.writeLvar("L:OHD_EXT_LIGHTS_L_FLARE_SW", 1) end function Lights_Flare_Off () ipc.writeLvar("L:OHD_EXT_LIGHTS_L_FLARE_SW", 0) end function Lights_Flare_Toggle () if ipc.readLvar("L:OHD_EXT_LIGHTS_L_FLARE_SW") == 0 then Lights_Flare_On () else Lights_Flare_Off () end end function Light_LandingAll_On () Lights_Approach_On () ipc.sleep(1000) Lights_Flare_On () end function Light_LandingAll_Off () Lights_Approach_Off () ipc.sleep(1000) Lights_Flare_Off () end dashlightland () return =========================================================================== function dashlightpanel () ipc.lineDisplay("Only the PANEL Lights ON") ipc.sleep(10) if ipc.readLvar("L:OHD_PNL_LIGHTS_DOME_SW") == 0 then ipc.writeLvar("L:Q400_YOKE_VISIBILITY", 1) Panel_Light_Dome_On () else Panel_Light_Dome_Off () end end function Panel_Light_Dome_On () ipc.sleep(3000) ipc.writeLvar("L:OHD_PNL_LIGHTS_DOME_SW", 1) ipc.writeLvar("L:OHD_PNL_LIGHTS_STORM_SW", -1) x=35 while (x>1) do ipc.macro("dashlightknob:dashknobsON") ipc.sleep(100) x=x-1 end end function Panel_Light_Dome_Off () ipc.lineDisplay("Only the PANEL Lights OFF") ipc.sleep(3000) ipc.writeLvar("L:OHD_PNL_LIGHTS_DOME_SW", 0) ipc.writeLvar("L:OHD_PNL_LIGHTS_STORM_SW", 0) x=35 while (x>1) do ipc.macro("dashlightknob:dashknobsOFF") ipc.sleep(100) x=x-1 end end dashlightpanel () --this calls the IF toggle function defined at the top when the program is run return ============================================================================== --dashlightknob.mcro [Macros] Module="mjc84_main.DLL" 1=dashknobsON 1.1=RX35a260*X55cc,14 1.2=RX35a2f0*X55cc,14 1.3=RX35b260*X55cc,14 1.4=RX35b2f0*X55cc,14 2=dashknobsOFF 2.1=RX35a260*X55cc,13 2.2=RX35a2f0*X55cc,13 2.3=RX35b260*X55cc,13 2.4=RX35b2f0*X55cc,13 ============================================================================ function DC_StbyBatt_On () ipc.writeLvar("L:OHD_DC_CNTRL_PNL_STB_SW", 1) --DspShow ("Stby", "on") end function DC_StbyBatt_Off () ipc.writeLvar("L:OHD_DC_CNTRL_PNL_STB_SW", 0) --DspShow ("Stby", "off") end function DC_StbyBatt_toggle () if ipc.readLvar("L:OHD_DC_CNTRL_PNL_STB_SW") == 0 then DC_StbyBatt_On () else DC_StbyBatt_Off () end end function DC_AUXBatt_On () ipc.writeLvar("L:OHD_DC_CNTRL_PNL_AUX_SW", 1) -- DspShow ("Aux", "on") end function DC_AUXBatt_Off () ipc.writeLvar("L:OHD_DC_CNTRL_PNL_AUX_SW", 0) --DspShow ("Aux", "off") end function DC_AUXBatt_toggle () if ipc.readLvar("L:OHD_DC_CNTRL_PNL_AUX_SW") == 0 then DC_AUXBatt_On () else DC_AUXBatt_Off () end end function DC_MainBatt_On () ipc.writeLvar("L:OHD_DC_CNTRL_PNL_MAIN_SW", 1) --DspShow ("Main", "on") end function DC_MainBatt_Off () ipc.writeLvar("L:OHD_DC_CNTRL_PNL_MAIN_SW", 0) --DspShow ("Main", "off") end function DC_MainBatt_toggle () if ipc.readLvar("L:OHD_DC_CNTRL_PNL_MAIN_SW") == 0 then DC_MainBatt_On () else DC_MainBatt_Off () end end function DC_BattMaster_On () ipc.writeLvar("L:OHD_DC_CNTRL_PNL_MASTER_SW", 1) --DspShow ("Batt", "on") end function DC_BattMaster_Off () ipc.writeLvar("L:OHD_DC_CNTRL_PNL_MASTER_SW", 0) --DspShow ("Batt", "off") end function DC_BattMaster_toggle () if ipc.readLvar("L:OHD_DC_CNTRL_PNL_MASTER_SW") == 0 then DC_BattMaster_On () else DC_BattMaster_Off () end end function DC_All_Batteries_On () ipc.lineDisplay("All BATTERY Switches turning ON") ipc.sleep(3000) DC_BattMaster_On () ipc.sleep(300) DC_MainBatt_On () ipc.sleep(300) DC_AUXBatt_On () ipc.sleep(300) DC_StbyBatt_On () end function DC_All_Batteries_Off () ipc.lineDisplay("All BATTERY Switches turning OFF") ipc.sleep(3000) DC_StbyBatt_Off () ipc.sleep(300) DC_AUXBatt_Off () ipc.sleep(300) DC_MainBatt_Off () ipc.sleep(300) DC_BattMaster_Off () end function DC_All_Batteries_Toggle () if ipc.readLvar("L:OHD_DC_CNTRL_PNL_MASTER_SW") == 0 then DC_All_Batteries_On () else DC_All_Batteries_Off () end end DC_All_Batteries_Toggle () return
Create an account or sign in to comment