Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hey guys,

I'm trying to get a LUA script to run an external exe program, but it's not working and i'm pretty sure i'm doing something wrong with my extremely limited LUA capabilities.  The program is a simple bat file compiled in an EXE that when opened, runs it's few lines of code and closes automatically, so all I want to do is have a button mapped in FSUIPC that calls on this script that uses the ext.run command to run this file.

Lua script is as follows;

ext.run("c:\panel.exe")

I go into FSUIPC, press the button I want and select Lua Panel from the drop down and would guess that's it...but when pressing the button nothing happens.

What am I missing?

  • 3 months later...
Posted

Hello,
I have got a similar problem - I launched my software from lua file with

handle, error= ext.run("C:\\SIOC.exe, "EXT_KILL")

Sioc starts successfully. But the Parameter "EXT_KILL" has no effect, i.e. SIOC is not terminated after closing FSX. Maybe there is a mistake in Syntax? I got error =-3.

Alternatively, I tried to start sioc directly in fsuipc.ini (last update) via Run command. But this does only work for all aircrafts. I only want to start sioc for PMDG 737 aircrafts. This can only be done for Lua scripts. May be there is another option?

Christoph

Posted

Hello Reinhard,
thank you for quick answering. I am sorry, but this was only a copy and paste error in my post. In my lua script it is correct. There is still the problem with the EXT_KILL parameter. sioc is not terminated after fsx is shut down.

Regards Christoph

 

Posted

Just a hunch,

Shouldn't this be -

handle, error= ext.run("C:\\SIOC.exe", EXT_CLOSE)

The second optional parameter is a string for command line options, after that one could have up to 4 more options, but they do not seem to be strings.
You really shouldn't use EXT_KILL unless EXT_CLOSE doesn't work.. SIOC might not like a forced close, IE time to write saved settings and the like.


Roman

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.