It is currently April 18th, 2024, 6:57 pm

Skin with paping

Get help with creating, editing & fixing problems with skins
fruitsoup
Posts: 5
Joined: July 19th, 2019, 5:16 pm

Skin with paping

Post by fruitsoup »

Hey I'm making a ping skin on rainmeter with paping. Just 1 problem. I see "connected to ,protocol etc." https://i.imgur.com/2ErnqTi.png

I just want to see the ping. What am I doing wrong? here's the code


Code: Select all

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

[Variables]
PathToPaPing=#@#Addons\PaPing.exe
Server=52.29.246.214
Port=11001
PortDesc=HTTP
HowOften=60
[MeasureUpdater]
Measure=Calc
Formula=(MeasureUpdater % #HowOften#) + 1
IfEqualValue=1
IfEqualAction=[!CommandMeasure MeasurePaPing1 "Run"]

[MeasurePaPing1]
Measure=Plugin
Plugin=RunCommand
Parameter=#PathToPaPing# -p #port# #server# -c 1 | Find "protocol"
OutputType=ANSI
FinishAction=[!EnableMeasure MeasureCheck1][!UpdateMeasure MeasureCheck1]

[MeasureCheck1]
IfMatchAction=[!SetOption MeterPaPing1 Text "#-p#][!SetOption MeterPaPing1 FontColor "255,255,255,255"][!UpdateMeter *][!Redraw]

[MeterPaPing1]
Meter=String
MeasureName=MeasurePaPing1
FontSize=10
FontColor=255,255,255,255
SolidColor=47,47,47,100
Padding=5,5,5,5
AntiAlias=1
Text=%1
I know [MeasurePaPing1] is kinda messed up but even if I remove the whole thing it still remain the same.
Or if there is anything better than paping tell me
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin with paping

Post by balala »

fruitsoup wrote: July 19th, 2019, 5:21 pm I know [MeasurePaPing1] is kinda messed up but even if I remove the whole thing it still remain the same.
We (or at least me definitely) can't check what does the [MeasurePaPing1] measure, because I don't have the needed executable (PaPing.exe). However as far as I can tell without checking the measure, it look alright.
However there is another problem. Specifically with the [MeasureCheck1] measure. There isn't possible to add a single IfMatchAction option to a measure and nothing else. First and most important is to set the type of the measure, adding a Measure=WHATEVER to it. Depending on what type is the measure, you have to add further options. For instance if [MeasureCheck1] is a String measure (my tip), you have to add a Measure=String option, together with a String=Something (String=[MeasurePaPing1] for example). If you've added this last String=[MeasurePaPing1] option, a DynamicVariables=1 option is also required. And finally IfMatchAction doesn't make any sense without an IfMatch option, which also has to be added. That option checks if the value returned by the measure matches something. Not knowing your exact intention, is extremely hard to tell you more, so a few details would be required.
Also note one more thing: is justified a such small Update value, within the [Rainmeter] section (Update=30)? I doubt. Instead I'd suggest to use the default Update value (Update=1000). At least in the posted code there is nothing which would require to set this low Update value.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin with paping

Post by jsmorley »

I have an example skin that uses PaPing ok...

Code: Select all

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

[Metadata]
Name=PaPingPort
Author=JSMorley
Information=Use the included RunCommand plugin and PaPing.exe utility to check the status of a particular TCP port on a server.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Feb 27, 2015

[Variables]
PathToPaPing=#@#Addons\PaPing.exe
Server=rainmeter.net
Port=80
PortDesc=HTTP
HowOften=60

[MeasureUpdater]
Measure=Calc
Formula=(MeasureUpdater % #HowOften#) + 1
IfEqualValue=1
IfEqualAction=[!CommandMeasure MeasurePaPing1 "Run"]

[MeasurePaPing1]
Measure=Plugin
Plugin=RunCommand
Parameter=""#PathToPaPing#" -p #Port# #Server# -c 1"
OutputType=ANSI
FinishAction=[!EnableMeasure MeasureCheck1][!UpdateMeasure MeasureCheck1]

[MeasureCheck1]
Measure=String
String=[MeasurePaPing1]
IfMatch=(?si)Connected to
IfMatchAction=[!SetOption MeterPaPing1 Text "Connected to #Server# on Port #Port# (#PortDesc#)][!SetOption MeterPaPing1 FontColor "169,240,161,255"][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterPaPing1 Text "No Connection to #Server# on Port #Port# (#PortDesc#)][!SetOption MeterPaPing1 FontColor "217,111,111,255"][!UpdateMeter *][!Redraw]
DynamicVariables=1
Disabled=1

[MeterPaPing1]
Meter=String
FontSize=11
FontColor=240,226,173,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Checking
1.png
You do not have the required permissions to view the files attached to this post.
fruitsoup
Posts: 5
Joined: July 19th, 2019, 5:16 pm

Re: Skin with paping

Post by fruitsoup »

balala wrote: July 19th, 2019, 6:02 pm Not knowing your exact intention, is extremely hard to tell you more, so a few details would be required.
My intention is just to remove "connected to" and all the other text from the skin except the ping. Only the ping must be shown.
fruitsoup
Posts: 5
Joined: July 19th, 2019, 5:16 pm

Re: Skin with paping

Post by fruitsoup »

jsmorley wrote: July 19th, 2019, 6:04 pm I have an example skin that uses PaPing ok...

Code: Select all

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

[Metadata]
Name=PaPingPort
Author=JSMorley
Information=Use the included RunCommand plugin and PaPing.exe utility to check the status of a particular TCP port on a server.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Feb 27, 2015

[Variables]
PathToPaPing=#@#Addons\PaPing.exe
Server=rainmeter.net
Port=80
PortDesc=HTTP
HowOften=60

[MeasureUpdater]
Measure=Calc
Formula=(MeasureUpdater % #HowOften#) + 1
IfEqualValue=1
IfEqualAction=[!CommandMeasure MeasurePaPing1 "Run"]

[MeasurePaPing1]
Measure=Plugin
Plugin=RunCommand
Parameter=""#PathToPaPing#" -p #Port# #Server# -c 1"
OutputType=ANSI
FinishAction=[!EnableMeasure MeasureCheck1][!UpdateMeasure MeasureCheck1]

[MeasureCheck1]
Measure=String
String=[MeasurePaPing1]
IfMatch=(?si)Connected to
IfMatchAction=[!SetOption MeterPaPing1 Text "Connected to #Server# on Port #Port# (#PortDesc#)][!SetOption MeterPaPing1 FontColor "169,240,161,255"][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterPaPing1 Text "No Connection to #Server# on Port #Port# (#PortDesc#)][!SetOption MeterPaPing1 FontColor "217,111,111,255"][!UpdateMeter *][!Redraw]
DynamicVariables=1
Disabled=1

[MeterPaPing1]
Meter=String
FontSize=11
FontColor=240,226,173,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Checking

1.png
I tried this and it allows me to remove the text which is what I want. The problem is it doesn't show the ping :/
fruitsoup
Posts: 5
Joined: July 19th, 2019, 5:16 pm

Re: Skin with paping

Post by fruitsoup »

An easy workaround for this would be cropping the skin to only see the ping numbers. But I don't know how to do that. I found guides to crop images but not the actual skins with letters

ps: I was able to crop from right side to left side as you can see https://i.imgur.com/VDjMCTp.png
Now I need to find a way to crop from left side to right side and I'll be good
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin with paping

Post by balala »

fruitsoup wrote: July 20th, 2019, 9:23 am My intention is just to remove "connected to" and all the other text from the skin except the ping. Only the ping must be shown.
I'm still not sure if the "ping" is returned by the [MeasurePaPing1] measure (as said, not having the needed executable, can't check it), when it is executed (ran). If this measure returns what can be seen into the posted image (Connected to XXX.XXX.XXX.XXX: time=XXXms protocol=TCP port=XXXXX), then you can use a substitution to remove all undesired parts of the returned string. If I am right, add a RegExpSubstitute=1 option to the [MeasurePaPing1] measure, along with a Substitute=".*(\d{2,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*":"\1" option.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin with paping

Post by jsmorley »

User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Skin with paping

Post by balala »

Ok, let's see. I'll give it a try a little bit later today.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin with paping

Post by jsmorley »

Code: Select all

C:\Users\Jeffrey\Documents\Rainmeter\Skins\PaPingPort\@Resources\Addons>paping -p 80 -c 1 www.rainmeter.net
paping v1.5.5 - Copyright (c) 2011 Mike Lovell

Connecting to www.rainmeter.net on TCP 80:

Connected to 104.28.3.61: time=15.67ms protocol=TCP port=80

Connection statistics:
        Attempted = 1, Connected = 1, Failed = 0 (0.00%)
Approximate connection times:
        Minimum = 15.67ms, Maximum = 15.67ms, Average = 15.67ms

1.png
You do not have the required permissions to view the files attached to this post.