Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Documentation for the Lua control function in MobiFlight seems to be a bit thin, I only found this: https://www.mobiflight.com/forum/message/10232.html

It is lacking the LuaValue function.

I have found that alternating turns of the encoders for MHz and kHz "unfreezes" the frequencies and they do advance instead of just moving one notch back or one notch forth,

I could not assert it through the error logging (problably, because it is not an error), but the reason might be that if turning to increase the value, the feed value is set to N. And when increasing further, the same feed value is being sent.

Event.param, if I have understood it correctly, monitors if the value changes. But this is not the case when the same value is being sent.

By the way, I am monitoring both offsets 0x0D6C and 0x0D70, and the feed value is shown only in 0x0D6C.

I have tried to adapt the script to "event.offset" so 0x0D6C is monitored and the script is run when it changes, but this also does not help, because if a turn in let's say the right direction always sends 10, then the offset or the param does not change.

I have also tried to reset 0x0D6C to 0 after every input, but it does not work, yet. I will keep trying.

Posted
14 minutes ago, shorthauler said:

Documentation for the Lua control function in MobiFlight seems to be a bit thin, I only found this: https://www.mobiflight.com/forum/message/10232.html

It is lacking the LuaValue function.

Yes, as is the FSUIPC offset documentation for offset 0x0D70 (which is where that comes from). As I said, this is an omission error but it works - as I keep saying, you MUST use LuaValue, and not just Lua.  Please read the FSUIPC offset documentation if using FSUIPC offsets (via MobiFlight).

14 minutes ago, shorthauler said:

I have found that alternating turns of the encoders for MHz and kHz "unfreezes" the frequencies and they do advance instead of just moving one notch back or one notch forth,

But using what - Lua or LuaValue?

14 minutes ago, shorthauler said:

I could not assert it through the error logging (problably, because it is not an error), but the reason might be that if turning to increase the value, the feed value is set to N. And when increasing further, the same feed value is being sent.

It is not error logging (errors are always logged), but debug logging you need. This will show you every line executed in the lua script. 

14 minutes ago, shorthauler said:

Event.param, if I have understood it correctly, monitors if the value changes. But this is not the case when the same value is being sent.

 Event.param does not monitor for value changes, but is called whenever LuaValue is called on the script, using the parameter provided, which when called via 0x0D70 will be the value in 0x0D6C.

14 minutes ago, shorthauler said:

I will keep trying.

The ONLY thing you need to try is using LuaValue to call the script.

 

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.