Jump to content
The simFlight Network Forums

Lua script for light management


codatcri

Recommended Posts

Hello,

I want to manage the lights increasing and decreasing with a lua script that  reads the current parameter status (let's say 40 in the example attached) and then when i press the increase button it decreases by steps of 5

Any idea?

As you can clearly imagine I'm not a lua script expert!

image.png.bd0f6600293580a77bb8c35bccd137b9.png

Link to comment
Share on other sites

The first thing you need to determine is what to read to hold the current panel lights setting/value. I don't think there is a standard simvar (or FSUIPC offset) for this - just a flag to indicate if on or off. Try listing lvars to see if there is an lvar that holds this value - if there is, and it is writeable/settable, then you can add that lvar to an fsuipc offset and simply use the offset increment/decrement controls - no need for lua.
What aircraft are you using? I could take a look, but it may take me a day or two - just back from holiday so it will take me a few days to get through the backlog of support requests. If you can let me know which aircraft you are using I can take a look and advice further.

John

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.