- Messages
- 58
- Country

GOT iT!!!
This script does what you want it to the spoilers, does not flood (won't continuously set the spoiler ), it also returns the spoilers to their original position if they were above the limit once falling below the restricting speed, if the limiting speed was reached with the spoilers extended past 25 %.
This was more complicated than it should have been.
It was a math issue, this was tricky to figure out.
Spoiler handle position is measured in % and can only be set in values similar to radians " 0 - 16383 ", but don't forget, autospoiler is set at 29 % lever position, so this is really zero for the actual spoilers, so it works out that the ( K : Spoilers Set ) of 7659 = 25 % spoilers extended, before we were setting the spoiler lever pos to 25 %, anything 29 % and down is zero spoilers.
The equation in the macros above is:
16383 / 100 = 163.83
163.83 * 29 = 4751.07 This = 29 % spoilers_set = autospoilers set = 0 % extended.
16383 - 4751.07 = 11631.93 this is your active spoiler zone
11631.93 / 100 = 116.3193 value 1 % of spoiler set
116.3193 * (A:Spoilers Left Position,position) or (A:Spoilers Right Position,position) "no other variables measure actual spoiler position except these" = value of active within spoiler range.
Value of active spoiler in active spoiler range + inactive spoiler value (4751.07) = value you use to set spoiler handle for the desired ( > K : Spoiler_SET )
I could not get the script right in the update when trying to do this without macros. Keeps the update shorter and simpler anyway too so what the hey.
I had this in mind earlier but posted the suggested codes incorrectly upon speculation, with some trial and error I've figured out what actually works. This code in this post is it. Funk Out With the flexibility and possibility of this script "hint", Elaborate... ENJOY
Code:
<Macro id="SpoilerPctToRadiansConversion" Name="SpoilerPctToRadiansConversion">
<MacroValue>@ASZdivby100xPreviousSpoiler @InActiveSpoilerZone +</MacroValue>
<Macro id="ActiveSpoilerZone" Name="ActiveSpoilerZone">
<MacroValue>11632</MacroValue>
</Macro>
<Macro id="ASZdivby100" Name="ASZdivby100">
<MacroValue>@ActiveSpoilerZone 100 /</MacroValue>
</Macro>
<Macro id="ASZdivby100xPreviousSpoiler" Name="ASZdivby100xPreviousSpoiler">
<MacroValue>@ASZdivby100 (L:SPOILERS_POSITION_PREVIOUS,number) *</MacroValue>
</Macro>
<Macro id="InActiveSpoilerZone" Name="InActiveSpoilerZone">
<MacroValue>4751</MacroValue>
</Macro>
</Macro>
<Update id="Update">
<Script>
(A:Spoilers Left Position,position) 0.25 > (A:Spoilers Right Position,position) 0.25 > || (A:AIRSPEED INDICATED,knots) 345 < && if{ (A:Spoilers Left Position,position) (A:Spoilers Right Position,position) + 2 / (>L:SPOILERS_POSITION_PREVIOUS,number) }
(A:Spoilers Left Position,position) 0.25 > (A:Spoilers Right Position,position) 0.25 > || (A:AIRSPEED INDICATED,knots) 345 >= && if{ 7659 (>K:SPOILERS_SET) } (A:Spoilers Left Position,position) 0.25 == (A:Spoilers Right Position,position) 0.25 == || (A:AIRSPEED INDICATED,knots) 345 < && if{ @SpoilerPctToRadiansConversion (>L:SPOILERS_SET,number) (L:SPOILERS_SET,number) (>K:SPOILERS_SET) }</Script>
</Update>
This script does what you want it to the spoilers, does not flood (won't continuously set the spoiler ), it also returns the spoilers to their original position if they were above the limit once falling below the restricting speed, if the limiting speed was reached with the spoilers extended past 25 %.
This was more complicated than it should have been.
It was a math issue, this was tricky to figure out.
Spoiler handle position is measured in % and can only be set in values similar to radians " 0 - 16383 ", but don't forget, autospoiler is set at 29 % lever position, so this is really zero for the actual spoilers, so it works out that the ( K : Spoilers Set ) of 7659 = 25 % spoilers extended, before we were setting the spoiler lever pos to 25 %, anything 29 % and down is zero spoilers.
The equation in the macros above is:
16383 / 100 = 163.83
163.83 * 29 = 4751.07 This = 29 % spoilers_set = autospoilers set = 0 % extended.
16383 - 4751.07 = 11631.93 this is your active spoiler zone
11631.93 / 100 = 116.3193 value 1 % of spoiler set
116.3193 * (A:Spoilers Left Position,position) or (A:Spoilers Right Position,position) "no other variables measure actual spoiler position except these" = value of active within spoiler range.
Value of active spoiler in active spoiler range + inactive spoiler value (4751.07) = value you use to set spoiler handle for the desired ( > K : Spoiler_SET )
I could not get the script right in the update when trying to do this without macros. Keeps the update shorter and simpler anyway too so what the hey.
I had this in mind earlier but posted the suggested codes incorrectly upon speculation, with some trial and error I've figured out what actually works. This code in this post is it. Funk Out With the flexibility and possibility of this script "hint", Elaborate... ENJOY
Last edited:


