Jump to content

marcgaub

Economy class
  • Posts

    1
  • Joined

  • Last visited

Posts posted by marcgaub

  1. Hi,

    I developped a small LUA script to synchronize the FF A320 Beacon with XP11. You need to have FlyWithLUA installed.

    Create a new textfile with .lua extension in the script folder, and copy the following script inside the file.

    After that, the Jetways  work in automatic mode.

     

     

     

    -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    -- ffa320-beacon.lua            Copy FF320 Beacon Status to XP11 Beacon status - SAM auto mode working

    --                              

    -- VERSION: 1.0.0               Author: Marc GAUB : marc@gaub.lu        

    -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    local DEBUG = 0     -- for debugging

     

    -- Functions --

    function switch_beacon()    

        DataRefID = XPLMFindDataRef("a320/Overhead/LightBeacon");

        if (DataRefID == NULL)  then    

            if (DEBUG == 1) then

                logMsg("A320 Beacon : DATAREF not existing")

            end

        else

            dataref("xp_paused", "sim/time/paused")

            dataref("a320_beacon_lt", "a320/Overhead/LightBeacon")

            dataref("sim_beacon_lt", "sim/cockpit/electrical/beacon_lights_on", "writable")

            if (xp_paused == 0) then

                if (a320_beacon_lt > 0) then

                    if (DEBUG == 1) then

                        logMsg("A320 Beacon : beacon enabled")

                    end

                    sim_beacon_lt = 1

                else

                    if (DEBUG == 1) then

                        logMsg("A320 Beacon : beacon disabled")

                    end

                    sim_beacon_lt = 0

                end

            end

        end

    end

     

    -- Main --

    if (DEBUG == 1) then

        logMsg("A320 Beacon : Start of FlyWithLUA script")

    end

     

    if (AIRCRAFT_FILENAME == "A320.acf") then

        do_often("switch_beacon()")

    else

        if (DEBUG == 1) then

            logMsg("A320 Beacon : Not in the FF A320 cockpit")

        end

    end

     

    • Like 1
×
×
  • Create New...

Important Information

Please read the Terms of Use