I'm using FSUIPC to assign keystrokes to a couple of GoFlight modules (RP48 and P8). Specifically, I'm using the RP48 to activate various MCP buttons (LNAV, VNAV, etc) that have been assigned keystrokes via the iFly routine (accessed from the FSX "Add-On" drop-down menu). For example, I've assigned SHF-F7 to activate VNAV. As we all know, the LED won't light up when FSUIPC is used for the button assignment.
I have a rudimentary understanding of how to make the LED turn on via a LUA script. If I understand it, I could have LUA monitor a hex memory address (offset) and, depending on the content of (0 or 1) that address, LUA will turn on the LED.
Using skittles' LUA tutorial, I've come up with what I think the routine might look like:
function VNAV (offset, value) -- Turns on LED #1 on to indicate the VNAV button on the MPC has been pushed
model = GFRP48
unit = 0
id = 0
if value == 1 then
gfd.SetLight(model, unit, id)
else
gfd.ClearLight(model, unit, id)
end
end
event.offset("????", "??", "VNAV")
My question is: how can I establish what the variables for the offset value and string value are? The offset library doesn't have anything for the MCP buttons (VNAV, etc) I've programmed.