Results 1 to 3 of 3
-
11-09-2011, 07:39 AM #1
How to make a call from SIOC to a LUA function
Hi,
I wonder if it is possible to make a call from SIOC to a LUA function defined in FSUIPC.
I want to call ( execute) a LUA function when I toogle a switch that is defined in SIOC
like:
Var 74 Link IOCARD_SW Input 65 Type I
{
IF v74 = 1
{ call LUA function toggleVORL( or something like this)
}
example of LUA function:
local function toggleVORL(state, unit)
if state == 0 and ipc.readLvar('ngx_switch_358_a') ~= 0 then
ipc.control(69990, -214748364
ipc.control(69990, 52428
ipc.control(69990, -214748364
ipc.control(69990, 52428
elseif state == 1 and ipc.readLvar('ngx_switch_358_a') == 0 then
ipc.control(69990, 536870912)
ipc.control(69990, 131072)
end
else
if state == 0 and ipc.readLvar('ngx_switch_414_a') ~= 0 then
ipc.control(70046, -214748364
ipc.control(70046, 52428
ipc.control(70046, -214748364
ipc.control(70046, 52428
elseif state == 1 and ipc.readLvar('ngx_switch_414_a') == 0 then
ipc.control(70046, 536870912)
ipc.control(70046, 131072)
end
end
end
rgs,
Roar KRoar Kristensen rksoftware www.flightsim4fun.com
Flightsimmer since 1982 (Sinclair Spectrum Sinclair QL, Amiga, PC --16Mhz >>4.4GHz)
-
11-09-2011, 10:23 AM #2
- Join Date
- Apr 2009
- Location
- Toronto
- Posts
- 125
Re: How to make a call from SIOC to a LUA function
Hello Roar.
Not directly, but you could place your arguments in one of FSUIPC's user offsets and use the "intercept" event from the FSUIPC library to drive your LUA script.
Jim
-
12-05-2011, 09:16 AM #3
Re: How to make a call from SIOC to a LUA function
Hi,
Or you could send an FSControl from SIOC to FSUIPC, or toggle one of the FSUIPC Virtual buttons from SIOC, see keygen part, method 2.
regards,
Nico Kaan
Free connections, find your partner with no obligations Real-life Girls Exemplary Сasual Dating
Super Сasual Dating - Verified...