It is currently April 20th, 2024, 1:44 am

Confusion with ActionTimer and IfCondition

Get help with creating, editing & fixing problems with skins
BrrDoesRainmeter
Posts: 7
Joined: July 30th, 2020, 10:16 pm

Confusion with ActionTimer and IfCondition

Post by BrrDoesRainmeter »

Hey all!

I may be in way over my head here but I've been trying to make an image that "Expands" on MouseOverAction/MouseLeaveAction or LeftMouseUpAction (dependant on what works best). I'm pretty new to rainmeter so apologies if I'm missing some major concepts here as to why I'm not getting the intended effect.

So far I have some images ontop of the larger image that function as icons, though I'd like to make them fade in with the same MouseOverAction or LeftMouseUpAction as the one that changes position of all the images. I currently have the variable that controls the position of everything being changed with the ActionTimer plugin. That works! What doesn't work though, is my attempt to change the variable that controls the alpha value for some of the images to get the desired fade effect.

Thanks in advance for any help!

This is what I've got so far:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
U=[!UpdateMeasureGroup Sliders][!UpdateMeterGroup Sliders][!Redraw]
W=10
Offset=-190
SlideAmount=10
NormalColor= 255,255,255,#Alpha#
HoverColor=255,255,255,75
PalletColor=45,32,228,255,255
Aplha=1
FadeAmt=25

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Open,#W#,20
ActionList2=Repeat Close,#W#,20
ActionList3=Repeat FadeIn,#W#,20
ActionList4=Repeat FadeOut,#W#,20
Open=[!SetVariable Offset "(Clamp(#Offset#+#SlideAmount#,-190,0))"]#U#
Close=[!SetVariable Offset "(Clamp(#Offset#-#SlideAmount#,-190,0))"]#U#
FadeIn=[!SetVariable Alpha "(Clamp(#Alpha#+#FadeAmt#,1,255))"]#U#
FadeOut=[!SetVariable Alpha "(Clamp(#Alpha#-#FadeAmt#,1,255))"]#U#
IfCondition=#Offset# = -190
IfTrueAction=[!SetOption MeterPanel LeftMouseUpAction """[!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"]"""]
IfCondition2=#Offset# = 0
IfTrueAction2=[!SetOption MeterPanel LeftMouseUpAction """[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Execute 2"]"""]
IfCondition3=#Offset# >= -189 
IfTrueAction3=[!CommandMeasure MeasureSlider "Stop 4"][!CommandMeasure MeasureSlider "Execute 3"]
IfCondition4=#Offset# <= 0
IfTrueAction4=[!CommandMeasure MeasureSlider "Stop 3"][!CommandMeasure MeasureSlider "Execute 4"]
DynamicVariables=1

[MeterPanel]
Meter=Image
Group=Sliders
Y=(0 + #Offset#)
W=176
H=250
SolidColor=#PalletColor#
DynamicVariables=1

[MeterKovaaksContainer]
Meter=Image
Group=Sliders
ImagePath=C:\Users\Imort\Documents\Rainmeter\Skins\Dynamic-Objects\@Resources\Images\Icons
ImageName=BackgroundIcon.png
ImageTint = #NormalColor#
W=150
H=45
X=13
Y=(195 + #Offset#)
MouseOverAction=[!SetOption #CURRENTSECTION# ImageTint #HoverColor#][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageTint #NormalColor#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction="steam://rungameid/824270"
DynamicVariables=1

[MeterKovaaks]
Meter=Image
Group=Sliders
ImagePath=C:\Users\Imort\Documents\Rainmeter\Skins\Dynamic-Objects\@Resources\Images\Icons
ImageName=KovaaksW.png
ImageTint=255,255,255,200
H=67
X=54
Y=(186 + #Offset#)
AntiAlias=1
DynamicVariables=1
Last edited by Brian on August 15th, 2020, 4:37 am, edited 1 time in total.
Reason: Please use [code] tags. It's the </> button.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Confusion with ActionTimer and IfCondition

Post by mak_kawa »

Hi BrrDoesRainmeter

You mistyped the variable name "Alpha" as "Aplha" in the Variables section.
So, because the variable #Alpha# is missing, numerous syntax errors have occurred as seen in the Log dialog.
BrrDoesRainmeter
Posts: 7
Joined: July 30th, 2020, 10:16 pm

Re: Confusion with ActionTimer and IfCondition

Post by BrrDoesRainmeter »

Oh wow that explains a lot... I feel like every time I post here the answer is that I screwed up syntax lol

:Whistle
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Confusion with ActionTimer and IfCondition

Post by mak_kawa »

Hi BrrDoesRainmeter and all

Following is an useless/meaningless post at all, but I can't resist such terrific temptation from what I saw...:-)

In your original code, the variable #Alpha# is missing. So in the first update, variable #Alpha# is set to something *string* as (Clamp(#Alpha#+#FadeAmt#,1,255)), and this can't be resolved as a numeric formula with syntax error. What will happen in the next update? the string #Alpha# is inserted to #Alpha# itself nestedly as (Clamp((Clamp(#Alpha#+#FadeAmt#,1,255))+#FadeAmt#,1,255)). And so on... In my actual log, finally generated formula is...

Code: Select all

(Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp((Clamp(#Alpha#-25,1,255))-25,1,255))-25,1,255))-25,1,255))-25,1,255))-25,1,255))-25,1,255))-25,1,255))-25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25,1,255))+25
Disaster/catastrophe!! :-)
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Confusion with ActionTimer and IfCondition

Post by balala »

BrrDoesRainmeter wrote: August 15th, 2020, 7:29 am Oh wow that explains a lot... I feel like every time I post here the answer is that I screwed up syntax lol
Such an issue can be easily found if you're taking a look to the Log (which is a good friend of the coder).
BrrDoesRainmeter
Posts: 7
Joined: July 30th, 2020, 10:16 pm

Re: Confusion with ActionTimer and IfCondition

Post by BrrDoesRainmeter »

Oh god that is an absolute catastrophe O.O
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Confusion with ActionTimer and IfCondition

Post by balala »

BrrDoesRainmeter wrote: August 15th, 2020, 7:17 pm Oh god that is an absolute catastrophe O.O
What is a catasthrophe?
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Confusion with ActionTimer and IfCondition

Post by Yincognito »

balala wrote: August 15th, 2020, 7:22 pm What is a catasthrophe?
His Rainmeter log?! :lol:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Confusion with ActionTimer and IfCondition

Post by balala »

Yincognito wrote: August 15th, 2020, 7:32 pm His Rainmeter log?! :lol:
Yep, the Log in many cases can be a catastrophe!
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Confusion with ActionTimer and IfCondition

Post by Yincognito »

balala wrote: August 15th, 2020, 7:36 pm Yep, the Log in many cases can be a catastrophe!
An even bigger catastrophe is when the Log is nice and clean but the code just doesn't work the way it's suppose to. It means you have to find the needle in the haystack yourself... :sly:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth