Jump to content
The simFlight Network Forums

Automating GFpower?


Recommended Posts

My apologies if this question has been asked and answered elsewhere.

Is there a way to make the GFpower lua run automatically when the default flight in FSX is loaded?

I found how to assign a spare key to it, and when pressed it works perfectly. Is there a simple way to run it without pressing a key?

Thanks in advance for your assistance.

Reid

Link to comment
Share on other sites

Is there a way to make the GFpower lua run automatically when the default flight in FSX is loaded?

As documented in the Lua documentation (see the FSUIPC documents folder inside your FS Modules folder), the Lua files automatically loaded are ipcInit.lua, which is run right at the beginning of FS, before anything is loaded, and ipcReady.lua which is run when FS is ready to fly. Use the latter. You can either rename your file to ipcReady.lua, or, probably better for future expansion, have an ipcReady.lua file which runs any others you wish, via one statement for each like:

ipc.runlua("GFpower.lua")

Pete

Link to comment
Share on other sites

As documented in the Lua documentation (see the FSUIPC documents folder inside your FS Modules folder), the Lua files automatically loaded are ipcInit.lua, which is run right at the beginning of FS, before anything is loaded, and ipcReady.lua which is run when FS is ready to fly. Use the latter. You can either rename your file to ipcReady.lua, or, probably better for future expansion, have an ipcReady.lua file which runs any others you wish, via one statement for each like:

ipc.runlua("GFpower.lua")

Pete

Pete,

Thanks for your quick response. I renamed the GFpower.lua file in the modules folder. I changed it to ipcReady.lua and it failed to work--then I dropped the .lua from the name and it worked great. Just wanted to document that here, so someone else can search the answer out and not bother you with it.

Would the ipc.runlua("GFpower.lua") statement be the only line in the file named ipcReady.lua if I wanted to do it your recommended way in the future? If so, would that be the exact syntax I would use for that function, and how would I add more lua scripts?

Sorry to be a pain, programming is something I have not done any of since a 20 line BASIC program in an intro to computer science class.

Link to comment
Share on other sites

I changed it to ipcReady.lua and it failed to work--then I dropped the .lua from the name and it worked great. Just wanted to document that here, so someone else can search the answer out and not bother you with it.

something is very seriously wrong on your system if FSUIPC managed to locate and load a Lua program without the "lua" filetype. It sounds like you have Windows hiding filetypes from you or something. FSUIPC searches for All *.Lua files, it will not see any others as Lua.

Would the ipc.runlua("GFpower.lua") statement be the only line in the file named ipcReady.lua if I wanted to do it your recommended way in the future?

Yres, as I said. You could add other RunLua lines to it if you wanted more Lua programs automatically running in future.

If so, would that be the exact syntax I would use for that function, and how would I add more lua scripts?

The exact syntax was exactly as I told you, and i also told you that you could add similar lines! It seems you did not really read my reply! I repeat the relevant part here:

... have an ipcReady.lua file which runs any others you wish, via one statement for each like:

ipc.runlua("GFpower.lua")

Sorry to be a pain, programming is something I have not done any of since a 20 line BASIC program in an intro to computer science class.

It's not exactly "programming" to make a file with one line in it copied from a message as I showed! :-(

Pete

Link to comment
Share on other sites

something is very seriously wrong on your system if FSUIPC managed to locate and load a Lua program without the "lua" filetype. It sounds like you have Windows hiding filetypes from you or something. FSUIPC searches for All *.Lua files, it will not see any others as Lua.

Yres, as I said. You could add other RunLua lines to it if you wanted more Lua programs automatically running in future.

The exact syntax was exactly as I told you, and i also told you that you could add similar lines! It seems you did not really read my reply! I repeat the relevant part here:

... have an ipcReady.lua file which runs any others you wish, via one statement for each like:

ipc.runlua("GFpower.lua")

It's not exactly "programming" to make a file with one line in it copied from a message as I showed! :-(

Pete

Pete,

I assure you I read your reply. Not understanding what your reply was saying is why I asked for clarification.

It is very frustrating as someone trying to learn from scratch how FSUIPC works, to read all of the documentation you have provided, still have questions and be afraid to ask them of you for fear of being berated. I have been working on this problem for literally months and exhausted all of my other options before asking you.

http://www.mycockpit.org/forums/showthread.php/19980-Goflight-Cold-and-Dark?highlight=cold+and+dark

Sorry to have been such a nuisance, you obviously do not suffer fools gladly, and I am an unsufferable fool.

Link to comment
Share on other sites

I assure you I read your reply. Not understanding what your reply was saying is why I asked for clarification.

there wasn't much to understand, just make one file with one line in it, exactly as shown and stated.

It is very frustrating as someone trying to learn from scratch how FSUIPC works, to read all of the documentation you have provided, still have questions and be afraid to ask them of you for fear of being berated.

I really don't know how much more I could possibly have done as well as telling you EXACTLY what to put in the file! how on Earth would you suggest i word it? I don't understand where you are coming from at all!

Sorry to have been such a nuisance, you obviously do not suffer fools gladly, and I am an unsufferable fool.

No comment. ;-)

Pete

Link to comment
Share on other sites

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.