You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I put a LUA script in SCRIPTS/FUNCTIONS folder
I make it run via "special functions" "Lua Script" action and put it behind a switch.
In the companion, the lua script is executed only once
On the taranis X9D+ running Edge TX v2.8.0 this is run twice.
On the Logical switches screen on the taranis, the Logical switch is only blinking on and off.
Tried to put it behind a logical switch or behind an edge switch, same behaviour, always run twice on the taranis X9D+, only runs once in the companion
Expected Behavior
Should only run once on the TaranisX9D+ and the behavior should be consistent between taranis and companion
Steps To Reproduce
put simple lua script ( playsound ) in functions folder
create logical switch that goes on for 0.1 second after a switch is down
create special function that is activated on logical switch, action is the Lua Script
Just a simple script with "playFile" will expose the issue
Version
2.8.0
Transmitter
FrSky X9D+
Anything else?
No response
The text was updated successfully, but these errors were encountered:
stephendevelop
changed the title
Lua function script run twice on X9D+ works correctly in Companion
Lua function script always runs twice on X9D+ works correctly in Companion
Mar 8, 2023
Lua scripts are run every 50ms.
Your logical switch is on for 100ms (0.1s) so the script in the special function can run twice before the switch turns off.
On my Mac, the simulator will sometimes run the script twice.
The 'play script' special function should probably have the '1x' repeat functionality implemented to handle this case.
Maybe there's a better way to implement what I want to achieve:
What I want to achieve, is a LuaScript that plays one track and then increment a counter, on every flip of the momentary switch.
So that every time I flip the momentary switch, the next track is played
I want to use this to play the F3A pattern figures one by one.
You can perfectly make a function that only runs once bases on a variable déclarée outside thé function to check if it has run already. Search upvalues lus on Google.
Is there an existing issue for this problem?
What part of EdgeTX is the focus of this bug?
Transmitter firmware
Current Behavior
I put a LUA script in SCRIPTS/FUNCTIONS folder
I make it run via "special functions" "Lua Script" action and put it behind a switch.
In the companion, the lua script is executed only once
On the taranis X9D+ running Edge TX v2.8.0 this is run twice.
On the Logical switches screen on the taranis, the Logical switch is only blinking on and off.
Tried to put it behind a logical switch or behind an edge switch, same behaviour, always run twice on the taranis X9D+, only runs once in the companion
Expected Behavior
Should only run once on the TaranisX9D+ and the behavior should be consistent between taranis and companion
Steps To Reproduce
Just a simple script with "playFile" will expose the issue
Version
2.8.0
Transmitter
FrSky X9D+
Anything else?
No response
The text was updated successfully, but these errors were encountered: