jaxx 5 Posted June 18, 2020 Report Share Posted June 18, 2020 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 Quote Link to post Share on other sites
John Dowson 129 Posted June 20, 2020 Report Share Posted June 20, 2020 On 6/18/2020 at 11:55 AM, jaxx said: 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... No, there is no such function. You are probably better off using a user offset to drive your gear light indicator (e.g. starting offset 66C0). You could have a lua script that simply copies the gear offsets (0BEC, OBF0, 0BF4) to this area if gear is retractable (offset 060C), or otherwise writes 0. John Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.