Jump to content
The simFlight Network Forums

Recommended Posts

  • 2 weeks later...
Posted

How can I run an external program when loaded a specific airplane?

You'd need to write a small (one-line) Lua plug-in to do this, and have it executed by a profile or aircraft-specific [Auto ...] section in the FSUIPC INI.

Pete

Posted

Thanks for the suggestion.

I have written the single line program, this is the istruction:

handle, error = ext.runif("E:\PROGRA~1\IFLYTO~1.03\IFLYTO~1.EXE")

i used long names and short names but the result is always the same:

128139 LUA.0: Global: handle = 0

128155 LUA.0: Global: error = 2

"file not found" is correct?

i did copy and paste the text string in widows+r and everything works.

Posted

handle, error = ext.runif("E:\PROGRA~1\IFLYTO~1.03\IFLYTO~1.EXE")

i used long names and short names but the result is always the same:

128139 LUA.0: Global: handle = 0

128155 LUA.0: Global: error = 2

"file not found" is correct?

Yes. In strings the \ character is an escape character, so that, for example, \n can be used for "new line". To get a true \ character you need to put \\ each time.

Also, I'm not too sure about those 8-char DOS abbreviated names. They may not work in the normal C library API calls which the Lua interpreter is using.

Pete

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.