Well, there is another proof for my blindness:
Couldn't be more obvious... there is a tasty "Ping" plugin in the plugins list of the Documentation site.
So yes, that was exactly what i was searching for for my project.
No powershell needed or other external stuffs.
For that reason, i share the works so far, it's rough around the edges, but maybe someone else finds this useful:
(this skin is checking the latency in every second, displaying and storing the results)
Main.ini script:The LuaText.lua file is in the same folder as the .ini:And finally, there is a log.txt file for storing the data. It saves the last 62 entries currently then it clears the file.
The perfect solution would be a clear txt file without the [Variables] part, so writing the txt with Lua as well, that needs more working.
Would be perfect when it would be stored as HH:MM:SS - X ms, would be more perfect if i could delete only the first line then add to the end the latest, and not clearing the file all the time. But that will be for later work, so far it does the basic stuff what i wanted.
Thanks for the kind help again everyone!
Couldn't be more obvious... there is a tasty "Ping" plugin in the plugins list of the Documentation site.
So yes, that was exactly what i was searching for for my project.
No powershell needed or other external stuffs.
For that reason, i share the works so far, it's rough around the edges, but maybe someone else finds this useful:
(this skin is checking the latency in every second, displaying and storing the results)
Main.ini script:
Code:
[Rainmeter]Update=1000AccurateText=1OnRefreshAction=[!CommandMeasure "LuaDel" "Run"]SkinHeight=86[Variables]rel=0MyFile=#CURRENTPATH#log.txtonoff=0Run=1[LuaRead]Measure=ScriptScriptFile="LuaText.lua"FileToRead=#CURRENTPATH#log.txt[LuaDel]Measure=PluginPlugin=RunCommandParameter=break > "#MyFile#"State=HideOutputType=ANSI[DateTimeMes]Measure=TimeFormat=%H:%M:%S[Countdown]Measure=CalcFormula=(Countdown + 15.34)*[#Run]OnUpdateAction=[!SetVariable rel "[&Countdown]"]IfAboveValue=930IfAboveAction=[!SetVariable Run 0][!CommandMeasure "LuaDel" "Run"][!UpdateMeasure Countdown][!SetVariable Run 1]DynamicVariables=1Disabled=#onoff#[MeasurePing]Measure=PluginPlugin=PingPluginDestAddress=8.8.8.8MinValue=0MaxValue=500UpdateRate=1OnUpdateAction=[!UpdateMeter MeterPing][!Redraw]Disabled=#onoff#[BaseBackground]Meter=ImageSolidColor=0,0,0X=0Y=0W=200H=86LeftMouseUpAction=[!CommandMeasure "LuaDel" "Run"][MeterPing]Meter=StringMeasureName=LuaReadX=5Y=(98-#rel#)W=200H=16FontSize=10FontColor=255,255,255,255Text="[DateTimeMes] - %1ms"OnUpdateAction=[!WriteKeyValue Variables [&DateTimeMes] " [MeasurePing]ms" "log.txt"]UpdateDivider=-1DynamicVariables=1[MeasureCount]Measure=PluginPlugin=QuotePlugin.dllPathName=log.txtSeparator=¶RegExpSubstitute=1Substitute="[^\n]+":"1","\n":"+","\+\+":"+1+","^\+":"1+","\+$":"+1"[MeasureResult]Measure=CalcFormula=[MeasureCount]IfConditionMode=1IfCondition=([MeasureResult] > 60)IfTrueAction=DynamicVariables=1[MeterCPUHistogram]Meter=HistogramMeasureName=MeasurePingX=200Y=0W=200H=86PrimaryColor=255,255,255,255SolidColor=0,0,0,100AntiAlias=1
Code:
function Initialize()sFileToRead = SELF:GetOption('FileToRead')endfunction Update()hReadingFile = io.open(sFileToRead)if not hReadingFile thenprint('LuaTextFile: unable to open file at ' .. sFileToRead)returnendsAllText = hReadingFile:read("*all")sAllText = string.gsub(sAllText, "\t", " ")io.close(hReadingFile)return tostring(sAllText)end
The perfect solution would be a clear txt file without the [Variables] part, so writing the txt with Lua as well, that needs more working.
Would be perfect when it would be stored as HH:MM:SS - X ms, would be more perfect if i could delete only the first line then add to the end the latest, and not clearing the file all the time. But that will be for later work, so far it does the basic stuff what i wanted.
Thanks for the kind help again everyone!
Statistics: Posted by rbriddickk84 — Yesterday, 7:04 pm