Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi all.

Would someone be able to explain to me how to code Mobi's orders in Lua scripts ?

Fox example :

1 (>L:LIGHTING_LANDING_1)
0 1 r (>K:2:LANDING_LIGHTS_SET)
1 1 r (>K:2:TAXI_LIGHTS_SET)

First line is :
ipc.writeLvar (LIGHTING_LANDING_1 , 1)
It is OK for me.

 

But I dont understand :
"0 1 r" in RPN ...

This puts "0" in the stack, then "1",then inverse (why not write "1 0" ?), then call Event.

The script would be this  ?

ipc.cpntrol (32768 + 10, 1)
where my first event file has "10 =  TAXI_LIGHTS_SET".

I do not understand why two arguments, and how to pass them in Lua sript.

 

 

 

 

Posted

Why don't you just execute the script:
    ipc.execCalcCode(“1 (>L:LIGHTING_LANDING_1) 0 1 r (>K:2:LANDING_LIGHTS_SET) 1 1 r (>K:2:TAXI_LIGHTS_SET)”)

Or avoid lua altogether and assign to the preset Preset: NOSE LIGHTS TAXI?

Posted

Thank you very much. I did not understand what Calccode did ... I had read the documentation 10 times, and it was still not clear for me. With your example, it seems very simple ...

How do you use the Presets? I don't use Mobi.

 

Posted
Just now, michel78320 said:

How do you use the Presets? I don't use Mobi.

MF presets have been included with FSUIPC7 since v7.2.16 - you do not need to use MobiFlight. The latest version, v7.3.4 (released yesterday) contains the latest MF events.txt file. To use these with FSUIPC7. you need the FSUIPC WASM installed and enabled (which you will have if using lvars), and they are assignable as any other control - in the drop-down menu for assignments.

Please see the Advanced User guide for details on presets, as well as all other functionality provided by the FSUIPC WASM module.

Posted

Very interesting. I will read it all with interest.

Just a clarification : do I need an "xxx.evt " file to use all the possible events (from gauges) with presets ?

Posted
21 minutes ago, michel78320 said:

Just a clarification : do I need an "xxx.evt " file to use all the possible events (from gauges) with presets ?

No. You don't need to use event files any more - they have been superseded by presets.  However, you can still use them if you prefer that method, but you would need to install the MF event module WASM to handle those events. The event files included with FSUIPC7 are also now quite old (and I won't be updating them any more) and not complete (and possibly out-of-date).

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.