Update: Solved! using DynamicVariables. thanks
Dear Rainmeter Community,
Please help. I tried to modified a Rainmeter skin (it is a inspirational quote) made by someone and make it capable to work in offline mode (without internet).
The quotes database used in here is not owned by me. Download it from the internet but lost the link, so credit to the owner. (hours to regex it though, after (also) hours searching in stackexchange).
Much of the skin functionality is working, except for [MeasureCheckNetworkNew] , nothing happen. I don't know what is wrong.
Question:
- Why when internet is connected the skin is not refreshing? update: solved! using DynamicVariables
- Why the variable value won't change? update: fixed! thanks. see the post number#2 below
Regards,
ariefcfa
---------
my system is:
Rainmeter version 4.0.0 r2746 64-bit (Jan 1 2017)
Windows 10 version 1709 64 bit
QuotePlus.ini
Code: Select all
[Rainmeter]
Author=Pepijn edited and improved by mahtpx120e
Update=1000
AccurateText=1
[Metadata]
Name=QuotePlus
Description=Displays a quote in the background, fetched from the internet (Offline capability is added by mahtpx120e)
Tags=Daily quote, internet, typography
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
;End of added Metadata
;----------
;VARIABLES
;----------
[Variables]
WebUrlQuote=http://www.quotationspage.com/data/1mqotd.js
WebUrlQuoteTest=file:///G:\RmWebQuote.txt
Minutes=60
Hours=3600
UpdateQuoteHours=12
RecheckMinutes=30
NetworkLast=-1
;----------
;MEASURES
;----------
;start offline mode code::::::::::::::::::::::::::::::::::::::
[OfflineQuotation]
UpdateDivider=30
;UpdateDivider=(#Hours#*#UpdateQuoteHours#)
Measure=Plugin
Plugin=QuotePlugin
Separator=##
PathName=#CURRENTPATH#\RmQuoteData.txt
Substitute=" -- ":"#CRLF#- ",'."':'"'
IfMatch="#CRLF#- "
IfMatchAction=[!SetOption MeterOfflineQuote Postfix " -"][!UpdateMeter MeterOfflineQuote]
IfNotMatchAction=[!SetOption MeterOfflineQuote Postfix " "][!UpdateMeter MeterOfflineQuote]
;end of OFFLINE MODE code#####################################
;start online mode code:::::::::::::::::::::::::::::::::::::::
[OnlineQuotation]
UpdateRate=30
;UpdateRate=(#Hours#*#UpdateQuoteHours#)
Measure=WebParser
Url=#WebUrlQuoteTest#
RegExp=(?siU)(?(?=.*<dt class=\\'tqpQuote\\'>(.*).</dt>))(?(?=.*.com/quotes.*\">(.*)</a>))
[OnlineQuoteText]
UpdateRate=30
;UpdateRate=(#Hours#*#UpdateQuoteHours#)
Measure=WebParser
Url=[OnlineQuotation]
StringIndex=1
Substitute="\":"'","":"null"
[OnlineQuoteAuthor]
UpdateRate=30
;UpdateRate=(#Hours#*#UpdateQuoteHours#)
Measure=WebParser
Url=[OnlineQuotation]
StringIndex=2
Substitute="":"Unknown"
;end of ONLINE MODE code#######################################
;Decide which mode
[MeasureCheckNetworkNew]
;[b][color=#FF0000]NOT WORKING :([/color][/b]
UpdateDivider=5
;UpdateDivider=(#Minutes#*30)
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
IfCondition=MeasureCheckNetworkNew > #NetworkLast#
IfTrueAction=[!UpdateMeasure OnlineQuotation][!UpdateMeasure OnlineQuoteText][!UpdateMeasure OnlineQuoteAuthor][!UpdateMeasure MeasureDecide][!SetVariable NetworkLast [MeasureCheckNetworkNew]]
IfFalseAction=[!SetVariable NetworkLast [MeasureCheckNetworkNew]]
[MeasureDecide]
UpdateDivider=30
;UpdateDivider=(#Hours#*6)
Measure=String
String=[OnlineQuoteText]
Ifmatch="null"
IfMatchAction=[!Hidemeter MeterOnlineQuote][!Showmeter MeterOfflineQuote]
IfNotMatchAction=[!Hidemeter MeterOfflineQuote][!Showmeter MeterOnlineQuote]
DynamicVariables=1
[measuredummycount]
Measure=Calc
Formula=measuredummycount+1
;end of measures
;----------
;METERS
;----------
[meterdummycount]
METER=String
solidcolor=0,255,0,150
FontColor=255,255,255,225
measurename=measuredummycount
FontSize=20
X=#SCREENAREAWIDTH#
padding=15,15,15,15
StringAlign=Right
Text=Count %1
[meterdummynetwork]
METER=String
solidcolor=0,255,0,150
FontColor=255,255,255,225
measurename=MeasureCheckNetworkNew
FontSize=20
y=70r
X=#SCREENAREAWIDTH#
padding=15,15,15,15
StringAlign=Right
Text=NetNew %1#CRLF#NetLast #NetworkLast#
[MeterOnlineQuote]
;SolidColor=255,0,0,100
MeasureName=OnlineQuoteText
MeasureName2=OnlineQuoteAuthor
Text="%1"#CRLF#- %2 -
Meter=String
FontColor=255,255,255,225
FontFace=Calibri
FontSize=24
AntiAlias=1
StringAlign=RightCenter
ClipString=1
Padding=5,5,45,5
W=((#SCREENAREAWIDTH#/3)+100)
H=(#SCREENAREAHEIGHT#/2)
X=#SCREENAREAWIDTH#
Y=(#SCREENAREAHEIGHT#/2)
InlineSetting=Weight | 100
InlinePattern=.*#CRLF#- (.*)
InlineSetting2=Italic
InlinePattern2=.*#CRLF#- (.*)
InlineSetting3=Size | 18
InlinePattern3=.*#CRLF#- (.*)
[MeterOfflineQuote]
;SolidColor=0,0,255,100
MeasureName=OfflineQuotation
Text=%1
Meter=String
FontColor=255,255,255,225
FontFace=Calibri
FontSize=24
AntiAlias=1
StringAlign=RightCenter
ClipString=1
Padding=5,5,45,5
W=((#SCREENAREAWIDTH#/3)+100)
H=(#SCREENAREAHEIGHT#/2)
X=#SCREENAREAWIDTH#
Y=(#SCREENAREAHEIGHT#/2)
InlineSetting=Weight | 100
InlinePattern=.*#CRLF#- (.*)
InlineSetting2=Italic
InlinePattern2=.*#CRLF#- (.*)
InlineSetting3=Size | 18
InlinePattern3=.*#CRLF#- (.*)
"Once a new technology starts rolling, if you're not part of the steamroller, you're part of the road." -- Stewart Brand##
"Good judgement comes from experience, and experience comes from bad judgement." -- Fred Brooks##
"Plan to throw one away, you will anyhow." -- Fred Brooks##
"C++ tries to guard against Murphy, not Machiavelli." -- Damian Conway##
"Style distinguishes excellence from accomplishment." -- James Coplien##
"Learning is not compulsory. Neither is survival." -- W. Edwards Deming##
"To iterate is human, to recurse divine." -- L. Peter Deutsch##
"Do not worry about your difficulties in mathematics. I can assure you that mine are still greater." -- Albert Einstein##
"Make everything as simple as possible, but not simpler." -- Albert Einstein##
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -- Albert Einstein##
"I have always found that plans are useless, but planning is indispensable." -- Dwight Eisenhower##