Measures

NUOL measure

A NUOL measure is a disabled measure which when updated executes a bang.

[Rainmeter]
OnRefreshAction=[!Delay 20][!EnableMeasureGroup NUOL]
; having a delay prevents the measures from updating & executing when the module is first loaded

[ACTIONHELLOWORLD]
Measure=Calc        ; Any unreactive measure type is fine
OnUpdateAction=[!Log "HelloWorld!"]     ; can be any action
Group=NUOL
Disabled=1

And to call this bang, you can simply update the measure with !UpdateMeasure ACTIONHELLOWORLD

But why not just call a variable with a bang value? That will work... but only when called in the currentconfig. Using a NUOL measure you can call the bangs from a different config with !UpdateMeasure ACTIONHELLOWORLD "MainConfigName\Main"

mToggle measure

mToggle measures are used in most hotkey modules toggle It is not recommended to use mToggle anymore, instead, use lua to achieve better results

A mToggle measure is a measure which when called toggles and execute actions. We'll be using NUOL measures to support calling functions from different configs.

[mToggle]
Measure=Calc
Formula=1 - mToggle            ; every time the measure updates, the value toggles
IfCondition=mToggle = 0
IfTrueAction=[!UpdateMeasure ACTIONLOAD]
IfFalseAction=[!UpdateMeasure ACTIONUNLOAD]

The default value of mToggle is always 1, and you cannot have it default 0.

This mToggle works, but you are unable to set it to either value with an action. Therefore, we'll be needing another measure to set mToggle's value: mToggleSet

[mToggleSet]
Measure=Calc
Formula=mToggle
IfCondition=mToggle = 0                ; This allows the measure to always set mToggle's value to 1
iftrueaction=[!UpdateMeasure mToggle]
ifconditionmode=1
Group=NUOL
Disabled=1

Last updated