Hoveruser
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by Hoveruser
-
-
Hello all -
P3D v4.2 Fsuipc 5.124 Registered
FSUIPC5.Joyscan.csv see file attached
Fsuipc.ini file attached
Log file attachedI 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
Lua event.button syntax
in FSUIPC Support Pete Dowson Modules
Posted
Doh - I new it had to be something basic. Thank you Peter and NO you are not a lousy teacher but I will persevere with lua.org
kind regards
Gordon