Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HELP: Custom functions and math #13

Open
theonegalen opened this issue Nov 4, 2020 · 1 comment
Open

HELP: Custom functions and math #13

theonegalen opened this issue Nov 4, 2020 · 1 comment

Comments

@theonegalen
Copy link

I'm currently building a StreamdeckXL profile for the F-5E. While trying to set up a streamdeck display for the chaff and flare counts, the tens and ones positions are associated with different DCS IDs. This means I have to use two different buttons for the chaff and flare displays, like this:

https://i.imgur.com/YkFJUSY.png

If I could do something to add those two together, like

[new function number] = ([401]*100)+([402]*10)

Then I could just have my streamdeck display the result. But I have no idea how to do this. I see that at the bottom of the F-5E-3.lua file included with DCS-ExportScripts, there's a section called "custom functions." Is there any way to program that new function in the lua file?

@shugamoe
Copy link

shugamoe commented Nov 17, 2021

Try something like:

local new_number = mainPanelDevice:get_argument_value(401) * 100 + mainPanelDevice:get_argument_value(402) * 10

For an example of a custom function, see line 524 of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants