It is currently April 25th, 2024, 6:12 am

Tranfering/Saving Variables

Get help with creating, editing & fixing problems with skins
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Tranfering/Saving Variables

Post by brijamelsh »

Is the only way to write a variable to a variables.inc file to have a configuration.exe?

Can I transfer variables from one skin to another?
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Tranfering/Saving Variables

Post by Alex2539 »

Writing variables to a file doesn't specifically require a configuration tool, but a third-party program of some sort is needed. Most people user NirCmd to write to a file.

As for "transferring" variables, if you add a config name to the end of !RainmeterSetVariable, it will change the variable in that config instead of the current one. For example:

Code: Select all

!RainmeterSetVariable SomeVar 1234 MySkin
This would set the variable "SomeVar" to 1234 in the config "MySkin", assuming some skin within "MySkin" is actually running.
ImageImageImageImage
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Tranfering/Saving Variables

Post by Chewtoy »

Alex2539 wrote:As for "transferring" variables, if you add a config name to the end of !RainmeterSetVariable, it will change the variable in that config instead of the current one. For example:

Code: Select all

!RainmeterSetVariable SomeVar 1234 MySkin
A little note about that: !RainmeterSetVariable does not store the value. It will only change it in memory. So the variable that you had before you changed it with that bang will always be the one that is in effect when you start the skin.

As for how to set variables, you can always upon notepad and change them. So no, you don't need configure.exe to do it. But, I suppose it's easier for those who have no idea what they are doing to use it.
I don't think, therefore I'm not.
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Re: Tranfering/Saving Variables

Post by brijamelsh »

Thanks Ill give that a try. I'm trying to use the GetAvgColor plugin to automatically change a color in my skin, so this might work.
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Re: Tranfering/Saving Variables

Post by brijamelsh »

Is it possible to use the set variable command to change a variable value in a inc file?
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Tranfering/Saving Variables

Post by Alex2539 »

No. For that you need a third-party program. NirCmd is the most common.
ImageImageImageImage
Aarowaim
Posts: 97
Joined: July 25th, 2010, 7:23 am

Re: Tranfering/Saving Variables

Post by Aarowaim »

I actually did get that to work without using NircMid. All you do is if the variable in the .inc file is called Color1 and you want to change the color specified (or value), you write
!Execute [!RainmeterSetVariable Color1 232,45,67,255][!RainmeterRedraw]
____________________________^________^
____________________Variable goes here__Value goes here
The reason this works is that when you use the @include command, it treats the file that you include as part of the coding in the .ini file. Because of this, as long as the file that has @include in it is the one that you change the variable with, it will temporarily read that variable as whatever you changed it to.
Away for a while :(
Programming isn't a hobby, it's a lifestyle choice.
[url=http://www.rainmeter.net/forum/viewtopic.php?f=83&t=1207][b]T34M V.1.5.0.|2[/b][/url] <----I'ts l33t, look it up

Coding Skills: [color=#00FFFF]4.5[/color]
Answering Skills: [color=#00FFFF]4[/color]
Image Editing: [color=#00FFFF]3[/color]
Knowledge: [color=#00FFFF]4.5[/color]
Technical Skills: [color=#00FFFF]3[/color]
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Tranfering/Saving Variables

Post by Alex2539 »

I may have misinterpreted the question. I assumed he meant to change the value in the file itself, which would need NirCmd or something similar. If he just wants to change the value being read from a .inc file in memory, then you are 100% correct.
ImageImageImageImage
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Re: Tranfering/Saving Variables

Post by brijamelsh »

I see, I was trying to change the variable in the uservariables.ini so that it would be read in all of the skins using the uservariables.ini however, so i dont think the setvar bang would work.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Tranfering/Saving Variables

Post by Alex2539 »

No, if you're literally trying to modify the file, the !Bang will not work.
ImageImageImageImage