It is currently December 15th, 2019, 6:34 am

Trying to learn - having some issues

Help with creating, editing & fixing problems with skins
User avatar
CoffeeJoe
Posts: 17
Joined: November 6th, 2019, 4:19 am

Trying to learn - having some issues

CoffeeJoe » November 8th, 2019, 5:02 am

Hi,
Just started trying to work with Rainmeter (2 weeks I guess)
I have lots of questions
The documentation seems abstract to me, its great and I's sure its all there but inaccessible in that format (for me)

What i need is a place that has examples I can tear apart and see how they work.
My biggest need is how to manage functions - where in other languages I can put a batch of commands together - call it when I need it - send it some data - and it gives me what I asked for, or it does what I told it to do.

Any suggestions of things I can look at or experiment with? The more I can disassemble, the faster I will be able to pick this up and run with it.

Example: I created an image meter - I want it to move a random distance from its starting point - randomly (a bug scuttling to a new spot)
-I want it to draw a random number on an update cycle -> if it matches a "yes" condition - pick a new X&Y position (from a list of predefined positions) and move there... at a rate of about 2 pixels per second. Some aspects of LUA are amazingly simple while things like this that could be simple in other languages, allude me - I don't even know where in my skin to setup to check for conditions - is this a measure? I created a random Calc measure but it only fires once and the value never seems to change unless I update the whole skin with a manual !Refresh. There are parts I obviously don't get yet.

I'm not complaining it takes many lines of code to get Autoit just to draw a transparent PNG on the desktop, and many many more to make it clickable, much less draggable... Rainmeter has sparked new creativity with its sheer potential - it just seems frustratingly beyond my experience. Help?
User avatar
balala
Rainmeter Sage
Posts: 9267
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to learn - having some issues

balala » November 8th, 2019, 5:09 pm

CoffeeJoe wrote:
November 8th, 2019, 5:02 am
My biggest need is how to manage functions - where in other languages I can put a batch of commands together - call it when I need it - send it some data - and it gives me what I asked for, or it does what I told it to do.
In native Rainmeter this isn't possible. Rainmeter definitely isn't a programming language. But Lua is and such Lua scripts can be used into Rainmeter. Since the Inline Lua is accessible, an almost similar behavior can be achieved. You can send some data from Rainmeter to a properly written Lua script, then get a returned value.
CoffeeJoe wrote:
November 8th, 2019, 5:02 am
What i need is a place that has examples I can tear apart and see how they work.
This forum is a such place. There have been dissected a lot of codes, explained a lot of things. And if you can't find how to achieve something specific, you can come anytime with a question. Most probably sooner or later (probably sooner) you'll get an reply, people will help you.
CoffeeJoe wrote:
November 8th, 2019, 5:02 am
Any suggestions of things I can look at or experiment with? The more I can disassemble, the faster I will be able to pick this up and run with it.
My recommendation is to get some skin and start to modify it. In meantime you can read both, the documentation (which is extremely well written - this is my opinion) and this forum. Here you can get answers to a lot of questions, if you have patience and will to find the right answers. Just keep searching...
CoffeeJoe wrote:
November 8th, 2019, 5:02 am
Example: I created an image meter - I want it to move a random distance from its starting point - randomly (a bug scuttling to a new spot)
-I want it to draw a random number on an update cycle -> if it matches a "yes" condition - pick a new X&Y position (from a list of predefined positions) and move there... at a rate of about 2 pixels per second. Some aspects of LUA are amazingly simple while things like this that could be simple in other languages, allude me - I don't even know where in my skin to setup to check for conditions - is this a measure? I created a random Calc measure but it only fires once and the value never seems to change unless I update the whole skin with a manual !Refresh. There are parts I obviously don't get yet.
Even if this isn't exactly what have you described, here is a simple example:

Code: Select all

[Rainmeter]
Update=1000

[Variables]

[MeasureX]
Measure=Calc
Formula=Random
LowBound=0
HighBound=500
UpdateRandom=1

[Meter]
Meter=Image
X=[MeasureX]
Y=0
W=100
H=50
SolidColor=255,240,0
DynamicVariables=1
To get the yellow rectangle not to move, just have to replace the UpdateRandom=1 option of the [MeasureX] measure with UpdateRandom=0.
As can be seen, many things can be done easily.
CoffeeJoe wrote:
November 8th, 2019, 5:02 am
I'm not complaining it takes many lines of code to get Autoit just to draw a transparent PNG on the desktop, and many many more to make it clickable, much less draggable...
No need to work with AutoIt for a such task. Rainmeter can do all this natively. Partially you can see this above.
User avatar
CoffeeJoe
Posts: 17
Joined: November 6th, 2019, 4:19 am

Re: Trying to learn - having some issues

CoffeeJoe » November 8th, 2019, 5:27 pm

I just posted in a new thread a specific piece of code that I was stuck with when you posted this reply.
Thank you for the assistance, you rock. :thumbup:

I'm off to look at what you made and see how it works.

Thanks again :great:
User avatar
balala
Rainmeter Sage
Posts: 9267
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to learn - having some issues

balala » November 8th, 2019, 5:52 pm

CoffeeJoe wrote:
November 8th, 2019, 5:27 pm
I just posted in a new thread a specific piece of code that I was stuck with when you posted this reply.
And as seen, you got a reply from jsmorley. :thumbup:
CoffeeJoe wrote:
November 8th, 2019, 5:27 pm
I'm off to look at what you made and see how it works.
Feel free to come back if you have any question.
User avatar
CoffeeJoe
Posts: 17
Joined: November 6th, 2019, 4:19 am

Re: Trying to learn - having some issues

CoffeeJoe » November 8th, 2019, 6:24 pm

balala wrote:
November 8th, 2019, 5:52 pm
Feel free to come back if you have any question.
I'll always have questions but they will get harder as we go :)
?? So when my skin is moving on the screen - is there a way to make it detect and avoid overlap with other skins?
Not asking for a solution, but maybe a skin I could look at, thats already doing something like this...

The force that allows skins to "snap" wouldn't prevent the skin in motion from plowing right through

Thanks
User avatar
balala
Rainmeter Sage
Posts: 9267
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to learn - having some issues

balala » November 8th, 2019, 6:33 pm

CoffeeJoe wrote:
November 8th, 2019, 6:24 pm
So when my skin is moving on the screen - is there a way to make it detect and avoid overlap with other skins?
No, unfortunately a skin doesn't know (or care) where the others are placed. No way for this.
User avatar
sl23
Posts: 408
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Trying to learn - having some issues

sl23 » November 8th, 2019, 7:34 pm

CoffeeJoe wrote:
November 8th, 2019, 5:02 am
The documentation seems abstract to me, its great and I's sure its all there but inaccessible in that format (for me)
I have to say that I agree with this statement. I too find the manual layout a bit lacking at times. Though it's well written, it's the actual use of each line of code that can be puzzling at times. Especially when looking at something new such as Sliding or Containers.
balala wrote:
November 8th, 2019, 6:33 pm
No, unfortunately a skin doesn't know (or care) where the others are placed. No way for this.
Isn't the Setting - "Snap to edges" the same thing?
User avatar
balala
Rainmeter Sage
Posts: 9267
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to learn - having some issues

balala » November 8th, 2019, 8:36 pm

sl23 wrote:
November 8th, 2019, 7:34 pm
I have to say that I agree with this statement. I too find the manual layout a bit lacking at times. Though it's well written, it's the actual use of each line of code that can be puzzling at times. Especially when looking at something new such as Sliding or Containers.
Well, the opinion of the users are definitely different. Me personally am using extremely much the manual and found a lot of answers there to extremely many questions. Definitely can be improved (what can't?), but it's good. Definitely it is, at least from my point of view.
sl23 wrote:
November 8th, 2019, 7:34 pm
Isn't the Setting - "Snap to edges" the same thing?
"Snap to edges" is probably the most obscure Rainmeter setting. At least from my point of view. But I keep my opinion, that skins don't know where the other skins are placed. Any skin knows its own position (how wouldn't it know?) but don't know anything about the other skins.
User avatar
sl23
Posts: 408
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Trying to learn - having some issues

sl23 » November 8th, 2019, 9:47 pm

Don't get me wrong! It's a fantastic source of help. But as a newcomer I found it lacking when trying to understand the use of the code.
User avatar
balala
Rainmeter Sage
Posts: 9267
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to learn - having some issues

balala » November 8th, 2019, 9:54 pm

sl23 wrote:
November 8th, 2019, 9:47 pm
But as a newcomer I found it lacking when trying to understand the use of the code.
Yep, agree, probably for a newcomer it can be indeed a little bit hard to be used.