Jump to content
The simFlight Network Forums

One permanent .lua file or split?


Recommended Posts

John, I've got a question: What's the better choice? To split code in seperate files like this:

------------ file 1 ----------------------------

function throttle1(offset, value)	
function throttle2(offset, value)	

event.offset (0x25F0, "SW", "throttle1")	
event.offset (0x25F2, "SW", "throttle2")	

------------ file 2 ----------------------------

function mixture1(offset, value)	
function mixture2(offset, value)	

event.offset (0x2550, "SW", "mixture1")	
event.offset (0x2552, "SW", "mixture2")	

Or put everything in one file?


Thank you,


Link to comment
Share on other sites

Either way is fine, its up to your personal preference. Some people like to use separate scripts, others prefer fewer but larger scripts. 

You can also use the same handling function for throttle1 and throttle2 (as well as one for mixture1 and mixture2) and use a conditional statement in the handling function based on the offset value to handle things separately (or set things up separately) for each throttle. But again, thats just personal preference - no problem having separate functions.



Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.