It is currently September 21st, 2019, 5:31 am

Hotkey Plugin help

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 8631
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hotkey Plugin help

balala » March 25th, 2019, 4:27 pm

qwerky wrote:
March 24th, 2019, 10:17 pm
In the LeftMouseUpAction of Meter Base, you have an [!UpdateMeasure "#CURRENTSECTION#"]. Should that be [!UpdateMeter "#CURRENTSECTION#"]? If so, would that not obviate the need for the final [!UpdateMeter "Base"]? Or if not, then what does [!UpdateMeasure "#CURRENTSECTION#"] refer to when used in a meter? :Whistle
Yep, you're right I messed it up again!!! Sorry, my fault.
Yes, I wrote the bangs on the [MeasureToggle] measure, then copied them to the [Base] meter and although I should have to modify them, I forgot.
On the LeftMouseUpAction option of the [Base] meter there is an [!UpdateMeter "Base"] bang (last one). The !UpdateMeasure should have to update the [MeasureToggle] measure. So, on the [Base] meter, the LeftMouseUpAction option should have to be:

Code: Select all

[Base]
...
LeftMouseUpAction=[!SetVariable Menu "(1-#Menu#)"][!UpdateMeasure "MeasureToggle"][!UpdateMeasure "MeasureMenu"][!UpdateMeter "Base"]
Fixed in my previous post too.
Sorry for my mistake and thanks...
User avatar
qwerky
Posts: 181
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Hotkey Plugin help

qwerky » March 25th, 2019, 7:12 pm

No need to apologize. Much appreciate all the help you've given to me and to many, many others here. :D

Just out of curiosity, can #CURRENTSECTION# be used in a meter as well (not just a measure)? If so, then your last bang could also have used it, rather than using the meter name Base. Just askin'. ;-)
User avatar
balala
Rainmeter Sage
Posts: 8631
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hotkey Plugin help

balala » March 25th, 2019, 7:38 pm

qwerky wrote:
March 25th, 2019, 7:12 pm
Just out of curiosity, can #CURRENTSECTION# be used in a meter as well (not just a measure)? If so, then your last bang could also have used it, rather than using the meter name Base. Just askin'. ;-)
Yes, it can. And yes there the Base also can be replaced with #CURRENTSECTION#.
User avatar
qwerky
Posts: 181
Joined: April 10th, 2014, 12:31 am
Location: Canada

Re: Hotkey Plugin help

qwerky » March 25th, 2019, 7:52 pm

:17good
Nilvarno
Posts: 18
Joined: March 24th, 2019, 5:52 pm

Re: Hotkey Plugin help

Nilvarno » March 25th, 2019, 11:23 pm

Thank again for your help!
User avatar
balala
Rainmeter Sage
Posts: 8631
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hotkey Plugin help

balala » March 26th, 2019, 7:59 am

Nilvarno wrote:
March 25th, 2019, 11:23 pm
Thank again for your help!
Finally have you succeeded getting it to work as wanted?
Nilvarno
Posts: 18
Joined: March 24th, 2019, 5:52 pm

Re: Hotkey Plugin help

Nilvarno » March 26th, 2019, 10:57 am

Yes, the skin is going great, it's taking lots of energy but i definitely learnt many things with rainmeter :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 8631
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hotkey Plugin help

balala » March 26th, 2019, 12:06 pm

Nilvarno wrote:
March 26th, 2019, 10:57 am
it's taking lots of energy but i definitely learnt many things with rainmeter :thumbup:
That's good!
Nilvarno
Posts: 18
Joined: March 24th, 2019, 5:52 pm

Re: Hotkey Plugin help

Nilvarno » March 30th, 2019, 4:24 pm

balala wrote:
March 26th, 2019, 12:06 pm
That's good!
Hi again, something new hapenned. basically, this is the code to show up the menu:

Code: Select all

[MeasureToggle]
Measure=Plugin
Plugin=HotKey
HotKey=CTRL NUM0
KeyDownAction=[!SetVariable Menu "(1-#Menu#)"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeasure "MeasureMenu"]
DynamicVariables=1

[MeasureMenu]
Measure=Calc
Formula=#Menu#
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!ShowMeterGroup "Menu"][!HideMeterGroup "Tile"][!Redraw]
IfFalseAction=[!HideMeterGroup "Menu"][!HideMeterGroup "Tile"][!Redraw]
DynamicVariables=1
Which you did and works perfectly, now this is the code for an image that, once clicked on, closes the menu and starts the program:

Code: Select all

[Multy2]
Meter=image
ImageName=Tile.B2.png
X=110
Y=20
w=1920
h=1080
Group=Tile | Multy2
LeftMouseDownAction=!Execute ["S:\Games\Riot\League Of Legends\LeagueClient.exe"][!HideMeterGroup "Tile"][!HideMeterGroup "Menu"][!Redraw]
Now, the problem is that once clicked, the program starts and the menu closes, but when i use the button combination again to show up the menu, i have to do it twice, because the code hides the menu and doesn't set the menu variable to 0. i tried to switch the !hidemeter thing with:

Code: Select all

[!SetVariable Menu "(1-#Menu#)"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeasure "MeasureMenu"]
but it doesn't work. i don't know what i'm doing wrong, what should i do to set menu variable to 0 after clicking the program? thanks
User avatar
balala
Rainmeter Sage
Posts: 8631
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hotkey Plugin help

balala » March 30th, 2019, 5:02 pm

Nilvarno wrote:
March 30th, 2019, 4:24 pm
Now, the problem is that once clicked, the program starts and the menu closes, but when i use the button combination again to show up the menu, i have to do it twice, because the code hides the menu and doesn't set the menu variable to 0. i tried to switch the !hidemeter thing with:

Code: Select all

[!SetVariable Menu "(1-#Menu#)"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeasure "MeasureMenu"]
but it doesn't work. i don't know what i'm doing wrong, what should i do to set menu variable to 0 after clicking the program? thanks
Try this: LeftMouseUpAction=["S:\Games\Riot\League Of Legends\LeagueClient.exe"][!SetVariable Menu "0"][!UpdateMeasure "MeasureMenu"][!UpdateMeasure "MeasureToggle"].
The posted !SetVariable bangs isn't the best solution, because when clicking the [Multy2] meter, the menu always has to closed. That's why I'd set the value of the Menu variable not to (1-#Menu#), but to 0. This closes the menu (through the [MeasureMenu] measure). If you're using the (1-#Menu#) value to set the variable to, the meter uses dynamic variables (the value of the Menu variable is changing dynamically), so a DynamicVariables=1 option has to be added to the meter. But that's not even needed, being useless. Setting the variable to 0 is completely enough and doesn't require to set the dynamic variables.
But there are two other problems as well, with the posted piece of code:
  • The !Execute bang is deprecated and you don't have to use it. Remove it.
  • Instead of LeftMouseDownAction, better is to use LeftMouseUpAction. Here you can find out why.