Page 2 of 3

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: November 10th, 2014, 6:18 pm
by jsmorley
Krainz wrote:Any ideas on how to make this limit work? For me not even the one that stops it from going negative is working, which should be this one, posted above:

It feels like I'm forgetting something. Maybe DynamicVariables?
Not sure, I assume if you create a skin using exactly my code above, it works?

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: November 10th, 2014, 6:24 pm
by Krainz
Yeah, I always use your exact code to test, and it didn't stop at 0. Did it work for you?

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: November 10th, 2014, 6:25 pm
by jsmorley
Krainz wrote:Yeah, I always use your exact code to test, and it didn't stop at 0. Did it work for you?
It sure does. Make sure you are running a recent version of Rainmeter. I would recommend the latest beta from http://rainmeter.net.

Code: Select all

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

[ClickLeftCounter]
Measure=Calc
Formula=ClickLeftCounter + 1
Disabled=1
UpdateDivider=-1
OnUpdateAction=[!SetOption CurrentX Formula "([CurrentX] + 1)"][!UpdateMeasure CurrentX][!UpdateMeter *][!Redraw]

[ClickRightCounter]
Measure=Calc
Formula=ClickRightCounter + 1
Disabled=1
UpdateDivider=-1
OnUpdateAction=[!SetOption CurrentX Formula "([CurrentX] - 1)"][!UpdateMeasure CurrentX][!UpdateMeter *][!Redraw]

[CurrentX]
Measure=Calc
Formula=0
UpdateDivider=-1
IfCondition=CurrentX < 0
IfTrueAction=[!SetOption CurrentX Formula "0"][!UpdateMeasure CurrentX][!UpdateMeter *][!Redraw]

[MeterImage]
Meter=Image
W=50
H=50
X=[CurrentX]
Y=0
SolidColor=152,235,131,255
DynamicVariables=1

[ShowClicks]
Meter=String
X=0r
Y=0R
FontColor=255,255,255,255
FontFace=Segoe UI
FontSize=17
StringEffect=Shadow
FontEffectColor=0,0,0,255
SolidColor=0,0,0,1
AntiAlias=1
Text=Left: [ClickLeftCounter] Right: [ClickRightCounter] CurrentX: [CurrentX]
DynamicVariables=1
LeftMouseUpAction=[!EnableMeasure ClickLeftCounter][!UpdateMeasure ClickLeftCounter]
RightMouseUpAction=[!EnableMeasure ClickRightCounter][!UpdateMeasure ClickRightCounter]
test.gif

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: November 10th, 2014, 6:48 pm
by Krainz
Yeah, installing the beta version made it work. Thanks! :yahoo:

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: December 20th, 2020, 5:44 am
by mattnicholas
hey.. firstly, thanks for this thread, it helped me a lot in making my own click counter in rainmeter. One last thing that I want to add little animation and design improvements that make the green square where user clicks look like a real button. I saw something exactly same on this click counter I am good with algorithms but not so good with design stuff. Can any of the bright minds here help me with this? Thanks in advance.

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: December 20th, 2020, 4:50 pm
by balala
mattnicholas wrote: December 20th, 2020, 5:44 am I saw something exactly same on this click counter
This is not a Rainmeter skin, right?
mattnicholas wrote: December 20th, 2020, 5:44 am Can any of the bright minds here help me with this?
Since this topic is more than six years old, first please post the exact code you are using. Also let us know what exactly do you want to achieve, because I'm not exactly sure what does this mean:
mattnicholas wrote: December 20th, 2020, 5:44 am One last thing that I want to add little animation and design improvements that make the green square where user clicks look like a real button.
What kind of animation do you want? And what design improvements? Not sure...

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: December 21st, 2020, 5:51 am
by CodeCode
mattnicholas wrote: December 20th, 2020, 5:44 am hey.. firstly, thanks for this thread...

Can any of the bright minds here help me with this? Thanks in advance.
I am pretty spiffy with photoshop - a rough as guts mspaint sketch and I'll try to make something you'll like - i hope. :oops:

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: December 21st, 2020, 6:58 am
by mattnicholas
CodeCode wrote: December 21st, 2020, 5:51 am I am pretty spiffy with photoshop - a rough as guts mspaint sketch and I'll try to make something you'll like - i hope. :oops:
I want to replicate the button like this one (including the pressing animation).

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: December 21st, 2020, 7:01 am
by mattnicholas
balala wrote: December 20th, 2020, 4:50 pm This is not a Rainmeter skin, right?

Since this topic is more than six years old, first please post the exact code you are using. Also let us know what exactly do you want to achieve, because I'm not exactly sure what does this mean:

What kind of animation do you want? And what design improvements? Not sure...
I just posted the GIF of how I want it. I am using the exact code provided by @jsmorley

Code: Select all

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

[ClickCounter]
Measure=Calc
Formula=ClickCounter+1
Disabled=1
UpdateDivider=-1

[ShowClicks]
Meter=String
MeasureName=ClickCounter
X=0
Y=0
FontColor=255,255,255,255
FontFace=Segoe UI
FontSize=17
StringEffect=Shadow
FontEffectColor=0,0,0,255
SolidColor=0,0,0,1
AntiAlias=1
Text=Counter is: %1
LeftMouseUpAction=[!EnableMeasure ClickCounter][!UpdateMeasure ClickCounter][!UpdateMeter ShowClicks][!Redraw]

Re: [Solved] Is it possible to make a "Click Counter"?

Posted: December 21st, 2020, 7:38 am
by CodeCode
mattnicholas wrote: December 21st, 2020, 6:58 am I want to replicate the button like this one (including the pressing animation).
That's fairly basic. Using Shape meters for that should be better than using an image - that reduces dependencies for image files etc.

The toggle effect would simply be a similar shape being toggled using !togglemetergroup between the two shapes.

Give it a whirl, as I think you're up to the coding task of that desired effect. IIRC the Shape section of the manual uses a very similar example you can work from.