Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello Pete. I am curious about the KillAll function. I have looked through the documents and forums in an attempt to learn more about it but it seems to escape my queries. Is it an actual lua file that I write up for the lua files I have in my modules folder or is it built into FSUIPC4? I apologize for my ignorance on this. 

Thanks

Roger

Posted
50 minutes ago, WB_FlashOver said:

I am curious about the KillAll function. I have looked through the documents and forums in an attempt to learn more about it but it seems to escape my queries. Is it an actual lua file that I write up for the lua files I have in my modules folder or is it built into FSUIPC4

Oh dear. It's an assignable control, called LuaKillAll,  and, just like Lua, LuaKill, LuaSet,, LuaClear, LuaToggle and LuaValue, it is clearly listed in the assignable controls drop down for Keys and Buttons.

As stated in the Installation and Registration document, found in the FSUIPC download ZIP, the FSUIPC Lua documentation is in your FSUIPC Documents folder (inside the FS Modules folder). Have you never looked there? The information about the added controls is provided on the very first page, the introductory part entitled "What is provided in FSUIPC for Lua programming".

Pete

 

Posted

Hello Pete, 

Yes, I'm familiar with the assignable controls within FSUIPC to run/kill/etc lua files. I actually have several already assigned to run/kill lua files to use a single rotary axis on my X52 Pro to control 'independently' the Heater, Windows, Turbo and Inter-coolers in my A2A B-17. My question was not clear now that I read it again. I've seen topics about assigning a KillAll under the [Auto.xxx] section in the FSUIPC4.ini file such as below. 

[Keys.B17]
18=38,8,L5:R,0     -{Up: Press=Lua A2AB17_Turbo }-
20=38,10,L5:K,0     -{ctl+Up: Press=LuaKill A2AB17_Turbo (Flag 0) }-
22=37,8,L6:R,0     -{Left: Press=Lua A2AB17_Windows }-
24=37,10,L6:K,0     -{ctl+Left: Press=LuaKill A2AB17_Windows (Flag 0) }-
26=40,8,L3:R,0     -{Down: Press=Lua A2AB17_Heater }-
28=40,10,L3:K,0     -{ctl+Down: Press=LuaKill A2AB17_Heater (Flag 0) }-
30=39,8,L4:R,0     -{Right: Press=Lua A2AB17_IntCool }-
32=39,10,L4:K,0     -{ctl+Right: Press=LuaKill A2AB17_IntCool (Flag 0) }-
33=75,8,L22:R,0     -{K: Press=LuaKillAll }-

[Auto.B17]
1=Lua KillAll
2=Lua A2AB17_Turbo

So, my question is about this command under the auto section. 

Thanks again, Roger

Posted
9 hours ago, WB_FlashOver said:

[Auto.B17]
1=Lua KillAll
2=Lua A2AB17_Turbo

So, my question is about this command under the auto section. 

"Lua KillAll" would look for a Lua plug-in called KillAll.lua and run it. I've no idea what that Lua contains as I've never seen one named that way, but if you really need to Kill all running plug-ins then you'd either need to invoke a macro which executes the LuaKillAll control. or, yes, usa a plug-in to send that control in the KillAll plug-in, i.e. using:

ipc.control(1084)

(The 1084 is from the list of FSUIPC additional control numbers in the Advanced Users guide).

Mind you, I've not tried it and I'm not quite sure what would happen if a Lua plug-in tried to murder itself in such a fashion.

However, all profile-specific Lua plug-ins are automatically closed when you change profiles, so this action is only really acting on plug-ins loaded by the generic [Auto] section.

This line is interesting:

Quote

33=75,8,L22:R,0     -{K: Press=LuaKillAll }-

I'd like to see the LuaFiles list, to see what entry 22 is -- I assume it is KillAll as well, but then I don't understand why there's no space in the FSUIPC-added annotation between "Lua" and "KillAll". It's definitely a Lua "Run" assignment as shown by the 'R'.

Here's my entry for the keypress I use to kill all plug-ins:

2=49,24,1084,0     -{tab+1: Press=LuaKillAll }-

Pete

 

Posted

Ok, thanks Pete. It makes a little more sense to me now. I knew about the 1084 command but was unsure if killing "ALL" lua's was a good idea so I wrote one to test and that is where the incorrect line came from. I was still messing with it while writing my post and copied and pasted the lines prior to finishing with my testing. And yes, hand editing the ini file, scary huh?

In reality, it sounds to me like there isn't a need for a killall command in the [Auto.xxx] as they are already terminated at profile change anyways and I don't actually have a generic [Auto] section. 

I love the program (wish I could get me head around it better) and thank you for your continued support.

Roger

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.