Hi,
what's the best practice to spoof reads of an offset variable?
Some fixed gear planes report always "gear down" and I don't want the gear down indicator on my panel lit when using those planes, so at the moment I have the following in the profiles' lua of the affected planes:
function spoof_gear(t)
ipc.writeStruct(0x0024, "1UW", 0x0BEC, "1UW", 2, "1UW", 0)
ipc.writeStruct(0x0024, "1UW", 0x0BF0, "1UW", 2, "1UW", 0)
ipc.writeStruct(0x0024, "1UW", 0x0BF4, "1UW", 2, "1UW", 0)
end
function cleanup()
ipc.writeStruct(0x0024, "1UW", 0x0BEC, "1UW", 0)
ipc.writeStruct(0x0024, "1UW", 0x0BF0, "1UW", 0)
ipc.writeStruct(0x0024, "1UW", 0x0BF4, "1UW", 0)
end
event.timer(1000, "spoof_gear")
event.terminate("cleanup")
I found offset 0x0024 and its usage in the offset list and I'm not sure if using a timer there is the best way, but the spoofed values always reset after a few seconds. I know there is event.offset that fires when an offset changes, is there also an event that fires on an offset read where you could spoof the read result? In the documentation I didn't see something like that...
jaxx