Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 975

Help: Rainmeter Skins • Problems with random formula and its use

$
0
0
Hi everyone, I hope you all doing well!

I'm working on a personal rainmeter skin that I want to use for few different things - and I'm trying to implement certain random feature that I have serious problems with. Let me start with some explanations:
question.jpg
As you can see in the image, I have a meter working as a button with LeftMouseUpAction. Below there are 4 meters with images. On top of them I want to place a red frame, which is a meter with the png image of a frame with transparency. What I am trying to do is put that frame over the random image after button press. So my code looks somewhat like that (I have removed what's unnecessary like positions and other meters etc)

Code:

[Rainmeter]Update=1000[MeasureRandom]Measure=CalcFormula=RandomUpdate=-1UpdateRandom=1LowBound=0HighBound=3;this one is to pick a random number from 0 to 3. Update -1 is to turn off the updating of that measure[MeterDebug]Meter=StringMeasureName=MeasureRandomText=%1;this one I just use temporarily to see how the random number changes[Button]Meter=ImageImageName=#@#Button.pngLeftMouseUpAction=[!UpdateMeasure "MeasureRandom"][!UpdateMeter "RedFrame1"][RedFrame1]Update=-1Meter=ImageImageName=#@#RedFrame.pngX=([MeasureRandom]*130+72) ;I'm using the random number to calculate the position of the frameDynamicVariables=1
the actual skin has few more meters, but they are not involved with anything above and I have removed from them any "redraw" or "update * " codes so they should not interfere. But still, the measure is constantly calculating random number during every action like MouseOver any other meter in the skin etc. and every second in fact. I'm new to this, I've red documentation, looked up some threads here on forums, is this even possible to do it with rainmeter, because I'm starting to doubt.

I also have an additional question. Assuming this can be achieved - I would also like to add 2nd frame, to "highlight" more than 1 image. Could someone guide me to such solution? I'm guessing if the code will be similar to what I already have, I could make two measures generating two different numbers, and use them to move two frames to appropriate positions. but how can I avoid situation with two frames picking the same place? it's not a huge problem, as I could always press the button again to get different result, but still, it would be great to have nice and clean solution.

Thanks in advance for any help with this one, all best!

PS: I have put the image on my own server and it doesn't show in the forum. but the link works, it leads to the image. How can I attach the image so it is displayed in the forum post?

Statistics: Posted by stoyan — 39 minutes ago — Replies 2 — Views 24



Viewing all articles
Browse latest Browse all 975

Trending Articles