As mentioned by balala, your IfCondition continually change the variable from -2 to 2 in a continuous loop.After four hours of struggling to implement my first(and only necessary) feature which involves some IF's - i have to admit that i failed.
Tell me please why my simple toggle do not working:I mean it works sometimes if swap things around, but only for first keypress, and then it stays even if i refresh skin. This is all so confusing and unintuitive for newbies...Code:
[Variables]KeyToFront = 0x83Zval = -2[Launcher2]Measure=PluginPlugin=HotKeyHotKey=#KeyToFront#DynamicVariables=1IfCondition=Zval = 2IfTrueAction=[!SetVariable Zval "-2"]IfFalseAction=[!SetVariable Zval "2"]KeyDownAction=[!ZPos #Zval#][!Redraw]
It appears you want to change the Z-position of the skin using the variable #ZVal#.
If that is correct, then I would suggest moving the IfCondition to a separate Calc measure that is not updated by the skin's update rate.
Set that measure to never update after loading by setting the UpdateDivider on that measure to UpdateDivider=-1.
This example will change the z-position of a 100x100 square meter each time the F12 key is pressed (I don't have a F20 key; 0x83).
Code:
[Variables]; F20 Key? I use F12 (0x7B)KeyToFront = 0x7BZval = -2[Launcher2]Measure=PluginPlugin=HotKeyHotKey=#KeyToFront#KeyDownAction=[!UpdateMeasure Status][Status]Measure=CalcFormula=#Zval#IfCondition=#Zval#=2IfTrueAction=[!SetVariable Zval "-2"][!ZPos "[#Zval]"][!Redraw]IfFalseAction=[!SetVariable Zval "2"][!ZPos "[#Zval]"][!Redraw]UpdateDivider=-1DynamicVariables=1[MeterImage]Meter=ImageImageName=X=0Y=0W=100H=100SolidColor=0,0,0,100
Statistics: Posted by eclectic-tech — Yesterday, 9:20 pm