michel78320 Posted May 20, 2022 Report Posted May 20, 2022 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.
John Dowson Posted May 20, 2022 Report Posted May 20, 2022 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?
michel78320 Posted May 20, 2022 Author Report Posted May 20, 2022 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.
John Dowson Posted May 20, 2022 Report Posted May 20, 2022 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.
michel78320 Posted May 20, 2022 Author Report Posted May 20, 2022 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 ?
John Dowson Posted May 20, 2022 Report Posted May 20, 2022 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).
michel78320 Posted May 20, 2022 Author Report Posted May 20, 2022 Thank you so much. It is OK ! With "ipc.execCalcCode" I managed to operate all the lights on my V320-OVHD (Overhead from VRInsight) for A320 FBW.
John Dowson Posted May 20, 2022 Report Posted May 20, 2022 1 hour ago, michel78320 said: Thank you so much. It is OK ! With "ipc.execCalcCode" I managed to operate all the lights on my V320-OVHD (Overhead from VRInsight) for A320 FBW. 👍
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