Jump to content
The simFlight Network Forums

FSUIPC Pull Down Commands from Lua Script


Recommended Posts

Hi Pete, Just a quick question.

 

I understand how to call the pulldown items with their associated control number using the ipc.control(n) and ipc.control(n, param) from within a Lua script, but is there a way to call them by their descriptive pulldown name.

 

For example if I wanted to call (Zoom In) and (Zoom Out) from Lua, Can I do something like ipc.macro("Zoom In") or ipc.macro("Zoom Out")

 

I have tried this using the macro command but it doesn't seem to work, However it does not say in the manual that it would do that, I was just thinking that the pulldown items might have been like a macro in nature.

 

Anyhow have I missed something or is the only way to do this via the ipc.control(n) command, It would be a nice feature to be able to call them from Lua by descriptive names. 

 

Regards Glenn. 

 

Link to comment
Share on other sites

I understand how to call the pulldown items with their associated control number using the ipc.control(n) and ipc.control(n, param) from within a Lua script, but is there a way to call them by their descriptive pulldown name.

 

For example if I wanted to call (Zoom In) and (Zoom Out) from Lua, Can I do something like ipc.macro("Zoom In") or ipc.macro("Zoom Out")

 

You#d need to define variables with those names, then use those. for instance:

 

ZoomIn = 65655

Zoomout = 65656

 

To have this pre-set for you in Lua for all 500-600 controls would take an extra 20k or more of stack space for each and every Lua plug-in running even if they used none of them. To do it using string names and have these looked up in a table could work okay but would be a lot slower. I'm really not sure it is worth it, especially since you'd usually need to look up the precise names in any case -- one character wrong and it would fail -- so if you are checking that from the document supplied you might as well use the number alongside it.

 

Regards

Pete

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.