Start instrument from LUA code

Help creating logic scripts for Air Manager Instruments

Moderators: Ralph, russ

Post Reply
Message
Author
Shimokuta
Posts: 83
Joined: Wed Feb 03, 2021 12:52 pm

Start instrument from LUA code

#1 Post by Shimokuta »

I am quite busy in here on the forum lately... sorry for that :S

I was wondering if it is possible to start and stop an instrument from LUA code?
What i want to do do i to switch instruments across my sim.
For instance, switch the EICAS instrument with the MFD.
I can of course code the entire logic of the two instruments in one new one and then if a button is pressed disable one and make the other be activated.
But , since i have the instruments allready coded, i wondered if i could program the option available in AM when pressing the lightbulb to activate.

greetings
Roel

User avatar
Keith Baxter
Posts: 3767
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Start instrument from LUA code

#2 Post by Keith Baxter »

Hi,

You can only do that using instrument_get() and or layer_add() in panel scripts.

https://siminnovations.com/wiki/index.p ... rument_get
https://siminnovations.com/wiki/index.p ... =Layer_add

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Shimokuta
Posts: 83
Joined: Wed Feb 03, 2021 12:52 pm

Re: Start instrument from LUA code

#3 Post by Shimokuta »

Hey Keith

That seems to be what i was looking for!

Thanks!

grtz

Shimokuta
Posts: 83
Joined: Wed Feb 03, 2021 12:52 pm

Re: Start instrument from LUA code

#4 Post by Shimokuta »

I did need to search the forum and watch video of panel scripting which i did not know this was an option.
But discovered indeed great new possibilities for doing stuff like this!!

Post Reply