It is currently April 20th, 2024, 10:28 am

Connected Bluetooth device (RegExpSubstitute)

Get help with creating, editing & fixing problems with skins
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Connected Bluetooth device (RegExpSubstitute)

Post by StArL0rd84 »

tass_co wrote: September 27th, 2022, 2:54 pm There is something wrong.
Actually, the code that balala wrote works.
Please install the skin file below and try again!
Code works for me.
(Webparser is update to every 10 sec + Left Button run BT)

GIF 27.09.2022 17-51-26.gif

BtDiscovery_2.0.rmskin

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure mBluetoothDevicePairing "run"]

[Variables]
BluetoothDevicePairing=#@#BluetoothDevicePairing.exe

[mBluetoothDevicePairing]
Measure=Plugin
Plugin=RunCommand
Program=#BluetoothDevicePairing#
Parameter=discover
OutputType=ANSI
OutputFile=#@#TestFile.txt
DynamicVariables=1
UpdateDivider=-1
FinishAction=[!UpdateMeasure MeasureText][!UpdateMeter *][!Redraw]

[MeasureText]
Measure=WebParser
Url=file://#@#TestFile.txt
RegExp=(?siU)^(.*)$
RegExpSubstitute=1
Substitute="^(.*)\n":"#CRLF#","-":"",".*\|Connected\s*\|(.*)\|.*\n":"\1#CRLF#",".*\|Paired\s*\|(.*)\|.*\n":"",".*\|\s*\|(.*)\|.*\n":"","Start discovering devices for 10 seconds":"","^#CRLF#":""
UpdateRate=10

[MeterString]
Meter=String
MeasureName=MeasureText
X=0
Y=0
FontColor=255,255,255,255
FontFace=Segoe UI
FontSize=16
StringEffect=Shadow
SolidColor=0,0,0,255
AntiAlias=1
Text=Output: %1
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure mBluetoothDevicePairing "run"]
Yep, that got it working for me.
Had to ad another "#CRLF#":"" to the end still, but that did it.

Thank you everyone.
You rock :thumbup:
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
balala
Rainmeter Sage
Posts: 16148
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Connected Bluetooth device (RegExpSubstitute)

Post by balala »

StArL0rd84 wrote: September 27th, 2022, 3:29 pm Yep, that got it working for me.
Had to ad another "#CRLF#":"" to the end still, but that did it.
Glad from my side if you got it working finally.