Jump to content

Recommended Posts

Posted

there is no custom command to map.

you have to use a plugin or script to assign your button to write/manipulate the apu dataref "ixeg/733/apu/apu_start_switch_act"

all custom commands and datarefs are documented under the aircraft doc folder "2. interface guide.pdf"

 

  • 10 months later...
Posted
On 23/06/2016 at 5:32 AM, mmerelles said:

there is no custom command to map.

you have to use a plugin or script to assign your button to write/manipulate the apu dataref "ixeg/733/apu/apu_start_switch_act"

all custom commands and datarefs are documented under the aircraft doc folder "2. interface guide.pdf"

 

Can someone show an example of such script? (Lua) I have added some hardware switches but do not know how to read their state and how to manipulate datarefs.

Posted

Here's a very simple LUA script which will create a custom command which can be mapped to a single hardware switch/button to toggle the APU switch from off to start and back to off.If you have a 3 position switch then you'll have to modify the script to have 3 commands instead of one... one command for each APU switch position.

Have a look at the attached script... it's really easy once you know how to use it. I did add some comments in the script to explain what I'm doing.

Ask if you need help.

ixeg_apu.lua

  • Upvote 1
Posted

Thanks a lot, Jean! Everything looks self explanatory except `create_command` function. Where can I find API reference? I'm curious about last two parameters and why function call is inside double-array (if it is double-array).

Posted

Hi Andrey,

As far as I know there is some documentation under the FlyWithLUA folder under Resources\plugins... not 100% sure as I'm not at my home pc right now.
You can also get it from Github... https://github.com/X-Friese/FlyWithLua

In short here are the paramaters required for create_command() function...
create_command(string unique_command_name, string command_description, string lua_code_to_execute_once_when_command_starts, string lua_code_to_execute_when_button_key_is_held_down, string lua_code_to_execute_when_command_ends)

So paramaters 3, 4 and 5 will execute LUA code when button pressed initially (3), then when button is held down(4), and lastly when button is released(5).

Note that all paramaters must be text surrounded by quotes... I think this is the reason why the function call is inside double brackets... it must be a string but it's still a LUA function which needs to be called so in theory it's not just a plain string. This is just a way that LUA handles strings. PS: I'm no LUA expert by any stretch of the imagination. :P

Hope this helps.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...