It is currently July 23rd, 2024, 9:47 am

[Trick | Guide] Improvised skin console

Tips and Tricks from the Rainmeter Community
User avatar
Posts: 209
Joined: July 12th, 2020, 7:47 am
Location: Ada, Garden City

[Trick | Guide] Improvised skin console

Post by deflore08 »

Hey there!

Sometimes i feel broken when i have to edit some things in my code to see a changes, for example: to stop some counters on a flight, to change variables and so on. I do not want to make this changes permanently, so i began to play with Input plugin to make an improvised console for my skin.

The idea is next: we catch input and use it as a Bang, then see what happens. So, the following code do this things:

Code: Select all


; --- #Command_Trigger# triggers the conditional measure; #Command_Input# is your input

 Command_Trigger                  = 0
 Command_Input                    = 

; --- Input Measure. 1st command writes and sets the #Command_Input# variable then set #Command_Trigger# to 1

 Measure                          = PLUGIN
 Plugin                           = InputText
 MeterStyle                       =
 X                                = 0
 Y                                = 0
 W                                = 150
 H                                = 15
 SolidColor                       = 0,0,0,255
 FontColor                        = 255,255,255,255
 DefaultValue                     = #Command_Input#
 FocusDismiss                     = 1
 DynamicVariables                 = 1

 Command1                         = [!WriteKeyValue Variables Command_Input " $UserInput$" ""][!SetVariable Command_Input [sensor.COMMAND_INPUT]][!UpdateMeter text.dynamic.COMMAND_INPUT][!Redraw]
 Command2                         = [!SetVariable Command_Trigger "1"][!UpdateMeasure formula.COMMAND_INPUT]

; --- Conditional measure. When #Comman_Trigger# = 1 it executes your input as a Bang. Variable is nested so you do not need to write [!Refresh] - just "refresh"

 Measure                          = CALC
 Formula                          = #Command_Trigger#
 DynamicVariables                 = 1
     ifCondition                  = #CURRENTSECTION# = 1
          ifTrueAction            = [!#Command_Input#] [!Delay 200][!SetVariable Command_Trigger "0"][!UpdateMeasure #CURRENTSECTION#]
Thus we can just type refresh instead [!Refresh] to get our skin refreshed. This little code part made my life much easier and skin manage as more flexible.

Of course, it's a quick sketch and i believe there is a much ways to make it better, faster, shorter, and more beautiful, so i will extend this post if you will suggest more options and approaches. So let the games begin. :)
Image * Image * Image * Image