Hi,
could someone help me please?
I´m trying to write the value from an offset into a Lvar using a lua script in FSUIPC 6.
The task is to monitor an offset, e.g. the battery master switch, and when the value changes, writing the new value into my declarded local variable.
This would be needed for Lorbys Axis and ohs realizing an interactive voice checklist.
Axis and ohs only accepts Lvariables, no offsets. SimVars wouldn´t do as I´m using Project Magenta´s Boeing suite. together with P3Dv5.3
Following script unfortunately won´t do the job:
----------------------------------------------------script---------------------------------
local Battery_on = {}
function Batteryswitch(offset, val)
if value == 1 then
ipc.writeLvar("Battery_on", 1)
else
ipc.writeLvar("Battery_on", 0)
end
end
event.offsetmask(0x281C, 1,"UB","Batteryswitch") --- bit 0
--------------------------------------------------------------------------------------------
What am I doing wrong?
Any help highly appreciated.
Thanks a lot in advance