Hi Stuart.
You'll need to be running iFlyFSUIPC software (to integrate the iFLY offsets into FSUIPC)..
Create a file called engine_cutoff.lua in your modules directory and copy/past the following script into it (it toggles the state on/off each time)...
IFLY={
command=0x9400
}
ENGINE_OFFSET={
[1]={
valve=0x0890,
idle=510,
cutoff=511
},
[2]={
valve=0x0928,
idle=513,
cutoff=514
}
}
function engine_cutoff (pi_engine)
if ((nil==pi_engine) or (0==pi_engine)) then
li_engine=1
else
li_engine=pi_engine
end
local l_valve_pos = ipc.readUW(ENGINE_OFFSET[li_engine].valve)
ipc.log (" Engine "..pi_engine.." valve is "..l_valve_pos)
if (0 == l_valve_pos) then
ipc.log (" Switching ON Engine"..pi_engine)
l_valve_cmd = ENGINE_OFFSET[li_engine].idle
else
ipc.log (" Switching OFF Engine "..pi_engine)
l_valve_cmd = ENGINE_OFFSET[li_engine].cutoff
end
l_fsuipc_val = ipc.writeUW(IFLY.command,l_valve_cmd)
end
event.flag("engine_cutoff")
now startup your simulator and go into the FSUIPC menu and assign your buttons to LUA engine_cutoff... if you provide parameter value 2 it will toggle the engine 2 etc..
Hope this helps
Cheers
Gary