Jump to content
The simFlight Network Forums

Hoveruser

new Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Hoveruser

  1. Hello all -

    P3D v4.2 Fsuipc 5.124 Registered
    FSUIPC5.Joyscan.csv see file attached
    Fsuipc.ini file attached
    Log file attached

    I am trying to get my head round Lua functions. To that end I have written a simple chunk to use to understand them, cribbing from the FSUIPC Lua Library I came up with this saved as AA_Function.lua in the modules directory of P3D


    1-- ## Altitude Alert ##########  
    2      
    3    
    4    function ALT_alert_plus(3, 11, 1)  -- joynum, button, downup
    5
    6        AAvalue = ipc.readLvar("Alt_alert_setting")
    7        ipc.writeLvar("Alt_alert_setting", AAvalue+100)
    8   
    9    end
    10    
    11    event.button(3,11,"ALT_alert_plus")

    When called directly from an assigned button (3,11) this fails with the error:
    422294 *** LUA Error: D:\P3D\Prepar3D v4\Modules\AA_Function.lua:4: <name> or '...' expected near '3'

    For reference the Library states:

    Your processing function:
    function-name(joynum, button,downup)

    event.button(joynum, button,“function-name”)

    Clearly I am not understanding the syntax requirements and/or other function processes - could someone please enlighten me or point to a tutorial?

    Looking ahead I will want to run this chunk on a different button/rotary over WideFS The red warning in the event.button library entry indicates this is not possible, on the other hand the associated text indicates the joystick will be seen over widefs. Could you please clear up any misunderstandings I have.

    Many thanks for any response
    Kind regards
    Gordon Hurn

    FSUIPC5.JoyScan.csv

    FSUIPC5.log

    fsuipc5fragment.ini

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.