It is currently October 19th, 2020, 9:33 pm

HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Posts: 2760
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by Yincognito »

eclectic-tech wrote: October 8th, 2020, 3:10 pmEdit: Added "social distancing!"
Oh yeah, that too. So, no sex at this party... O.O
User avatar
strawberryshortcake
Posts: 59
Joined: August 27th, 2016, 12:49 am

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by strawberryshortcake »

Yincognito wrote: October 8th, 2020, 12:42 pm I think displaying a quote at a specific time interval is not going to be an issue, but some details about what kind of animation you intend to use (and why would you need a different skin for it) would be useful.
(1) Here's my youtube video showing the quote skin plus the butterfly animation that I posted before the awesome code posted by eclectic-tech. Blue butterfly has 241 frames, Yellow butterfly has 100 frames :
[Youtube]https://www.youtube.com/watch?v=_0ADpmT6in8&feature=youtu.be&ab_channel=strawberryyogurt0[/Youtube]

(2) I needed a different skin for two animation because I never figured out how to put two of the same type of animation in a skin.ini file. With the partial implementation, the 'first animation' is frozen on screen, the second animation plays.

PARTIAL portion of the code for animation.ini showing what I have tried to combine two animations, but doesn't work:

Code: Select all

;=======ENDING LOOP (This formula allows the animation to play once, then disappear)
[ImageNumberCalc]
Measure=Calc
Formula= (ImageNumberCalc < 241) ? (ImageNumberCalc+1) : (241)

[ImageMeter]
Meter=Image
ImageName=#@#ImagesFrames - Blue Butterfly\tmp-[ImageNumberCalc].png


;=======ENDING LOOP (This formula allows the animation to play once, then disappear)
[ImageNumberCalc2]
Measure=Calc
Formula= (ImageNumberCalc2 < 100) ? (ImageNumberCalc2+1) : (100)

[ImageMeter2]
Meter=Image
ImageName=#@#ImagesFrames - Yellow Butterfly\tmp-[ImageNumberCalc2].png

FULL CODE for animation.ini :

Code: Select all

; Note - You will need to get and install ImageMagick from:
; http://www.imagemagick.org/script/binary-releases.php

; Convert your .gif image to a "Bitmap" with the following in a cmd.exe command prompt window:
; convert -coalesce "C:\PathToInput\InputName.gif" "C:\PathToOutput\OutputName.png"



[Rainmeter]
Update=25

[Metadata]
Name=GIFFrames
Author=Rainmeter Team
Information=Displays a deconstructed .gif file (individual frames) as if it was a .gif file || Instructions: See .ini file for how to get and use ImageMagick
Version=Jan 16, 2016
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0


;======= NEVER ENDING LOOP (This formula creates a never ending loop animation)
;[ImageNumberCalc]
;Measure=Calc
;Formula=Counter % 100



;=======ENDING LOOP (This formula allows the animation to play once, then disappear)
[ImageNumberCalc]
Measure=Calc
Formula= (ImageNumberCalc < 241) ? (ImageNumberCalc+1) : (241)

[ImageMeter]
Meter=Image
ImageName=#@#ImagesFrames - Blue Butterfly\tmp-[ImageNumberCalc].png


;=======ENDING LOOP (This formula allows the animation to play once, then disappear)
[ImageNumberCalc2]
Measure=Calc
Formula= (ImageNumberCalc2 < 100) ? (ImageNumberCalc2+1) : (100)

[ImageMeter2]
Meter=Image
ImageName=#@#ImagesFrames - Yellow Butterfly\tmp-[ImageNumberCalc2].png





AntiAlias=1
DynamicVariables=1
;x=150
;y=200

x=-20
y=10
;width=60
;height=20
;WindowX=(#SCREENAREAWIDTH#-50)
;WindowY=(#SCREENAREAHEIGHT#-250)
;width = 1920
;height = 50


Just for the sake of completion (also in case I need to reference this in the future if I ever forget), the animation code for both endless loop and single loop animations (code was found here on Rainmeter's official forum:

Code: Select all

-; Note - You will need to get and install ImageMagick from:
; http://www.imagemagick.org/script/binary-releases.php

; Convert your .gif image to a "Bitmap" with the following in a cmd.exe command prompt window:
; convert -coalesce "C:\PathToInput\InputName.gif" "C:\PathToOutput\OutputName.png"




;=====================================
; 	THIS IS AN ANIMATION SCRIPT FOUND ON RAINMETER.COM OFFICIAL FORUM
;=====================================

[Rainmeter]
Update=25

[Metadata]
Name=GIFFrames
Author=Rainmeter Team
Information=Displays a deconstructed .gif file (individual frames) as if it was a .gif file || Instructions: See .ini file for how to get and use ImageMagick
Version=Jan 16, 2016
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

;=====================================
; 	ANIMATION ENDLESS LOOP .... START
;=====================================

; The number % 100 corresponds to the total number of frames in your animation
; Name your animation frames like such tmp-0.png, tmp-1.png, tmp-99.png
; The last frame is frame tmp-99.png because the 1st frame is tmp-0.png

;NEVER ENDING LOOP
;[ImageNumberCalc]
;Measure=Calc
;Formula=Counter % 100
;=====================================
; 	ANIMATION ENDLESS LOOP .... END
;=====================================



;=====================================
; 	ANIMATION WILL END .... START
;=====================================

; There are 241 total number of frames
; Name your animation frames like such tmp-0.png, tmp-1.png, tmp-241.png
;ENDING LOOP
[ImageNumberCalc]
Measure=Calc
Formula= (ImageNumberCalc < 241) ? (ImageNumberCalc+1) : (241)

;=====================================
; 	ANIMATION WILL END .... END
;=====================================




;=====================================
; 	KEEP EVERYTHING BELOW REGARDLESS OF WHICH OF THE TWO TYPES OF ANIMATION YOU CHOOSE
; 	But do change the Image path for your animation frames
;=====================================

[ImageMeter]
Meter=Image
ImageName=#@#ImagesFrames - Blue Butterfly\tmp-[ImageNumberCalc].png
AntiAlias=1
DynamicVariables=1
;x=150
;y=200

x=-20
y=10

; ====== YOu can change the size of the animation by changing the W and H value
; ====== For some reason, W and H needs to be uppercase
; ====== I tried lower case w and h and it never works.
;W=1920
;H=1080

User avatar
strawberryshortcake
Posts: 59
Joined: August 27th, 2016, 12:49 am

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by strawberryshortcake »

eclectic-tech wrote: October 8th, 2020, 2:19 pm
Late to party... as usual :lol:

Hi strawberryshortcake! (one of my favorite desserts BTW :) )

The suggestions above should help you get this working, but I believe you might be combining IfAbove test with IfCondition actions and that is why the suggestions are not working for you.

Here is your code with a few modifications that will use a Time measure to control the quote display, so they change at the precise time, and a Calc measure based on the skin Update to control the animation display. I changed a few settings in the quote display meter to center the quote on the screen and wrap longer phrases.

I added variables that can be set to the number of seconds for quotes and animation control. I added an OnRefreshAction to setup the first display and an OnCloseAction to make sure the animation skin(s) are closed when the quote skin is deactivated. If you use more than 1 animation, you should add !DeactivateConfig for each to the OnCloseAction.

Hope this helps. :Whistle
inspired.gifClick the image to animate...

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
OnRefreshAction=[Play "Chime.wav"][!SetOption MeterQuote Text "#Item1#"][!UpdateMeter MeterQuote][!Redraw][!EnableMeasure MeasureAnimationTimeOut][!UpdateMeasure MeasureAnimationTimeOut]
OnCloseAction=[!DeactivateConfig "#RootConfig#\Quotes Animation - Blue Butterfly"]

[Variables]
@Include=#CURRENTPATH#Test.txt
; Number of seconds between quotes
UpdateTime=30
; Number of seconds to show the animation
AnimationTimeOut=5

; This will return the current time in seconds
[MeasureTime]
Measure=Time

; This will use the skin updaterate to activate a config for the number of seconds set by the #AnimationTimeOut# value
[MeasureAnimationTimeOut]
Measure=Calc
Formula=(MeasureAnimationTimeOut%#AnimationTimeOut#)+1
IfCondition=(MeasureAnimationTimeOut=1)
IfTrueAction=[!ActivateConfig "#RootConfig#\Quotes Animation - Blue Butterfly" "Blue Butterfly.ini"]
IfCondition2=(MeasureAnimationTimeOut>=#AnimationTimeOut#)
IfTrueAction2=[!DisableMeasure MeasureAnimationTimeOut][!DeActivateConfig "#RootConfig#\Quotes Animation - Blue Butterfly"]
Disabled=1

;==== There are 19 inspirational quotes (from Test.txt file)
[MeasureCount]
Measure=Calc
Formula=(MeasureCount % 19) + 1
UpdateDivider=-1
 
; Using [MeasureTime] and modulo to update the quote every number of seconds set by #UpdateTime#
; If #UpdateTime# is 60 the quote updates every minute
; If #UpdateTime# is 900 the quote updates when the time is divisible by 15 minutes; every 15 minutes on the quarter hour
; If #UpdateTime# is 3600 the quote updates when the time is divisible by 60 minutes; every hour on the hour
[MeasureUpdate]
Measure=Calc
Formula=(MeasureTime%#UpdateTime#)+1
IfCondition=(MeasureUpdate=1)
IfTrueAction=[Play "Chime.wav"][!SetOption MeterQuote Text "#Item[MeasureCount]#"][!UpdateMeter MeterQuote][!Redraw][!UpdateMeasure MeasureCount][!EnableMeasure MeasureAnimationTimeOut][!UpdateMeasure MeasureAnimationTimeOut]
DynamicVariables=1
;=== I have updatedivider set to 3 just for testing purposes. 
;UpdateDivider=1


[MeterQuote]
Meter=String
X=(#WorkAreaWidth#*0.5)
W=(#WorkAreaWidth#*0.75)
FontFace=Dancing Script OT
FontSize=35
FontColor=255,255,255,255
StringStyle=Bold
Antialias=1
Padding=75,5,75,5
StringAlign=Center
ClipString=2
UpdateDivider=-1

By the way, how did you post that Gif animation of Newman as an attachment. I managed give Newman a transparent background to create a rainmeter animation GIF. I was going to post it here but don't exactly know how to go about doing to so... thus a youtube video of it.

https://www.youtube.com/watch?v=Pv3RaZQXxfI&feature=youtu.be&ab_channel=strawberryyogurt0

Maybe this Imgur link of Newman will work: Image

Maybe this direct imgur link will work: https://imgur.com/a/IOvN7OK




Would you be surprised if I said I got my username not because of the dessert nor the cartoon character. I like strawberries and simply wanted something else that sounded nice, and shortcake just so happens to sound nice. But yes, ice cold strawberryshortcake desserts or any ice cold desserts of any kind are great.


Awesome stuff. Magnificent work. :thumbup: :great: :D :party: :party: :17good

Worked perfectly for sequential quotes to display both new quotes and trigger my animation at the top of the hour (or any time interval specified). Loading the skin at 10:59 PM and 45 seconds will still allow the skin to refresh at 11:00 PM, then 12:00 AM, etc. if I set it refresh to 1 hour. Perfect.

Appreciate all the other additions for cleaner more effective code. Love the addition of "UpdateTime" and "AnimationTimeOut" adjustable variables. Makes life easier. That solves one mystery.

But how would I approach this (have them trigger at the top of hour along with having the animation play simultaneously as well) with the standard quoteplugin skins that is normally found all over deviantart? Quoteplugin displays random quotes in no specific order, and they load/refresh at the top of the hour. I'm perfectly fine with sometimes wanting random quotes triggering, but these random quoteplugin skins don't refresh at set intervals? I'm sure it depends on the "time" variable that you did with the above sequential ordered quote skin, but I'm kind of at a lost on how to properly implement the time variable to these random quoteplugin skins?

Here's a quoteplugin code drafted by JSMORLEY. The addition of OnUpdateAction to the Quote Measure for quoteplugin skins finally allows me to have animation trigger automatically without using the mouseaction for random quote skins. But the big/inconvenience issue is that the specified time interval slowly but surely changes over time.

Code: Select all

; \\\\ Simply using OnUpdateAction, the following number shows a tabulation of how the time 
; \\\\ when the quote/animation triggers starts to go off track. 


;=========QUOTE CHANGE PLUS ANIMATION ACTIVATECONFG
;@10:41:00
;@10:41:15
;@10:41:30
;@10:41:46
;@10:42:01
;@10:42:16
;@10:42:31
;@10:42:47
;@10:43:02
;@10:43:17
;@10:43:32
;@10:43:47
;@10:44:03
;=========QUOTE CHANGE PLUS ANIMATION ACTIVATECONFG
;@10:47:20
;@10:47:36
;@10:47:51
;@10:48:06
;@10:48:21
;@10:48:36
;@10:48:52
;@10:49:07
;@10:49:23

;======QUOTE CHANGE ONLY
;@10:50:15
;@10:50:30
;@10:50:45
;@10:51:00
;@10:51:16
;@10:51:46
;@10:52:01
;@10:52:16
;@10:52:32
;@10:52:47
;@10:53:02
;@10:53:17
;@10:53:32
;@10:53:48
;@10:54:03
;@10:54:18


;====================================================
;	Code for generating RANDOM quote with an animation
;====================================================

[Rainmeter]
Update=1000
DynamicWindowSize=1
;!OnRefreshAction=[!ActivateConfig "__Inspirational Quotes - JSMORLEY\Quotes ANimation - Blue Butterfly" "Blue Butterfly.ini"][!Delay 5000][!DeactivateConfig "__Inspirational Quotes - JSMORLEY\Quotes Animation - Blue Butterfly"]

; \\\\ I tied !OnRefreshAction, but it didn't trigger the animation at all





[Variables]
;=====This value determines the time when a new quote is displayed
;=====Change this value to 1 for 1 minute; 2 for 2 minute, 30 for 30 minute, 60 for 1 hour, 3600 for 1 day
Minutes=0.25



[MeasureQuote]
Measure=Plugin
;Plugin=Plugins\QuotePlugin.dll
Plugin=QuotePlugin

;===== The stuff betwen the two # is shown below can be subsituted with the word CURRENTPATH
PathName=#CURRENTPATH#ListOfQuotes.txt
;"#C:\Users\YourPC_UserName\Desktop\DesktopFolder\Rainmeter\Skins\Another_Folder\#ListOfQuotes.txt"

UpdateDivider=(#Minutes# * 60)
OnUpdateAction=[!ActivateConfig "__Inspirational Quotes - JSMORLEY\Quotes ANimation - Blue Butterfly" "Blue Butterfly.ini"][!Delay 5000][!DeactivateConfig "__Inspirational Quotes - JSMORLEY\Quotes Animation - Blue Butterfly"]
;!OnRefreshAction=[!ActivateConfig "__Inspirational Quotes - JSMORLEY\Quotes ANimation - Blue Butterfly" "Blue Butterfly.ini"][!Delay 5000][!DeactivateConfig "__Inspirational Quotes - JSMORLEY\Quotes Animation - Blue Butterfly"]

; \\\\ OnUpdateAction here allowed the animation to trigger and "specified time interval" with a caveat
; \\\\ The caveat is that the time slow creeps up. Meanin if the skin quote is scheduled to 
; \\\\ cue new quotes every 15 seconds, at 10:45, cue 1st quote, at 11:01 cue 2nd quote, etc.
; \\\\ When is should trigger at 11:00. This starts to happen after a few rounds when initially it'll 
; \\\\ look fine. 
; \\\\
; \\\\ I tied !OnRefreshAction here in the [MeasureQuote] area and it still doen't work to trigger
; \\\\ the animation.





[QuoteText]
;MeasureName=QuoteSource
MeasureName=MeasureQuote
Meter=String
X=7
Y=40
W=660
H=300
StringStyle=Normal
FontColor=255,255,255,255
FontSize=14
FontFace="Times New Roman"
AntiAlias=1
ClipString=1
User avatar
Yincognito
Posts: 2760
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by Yincognito »

strawberryshortcake wrote: October 9th, 2020, 6:52 am(2) I needed a different skin for two animation because I never figured out how to put two of the same type of animation in a skin.ini file. With the partial implementation, the 'first animation' is frozen on screen, the second animation plays.
strawberryshortcake wrote: October 9th, 2020, 8:07 amBut how would I approach this (have them trigger at the top of hour along with having the animation play simultaneously as well) with the standard quoteplugin skins that is normally found all over deviantart? Quoteplugin displays random quotes in no specific order, and they load/refresh at the top of the hour. I'm perfectly fine with sometimes wanting random quotes triggering, but these random quoteplugin skins don't refresh at set intervals? I'm sure it depends on the "time" variable that you did with the above sequential ordered quote skin, but I'm kind of at a lost on how to properly implement the time variable to these random quoteplugin skins?
Maybe this will help...

Code:

Code: Select all

[Variables]
TimeIntervalSeconds=10
ImageNumberOneCount=6
ImageNumberTwoCount=6
ImageNumberOneStep=0
ImageNumberTwoStep=0

[Rainmeter]
Update=25
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[Time]
Measure=Time
IfCondition=(([Time:TimeStamp]%#TimeIntervalSeconds#)=0)
IfTrueAction=[!SetVariable ImageNumberOneStep 1][!SetVariable ImageNumberTwoStep 1][!UpdateMeasure MeasureQuote][!UpdateMeter MeterQuote][!Redraw]
DynamicVariables=1

[MeasureQuote]
Measure=Plugin
Plugin=QuotePlugin
PathName=#@#Quote.txt
UpdateDivider=-1

[MeasureImageNumberOne]
Measure=Calc
Formula=((MeasureImageNumberOne+#ImageNumberOneStep#)%#ImageNumberOneCount#)
OnUpdateAction=[!SetVariable ImageNumberOneStep (([MeasureImageNumberOne]=0)?(0):(#ImageNumberOneStep#))]
DynamicVariables=1

[MeasureImageNumberTwo]
Measure=Calc
Formula=((MeasureImageNumberTwo+#ImageNumberTwoStep#)%#ImageNumberTwoCount#)
OnUpdateAction=[!SetVariable ImageNumberTwoStep (([MeasureImageNumberTwo]=0)?(0):(#ImageNumberTwoStep#))]
DynamicVariables=1

---Meters---

[MeterImageOne]
Meter=Image
ImageName=#@#[MeasureImageNumberOne].png
DynamicVariables=1

[MeterImageTwo]
Meter=Image
X=0R
ImageName=#@#[MeasureImageNumberTwo].png
DynamicVariables=1

[MeterQuote]
Meter=STRING
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=MeasureQuote
Text="Quote: %1"
UpdateDivider=-1
Skin:
Quote_1.0.0.rmskin
Notes: Obviously, ImageOne and ImageTwo measures and meters are your two animations (within the same skin), TimeIntervalSeconds is the time interval at which the animations and the quote are triggered, the two ...Count variables are the animations' frame counts, and each of them are adjustable. It will do what I think you wanted (or wondered about) in a single skin and using the simplest code possible. The [!UpdateMeter MeterQuote][!Redraw] part in [Time]'s IfTrueAction is not needed if you comment or remove [MeterQuote]'s UpdateDivider=-1 line (which basically updates it on demand instead of automatically in the code's current form).

If you have any other question, feel free to ask. My code is not intented to replace eclectic-tech's, but merely to answer your "how to" questions in the last replies. Once you figure out how to do this, you can pretty much modify any such code to suit your needs.
You do not have the required permissions to view the files attached to this post.
User avatar
strawberryshortcake
Posts: 59
Joined: August 27th, 2016, 12:49 am

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by strawberryshortcake »

Yincognito wrote: October 9th, 2020, 6:20 pm Maybe this will help...
Code:

Code: Select all

[Variables]
TimeIntervalSeconds=10
ImageNumberOneCount=6
ImageNumberTwoCount=6
ImageNumberOneStep=0
ImageNumberTwoStep=0

[Rainmeter]
Update=25
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[Time]
Measure=Time
IfCondition=(([Time:TimeStamp]%#TimeIntervalSeconds#)=0)
IfTrueAction=[!SetVariable ImageNumberOneStep 1][!SetVariable ImageNumberTwoStep 1][!UpdateMeasure MeasureQuote][!UpdateMeter MeterQuote][!Redraw]
DynamicVariables=1

[MeasureQuote]
Measure=Plugin
Plugin=QuotePlugin
PathName=#@#Quote.txt
UpdateDivider=-1

[MeasureImageNumberOne]
Measure=Calc
Formula=((MeasureImageNumberOne+#ImageNumberOneStep#)%#ImageNumberOneCount#)
OnUpdateAction=[!SetVariable ImageNumberOneStep (([MeasureImageNumberOne]=0)?(0):(#ImageNumberOneStep#))]
DynamicVariables=1

[MeasureImageNumberTwo]
Measure=Calc
Formula=((MeasureImageNumberTwo+#ImageNumberTwoStep#)%#ImageNumberTwoCount#)
OnUpdateAction=[!SetVariable ImageNumberTwoStep (([MeasureImageNumberTwo]=0)?(0):(#ImageNumberTwoStep#))]
DynamicVariables=1

---Meters---

[MeterImageOne]
Meter=Image
ImageName=#@#[MeasureImageNumberOne].png
DynamicVariables=1

[MeterImageTwo]
Meter=Image
X=0R
ImageName=#@#[MeasureImageNumberTwo].png
DynamicVariables=1

[MeterQuote]
Meter=STRING
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=MeasureQuote
Text="Quote: %1"
UpdateDivider=-1
Skin:
Quote_1.0.0.rmskin
Notes: Obviously, ImageOne and ImageTwo measures and meters are your two animations (within the same skin), TimeIntervalSeconds is the time interval at which the animations and the quote are triggered, the two ...Count variables are the animations' frame counts, and each of them are adjustable. It will do what I think you wanted (or wondered about) in a single skin and using the simplest code possible. The [!UpdateMeter MeterQuote][!Redraw] part in [Time]'s IfTrueAction is not needed if you comment or remove [MeterQuote]'s UpdateDivider=-1 line (which basically updates it on demand instead of automatically in the code's current form).

If you have any other question, feel free to ask. My code is not intented to replace eclectic-tech's, but merely to answer your "how to" questions in the last replies. Once you figure out how to do this, you can pretty much modify any such code to suit your needs.


Code: Select all

[Variables]

;======================================
; 	ORIGINAL DEFAULT VALUES 
;======================================
;TimeIntervalSeconds=10
;ImageNumberOneCount=99
;ImageNumberTwoCount=6
;ImageNumberOneStep=0
;ImageNumberTwoStep=0
;======================================
; 	ORIGINAL DEFAULT VALUES 
;======================================



TimeIntervalSeconds=15
ImageNumberOneCount=101
ImageNumberTwoCount=201
ImageNumberOneStep=0
ImageNumberTwoStep=0



[Rainmeter]
Update=25
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
;SolidColor=47,47,47,255
SolidColor=255,255,255,1


---Measures---

[Time]
Measure=Time
IfCondition=(([Time:TimeStamp]%#TimeIntervalSeconds#)=0)
IfTrueAction=[!SetVariable ImageNumberOneStep 1][!SetVariable ImageNumberTwoStep 1][!UpdateMeasure MeasureQuote]
DynamicVariables=1

;========================================
;	[!UpdateMeter MeterQuote][!Redraw] removed 
;		from the [Time] section of IfTrueAction
;
;========================================




[MeasureQuote]
Measure=Plugin
Plugin=QuotePlugin
PathName=#@#Quote.txt
UpdateDivider=-1

[MeasureImageNumberOne]
Measure=Calc
Formula=((MeasureImageNumberOne+#ImageNumberOneStep#)%#ImageNumberOneCount#)
OnUpdateAction=[!SetVariable ImageNumberOneStep (([MeasureImageNumberOne]=0)?(0):(#ImageNumberOneStep#))]
DynamicVariables=1

[MeasureImageNumberTwo]
Measure=Calc
Formula=((MeasureImageNumberTwo+#ImageNumberTwoStep#)%#ImageNumberTwoCount#)
OnUpdateAction=[!SetVariable ImageNumberTwoStep (([MeasureImageNumberTwo]=0)?(0):(#ImageNumberTwoStep#))]
DynamicVariables=1



;]]]]]]]]]]]]]]]]]]]]]]]]]

; butterfly meter original location here
; METERS moved to the end because I wanted
; the butterfly animations to be position
; on the upper most layer.

;]]]]]]]]]]]]]]]]]]]]]]]]]


[MeterQuote]
Meter=STRING
;Y=0R
Y=100
;FontFace=Consolas
FontFace=Dancing Script OT

FontColor=255,255,255,255
;SolidColor=47,47,47,255

SolidColor=255,255,255,1

;Padding=5,5,5,5
FontSize=30
AntiAlias=1
MeasureName=MeasureQuote
Text="Quote: %1"
;>>>UpdateDivider=-1

;===================================
;	UpdateDivider=-1 commented out of 
;		[MeterQuote] section
;
;
;===================================


---Meters---

[MeterImageOne]
Meter=Image
Y=0
;ImageName=#@#[MeasureImageNumberOne].png
ImageName=#@#ImagesFrames - Yellow Butterfly\[MeasureImageNumberOne].png
DynamicVariables=1


[MeterImageTwo]
Meter=Image
;X=0R
x=300
y=50
;ImageName=#@#[MeasureImageNumberTwo].png
ImageName=#@#ImagesFrames - Orange Butterfly\[MeasureImageNumberTwo].png
DynamicVariables=1
Two part comment:

Part 1: Problems, concerns (maybe I'm overlooking something):
For some reason (maybe I'm overlooking something) removing both .... [!UpdateMeter MeterQuote][!Redraw] in the [Time] section and UpateDivider=-1 in the [MeterQuote]'s section .... doesn't do what I expect unless I have a misunderstanding for what it does.

After removing those elements above, loading the skin at say 2:40:40 (load) (and TimeIntervalSeconds=15), both the animation and quote will still play at 2:00:45 / 2:01:00 / 2:01:15 ( which is actually perfect) as opposed to 2:40:55, 2:41:10, 2:41:25. Because the code is suppose to be intended to do something else, I'm interested in knowing why it's not doing what it's suppose to.

Part 2: Awesome Super code.
Youtube link (not sure why the message board's youtube bracket doesn't work: https://www.youtube.com/watch?v=I5QJge0PN9E&feature=youtu.be&ab_channel=strawberryyogurt0

:D :thumbup: :party: :17good :yahoo: :YESSS: :wave
This also possibly answers a question that I had years ago about "linking two animations" together. I'll have to test and fiddle around with the code to get a better understanding. But for now it definitely does what I'v always wondered and wanted.

Love both eclectic-tech and your code. Will be using both. I'll have to test out your code on linking together multiple animations when I get a chance.
User avatar
Yincognito
Posts: 2760
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by Yincognito »

strawberryshortcake wrote: October 10th, 2020, 10:23 amTwo part comment:

Part 1: Problems, concerns (maybe I'm overlooking something):
For some reason (maybe I'm overlooking something) removing both .... [!UpdateMeter MeterQuote][!Redraw] in the [Time] section and UpateDivider=-1 in the [MeterQuote]'s section .... doesn't do what I expect unless I have a misunderstanding for what it does.

After removing those elements above, loading the skin at say 2:40:40 (load) (and TimeIntervalSeconds=15), both the animation and quote will still play at 2:00:45 / 2:01:00 / 2:01:15 ( which is actually perfect) as opposed to 2:40:55, 2:41:10, 2:41:25. Because the code is suppose to be intended to do something else, I'm interested in knowing why it's not doing what it's suppose to.

Part 2: Awesome Super code.
Youtube link (not sure why the message board's youtube bracket doesn't work: https://www.youtube.com/watch?v=I5QJge0PN9E&feature=youtu.be&ab_channel=strawberryyogurt0

:D :thumbup: :party: :17good :yahoo: :YESSS: :wave
This also possibly answers a question that I had years ago about "linking two animations" together. I'll have to test and fiddle around with the code to get a better understanding. But for now it definitely does what I'v always wondered and wanted.

Love both eclectic-tech and your code. Will be using both. I'll have to test out your code on linking together multiple animations when I get a chance.
Yeah, I'm not sure why removing those bits doesn't work for you, because they certainly do for me (I obviously don't have your images to test, but tried just now with your posted code, even with different ...Counts variables, like 3 and 6, simulating your different length animations and didn't have any issues whatsoever). It's easy to understand what removing those bits does: it simply lets Rainmeter's own automatically triggered update and redraw (once every 25 ms) to handle displaying that meter in the new circumstances, instead of doing this "on demand". So it should work.

Maybe posting the entire skin (images and other dependencies included) might give an answer as to why removing those bits doesn't work in your case. By the way, make sure the images are ALREADY generated before attempting the animations.

Other than that, YouTube links do work, but you have to remove that &feature=youtu.be&ab_channel=strawberryyogurt0 junk at the end of the URL:
User avatar
strawberryshortcake
Posts: 59
Joined: August 27th, 2016, 12:49 am

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by strawberryshortcake »

Yincognito wrote: October 10th, 2020, 1:03 pm
Yeah, I'm not sure why removing those bits doesn't work for you, because they certainly do for me (I obviously don't have your images to test, but tried just now with your posted code, even with different ...Counts variables, like 3 and 6, simulating your different length animations and didn't have any issues whatsoever). It's easy to understand what removing those bits does: it simply lets Rainmeter's own automatically triggered update and redraw (once every 25 ms) to handle displaying that meter in the new circumstances, instead of doing this "on demand". So it should work.

Maybe posting the entire skin (images and other dependencies included) might give an answer as to why removing those bits doesn't work in your case. By the way, make sure the images are ALREADY generated before attempting the animations.

Other than that, YouTube links do work, but you have to remove that &feature=youtu.be&ab_channel=strawberryyogurt0 junk at the end of the URL:

I decided to install rainmeter on a different computer with your uploaded quote skin with the 6 included default images. Commented out [!UpdateMeter MeterQuote][!Redraw]in the [Time] section and UpateDivider=-1 from [MeterQuote], and the quote/animation still don't do what they're suppose to do.

TimeIntervalSeconds=15
@9:21:10 (skin load/refresh manually)
@9:21:14
@9:21:29
@9:21:44
@9:21:59

Here's the full code:

Code: Select all

[Variables]
TimeIntervalSeconds=15
ImageNumberOneCount=6
ImageNumberTwoCount=6
ImageNumberOneStep=0
ImageNumberTwoStep=0

[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255

---Measures---

[Time]
Measure=Time
IfCondition=(([Time:TimeStamp]%#TimeIntervalSeconds#)=0)
IfTrueAction=[!SetVariable ImageNumberOneStep 1][!SetVariable ImageNumberTwoStep 1][!UpdateMeasure MeasureQuote]
;============IfTrueAction=[!SetVariable ImageNumberOneStep 1][!SetVariable ImageNumberTwoStep 1][!UpdateMeasure MeasureQuote][!UpdateMeter MeterQuote][!Redraw]
DynamicVariables=1

[MeasureQuote]
Measure=Plugin
Plugin=QuotePlugin
PathName=#@#Quote.txt
UpdateDivider=-1

[MeasureImageNumberOne]
Measure=Calc
Formula=((MeasureImageNumberOne+#ImageNumberOneStep#)%#ImageNumberOneCount#)
OnUpdateAction=[!SetVariable ImageNumberOneStep (([MeasureImageNumberOne]=0)?(0):(#ImageNumberOneStep#))]
DynamicVariables=1

[MeasureImageNumberTwo]
Measure=Calc
Formula=((MeasureImageNumberTwo+#ImageNumberTwoStep#)%#ImageNumberTwoCount#)
OnUpdateAction=[!SetVariable ImageNumberTwoStep (([MeasureImageNumberTwo]=0)?(0):(#ImageNumberTwoStep#))]
DynamicVariables=1

---Meters---

[MeterImageOne]
Meter=Image
ImageName=#@#[MeasureImageNumberOne].png
DynamicVariables=1

[MeterImageTwo]
Meter=Image
X=0R
ImageName=#@#[MeasureImageNumberTwo].png
DynamicVariables=1

[MeterQuote]
Meter=STRING
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=MeasureQuote
Text="Quote: %1"
;=============UpdateDivider=-1
User avatar
Yincognito
Posts: 2760
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by Yincognito »

strawberryshortcake wrote: October 10th, 2020, 4:25 pm I decided to install rainmeter on a different computer with your uploaded quote skin with the 6 included default images. Commented out [!UpdateMeter MeterQuote][!Redraw]in the [Time] section and UpateDivider=-1 from [MeterQuote], and the quote/animation still don't do what they're suppose to do.

TimeIntervalSeconds=15
@9:21:10 (skin load/refresh manually)
@9:21:14
@9:21:29
@9:21:44
@9:21:59

Here's the full code [...]
Using the exact same code, I got this behavior here (MediaFire link). Nothing out of the ordinary or strange, as you can see.

By the way, do you have Hardware Acceleration checked in Rainmeter's settings? I don't. If you do have it checked though, that might be a cause of some unexpected behavior on some hardware, as far as I know.

EDIT: By the way, I'm not sure what you expect to happen and it doesn't happen, maybe I didn't understand what you meant properly, so if you can, please explain it again in simple and clear terms, in case I missed something. If by any chance you talk about the "0" image still staying on the screen after the "1" to "N" (in this case, "5") iteration was displayed, this is intentional. You probably have your frames numbered from 1 to N too, so if you want the image to "disappear" when the iteration is over, just create a "0.png" (or any extension you use there) image that is either entirely or "almost" transparent and place it along your 1 to N images in the desired folder. After the animation iterates from 1.png to N.png, it will fall back to 0.png, and since the latter is more or less transparent, it will create the illusion of no image being displayed there. In other words, you'll need a 0.png plus your actual animation images in the folder where you get the images from. Sure, the 0.png could even be missing, as I don't think Rainmeter will issue an error in that case and just silently fail, all I'm saying is that if you intend to not display anything between animation "bursts", then your first actual animation frame should be 1.png (i.e. numbering starting at 1 instead of 0) - meaning that 0.png will be a "fake" image displayed between the end of the previous animation and the start of the following one. Hopefully I've been clear enough in my explanation, if by any chance this was the issue.
User avatar
strawberryshortcake
Posts: 59
Joined: August 27th, 2016, 12:49 am

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by strawberryshortcake »

Yincognito wrote: October 10th, 2020, 5:02 pm
Using the exact same code, I got this behavior here (MediaFire link). Nothing out of the ordinary or strange, as you can see.

By the way, do you have Hardware Acceleration checked in Rainmeter's settings? I don't. If you do have it checked though, that might be a cause of some unexpected behavior on some hardware, as far as I know.

EDIT: By the way, I'm not sure what you expect to happen and it doesn't happen, maybe I didn't understand what you meant properly, so if you can, please explain it again in simple and clear terms, in case I missed something. If by any chance you talk about the "0" image still staying on the screen after the "1" to "N" (in this case, "5") iteration was displayed, this is intentional. You probably have your frames numbered from 1 to N too, so if you want the image to "disappear" when the iteration is over, just create a "0.png" (or any extension you use there) image that is either entirely or "almost" transparent and place it along your 1 to N images in the desired folder. After the animation iterates from 1.png to N.png, it will fall back to 0.png, and since the latter is more or less transparent, it will create the illusion of no image being displayed there. In other words, you'll need a 0.png plus your actual animation images in the folder where you get the images from. Sure, the 0.png could even be missing, as I don't think Rainmeter will issue an error in that case and just silently fail, all I'm saying is that if you intend to not display anything between animation "bursts", then your first actual animation frame should be 1.png (i.e. numbering starting at 1 instead of 0) - meaning that 0.png will be a "fake" image displayed between the end of the previous animation and the start of the following one. Hopefully I've been clear enough in my explanation, if by any chance this was the issue.
After seeing your video, I think I may have misinterpreted your earlier statement. Because the video is exactly how mines also look when I have TimeIntervalSeconds=15 .

Situation A ( Desired Effect )
This is the provided log time in your video:
19:44:21 (skin loads)
19:44:30 (1st update cycle of skin)
19:44:45 (2nd update cycle of skin because TimeIntervalSeconds=15
19:45:00
19:45:15
19:45:30

I had the impression that removing or (commenting out) [!UpdateMeter MeterQuote][!Redraw] in the [Time] section and UpateDivider=-1 from [MeterQuote] would do the following

This is what I thought would happen when TimeIntervalSeconds=15

Situation B ( Undesirable Effect )
19:44:21 (skin loads)
19:44:36 (1st update cycle of skin, 15 second interval ... 15 seconds from when the skin was loaded)
19:44:51 (2nd update cycle of skin, 15 second interval)
19:45:06 (3rd update cycle of skin, 15 second interval)
19:45:21


Because keeping [!UpdateMeter MeterQuote][!Redraw] in [Time] section and UpateDivider=-1 in [MeterQuote] in the code actually does the same thing as your video, and I could not tell the difference when I left those elements out of in the code, I wasn't sure what changes were suppose to happen. But since your video actually showcases exactly how mines look, then I think the 'concern' was never really a concern at all. In other words, it's working perfectly as is.

Regarding your edit portion, yes, I had to think about that when I was fiddling with the code to see how I can have the animation disappear, then reappear, then disappear. And your suggestion is exactly what I tried and it worked.


Side Note: I'm going to be posting an issue (in a new thread maybe later today or tomorrow) with another skin -- it's regarding actiontimer. I'm going to see if I can fiddle with it to solve the problem (error: 'ActionList1' is currently running) , but it's been a couple days of trying to work it out. No success yet.The error doesn't always happen; I wanted to see what would happen if I mouseoveraction on something rapidly to see what would happen and if there are error codes associated with it.
Last edited by strawberryshortcake on October 10th, 2020, 7:42 pm, edited 2 times in total.
User avatar
Yincognito
Posts: 2760
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: HELP: !Toggle (or !Activate Config) another skin (i.e. QUOTE skins) based on TIME (without using mouse action).

Post by Yincognito »

strawberryshortcake wrote: October 10th, 2020, 7:13 pm After seeing your video, I think I may have misinterpreted your earlier statement. Because the video is exactly how mines also look when I have TimeIntervalSeconds=15 .
[...]
Side Note: I'm going to be posting an issue (in a new thread maybe later today or tomorrow) with another skin -- it's regarding actiontimer. I'm going to see if I can fiddle with it to solve the problem (error: 'ActionList1' is currently running) , but it's been a couple days of trying to work it out. No success yet.The error doesn't always happen; I wanted to see what would happen if I mouseoveraction on something rapidly to see what would happen and if there are error codes associated with it.
Ah, ok then - all sorted out. :thumbup: I was sure there was some sort of misunderstanding in all this, because the code didn't produce any kind of undesirable effects (as you called them), so in theory it should have worked the same in your case (which it did, after all).

Regarding ActionTimer, that error is because you didn't properly stop the previously running action before executing a new one. In other words, the error happens if two or more such actions "overlap" from a time point of view.