Would this work with Prosim737

A how-to is an informal, often short, description of how to accomplish some specific task (Wikipedia)
Post Reply
User avatar
portanav
Posts: 1325
Joined: 25 May 2013, 09:28
Location: Port-of-Spain, Trinidad & Tobago (TTPP)
Contact:

Would this work with Prosim737

Post by portanav » 05 Jul 2019, 13:30

Can someone knowledgeable with .LUAs tell me if this will work with Prosim737?

It is supposed to cause an engine failure if flying in heavy rain and not having your ignition on 'continuous' or 'auto'. I've tried it in heavy rain and also icing conditions without success.

Thanks.

LUA
  • -------------------------------------------------------------------
    -- FS Lua plug-in for 737Cockpit --------------------------------
    -------------------------------------------------------------------

    --HEAVY-RAIN

    fsRain = ipc.readUB(0x04CB)
    fsRainType = ipc.readUB(0x04CC)
    fsStartFlag1 = ipc.readUW(0x0894)
    fsStartFlag2 = ipc.readUW(0x092C)
    ManEngStart1 = ipc.readUB(0x5610) -- this is your starter switch 1
    ManEngStart2 = ipc.readUB(0x5611) -- this is your starter switch 2
    Eng1Fail = ipc.setbitsUB(0x0B6B, 1) -- stop your engine 1
    Eng2Fail = ipc.setbitsUB(0x0B6B, 2) -- stop your engine 2


    function HEAVYRAIN(off, val)

    heavy = (fsraintype ~= 0) and (val > 3)
    neverknow = math.floor(math.random(1,62000))

    if ipc.readUW(0x0366) == 0 then -- fsonground = 0

    if (ManEngStart1 == 2) or (ManEngStart1 == 3) then
    ipc.clearbitsUB(0x0B6B, 1) -- Eng1Fail
    else
    eng1fail = ((neverknow == 20) and (heavy == 1))
    end

    if (ManEngStart2 == 2) or (ManEngStart2 == 3) then
    ipc.clearbitsUB(0x0B6B, 2) -- Eng1Fail
    else
    eng2fail = ((neverknow == 22) and (heavy == 1))
    end

    if fsstartflag1 == 0 then
    ipc.clearbitsUB(0x0B6B, 1) -- Eng1Fail
    end
    if fsstartflag2 == 0 then
    ipc.clearbitsUB(0x0B6B, 2) -- Eng1Fail
    end
    end
    end

    event.offset(0x04CB, "UB", "HEAVYRAIN") -- fsRain UB(0x04CB)


    --==================================================================
    --==================================================================

    --//////////////////////////////////////////////////////////////////////
    --// No-Continuous - if there is rain or other precip. and your starter
    --// SW is NOT in Cont your engine might stop sooner or later
    --//////////////////////////////////////////////////////////////////////

    AntiIceSw1 = ipc.readUB(0x5612)
    AntiIceSw1 = ipc.readUB(0x5613)

    function NoContinuous(off, val)

    neverknow2 = math.floor(math.random(1,88000))

    if ((val == 1) and (ManEngStart1 ~= 2)) and (fsRain > 2) then
    eng1fail = (neverknow2 == 36)
    else
    ipc.clearbitsUB(0x0B6B, 1) -- Eng1Fail
    end

    if ((AntiIceSw2 == 1) and (ManEngStart2 ~= 2)) and (fsRain > 2) then
    eng2fail = (neverknow2 == 35)
    else
    ipc.clearbitsUB(0x0B6B, 2) -- Eng2Fail
    end

    end

    event.offset(0x5612, "UB", "NoContinuous") -- AntiIceSw1

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

    -- end
Regards,
Michael :)
Image

Image

Post Reply

Return to “ProSim737 - How-tos”