It is currently August 17th, 2019, 3:55 pm

Move a skin by using a LUA Script!

Discuss the use of Lua in Script measures.
User avatar
Mordasius
Posts: 1061
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Move a skin by using a LUA Script!

Mordasius » December 22nd, 2013, 3:06 pm

I'm not really sure what you are trying to do here :???:

But, whatever it is, I don't think putting

Code: Select all

OnRefreshAction=[!WriteKeyValue #Title# X #CURRENTCONFIGX# "#@#Layout\Position.inc"][!WriteKeyValue #Title# Y #CURRENTCONFIGY# "#@#Layout\Position.inc"][!Update]
in the [Rainmeter] section, or anywhere else, is going to help.

Firstly, you need to check the parameters for !WriteKeyValue. They are: Section, Key, Value, FilePath. Variables are normally written to the [Variables] section and you don't need to write the #CURRENTCONFIGX# or #CURRENTCONFIGY# values to a file because they are Built-In Variables that can be used at any time to move the other skin directly to that position (as I did in the example above).

Secondly, I don't think putting [!Update] in the OnRefreshAction is going to serve any useful purpose because it will simply update all measures and meters in the current skin which happens anyway when the skin is refreshed.

Thirdly, I don't understand why you need to read #CURRENTCONFIGX# with the Slider.ini file since Rainmeter stores the last used value in ..UserName\AppData\Roaming\Rainmeter\Rainmeter.ini and uses it when Slider.ini is loaded.

Apart from those little niggles, I'm glad to hear you've got it licked.. :-)
FlorianG
Posts: 20
Joined: September 18th, 2013, 11:31 am

Re: Move a skin by using a LUA Script!

FlorianG » December 22nd, 2013, 3:39 pm

ok, ill try to explain it, iam not so good in english btw...

I have a skin named [Firefox] (Panel on my Desktop)

i need your slider to move the skin verticaly.

Code: Select all

OnRefreshAction=[!WriteKeyValue #Title# X #CURRENTCONFIGX# "#@#Layout\Position.inc"][!WriteKeyValue #Title# Y #CURRENTCONFIGY# "#@#Layout\Position.inc"][!Update]
This Code in [Firefox] find the position of the skin. it write in the Position.inc the X and Y coordinates.
so when i use your slider, i want to move the skin from the position in Position.inc.

...
if i read this by myself, i don't understand what i need. i hope you do this :D
User avatar
Mordasius
Posts: 1061
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Move a skin by using a LUA Script!

Mordasius » December 22nd, 2013, 4:23 pm

Sorry, but your earlier diagram showed the Firefox box moving horizontally with the slider movement (not vertically) so that is what I put in the example. As to:
FlorianG wrote:This Code in [Firefox] find the position of the skin. it write in the Position.inc the X and Y coordinates. so when i use your slider, i want to move the skin from the position in Position.inc.
I still have no idea why you think you need to use values stored in Position.inc

I suspect the only way we are going to make any progress on this is if you first work through the examples in the Basic Tutorials. You'll need to have an understanding of how meters, measures, bangs and variables work together before you'll be able to get your FireFox / slider skins working as you expect.
FlorianG
Posts: 20
Joined: September 18th, 2013, 11:31 am

Re: Move a skin by using a LUA Script!

FlorianG » December 22nd, 2013, 5:49 pm

No, i mean horizontally thats right, iam sorry... :(

ok, i have upload a little video to explain it a little better...

i will move the Firefox skin from there position with your slider. but at the moment, when i use your slider, the skin will change the position over your slider.
so, i think i need to read the position of the Firefox skin first (1), implement this in your slider (2) to move the skin from there actually position.

(1)

Code: Select all

OnRefreshAction=[!WriteKeyValue #Title# X #CURRENTCONFIGX# "#@#Layout\Position.inc"][!WriteKeyValue #Title# Y #CURRENTCONFIGY# "#@#Layout\Position.inc"][!Update]
(2)

Code: Select all

[Variables]
@include1=#@#Layout\Position.inc
i hope this explain it a bit:

http://www.youtube.com/watch?v=U2hg4_ZLCrY

i know a little bit about Basic Tutorials, i have written the rest of my layout also.