flatdog Posted April 23, 2012 Report Posted April 23, 2012 Dear Pete, In Lua scripts I have seen offsets (Pitot Heat in this case) referred to for example as: event.offset(0x029C, ...................... and event.offset("029C", ...................... Does one have an advantage over the other or does it simply not matter? Thank you, Philip
Pete Dowson Posted April 23, 2012 Report Posted April 23, 2012 Does one have an advantage over the other or does it simply not matter? Doesn't really matter. Either way it's being converted to a binary number. Te most efficient way is possibly the one you've not mentioned, decimal: Hex 029C is decimal 668. so "event.offset(668, ..." would do the same. But I'd defy you to measure any actual difference in practice. Regards Pete
NedHamilton Posted April 23, 2012 Report Posted April 23, 2012 I'm not familiar with Lua scripting but why can't you use varlables like: var LandingGearLights = 0x29C and then in the code use: event.offset(LandingGearLights) (I know offset 0x29C isn't really landing gear lights).
Pete Dowson Posted April 23, 2012 Report Posted April 23, 2012 I'm not familiar with Lua scripting but why can't you use varlables like: and then in the code use: event.offset(LandingGearLights) Of course you can. You don't declare varaibles, though, just set them, like "LandingGearLights = 0x29C" or "local LandingGearLights = 0x29C" if you want to restrict that to within a function or code block. I don't publish a Lua language guide, only the documentation for the libraries added by FSUIPC and WideClient. The full documentation and assorted tutorials are available on the Lua website or in books you can purchase, as with other languages. Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now