Help with If and !SetVariable
Posted: November 18th, 2017, 12:57 am
Hello, guys,
I hope you can help me.
I have written a meter that can be extendet in two ways. (by click)
But when you open both things at the same time, they overlap.
So I wanted to write an if statement that if both meters are open, a
variable changes so that they are again next to each other.
I would like to show and explain my code:
cpuHidden is a variable that =1 if the meter"CPU" is closed.
Analogously ramHidden with the meter "RAM".
cpuHiddenPositionX is the x-variable of the CPU meter(by default "#monitorWidth#-420" (just like the RAM window)
But with "cpuHiddenPositionX=#monitorWidth#-620" the windows wouldn't overlap any more
Now here's my code:
The if statement and how I call it and a example meter to draw:
//If
[iMoveCPU]
IfCondition = (ramHidden = 0)
IfTrueAction = [!SetVariable "cpuHiddenPositionX" "(#monitorWidth#-620)"][!Redraw]
IfFalseAction = [!SetVariable "cpuHiddenPositionX" "(#monitorWidth#-420)"][!Redraw]
Disabled = 1
//Call
LeftMouseDownAction = [!ToggleMeterGroup "HiddenCPU"],[iMoveCPU]
// one meter with cpuHiddenPositionX as variable
[pCPU0]
Meter = String
Group = HiddenCPU
MeasureName = mCPU0
MeterStyle = Style01
Text = "Core #0: %1%"
y = #cpuHiddenPositionY#
x = #cpuHiddenPositionX#
Hidden = 1
DynamicVariables = 2
I have no idea why it doesn't work please help me
I hope you can help me.
I have written a meter that can be extendet in two ways. (by click)
But when you open both things at the same time, they overlap.
So I wanted to write an if statement that if both meters are open, a
variable changes so that they are again next to each other.
I would like to show and explain my code:
cpuHidden is a variable that =1 if the meter"CPU" is closed.
Analogously ramHidden with the meter "RAM".
cpuHiddenPositionX is the x-variable of the CPU meter(by default "#monitorWidth#-420" (just like the RAM window)
But with "cpuHiddenPositionX=#monitorWidth#-620" the windows wouldn't overlap any more
Now here's my code:
The if statement and how I call it and a example meter to draw:
//If
[iMoveCPU]
IfCondition = (ramHidden = 0)
IfTrueAction = [!SetVariable "cpuHiddenPositionX" "(#monitorWidth#-620)"][!Redraw]
IfFalseAction = [!SetVariable "cpuHiddenPositionX" "(#monitorWidth#-420)"][!Redraw]
Disabled = 1
//Call
LeftMouseDownAction = [!ToggleMeterGroup "HiddenCPU"],[iMoveCPU]
// one meter with cpuHiddenPositionX as variable
[pCPU0]
Meter = String
Group = HiddenCPU
MeasureName = mCPU0
MeterStyle = Style01
Text = "Core #0: %1%"
y = #cpuHiddenPositionY#
x = #cpuHiddenPositionX#
Hidden = 1
DynamicVariables = 2
I have no idea why it doesn't work please help me