It is currently May 1st, 2024, 12:47 am

How to properly store a variable?

Get help with creating, editing & fixing problems with skins
Bichrome
Posts: 7
Joined: June 24th, 2012, 7:31 am

How to properly store a variable?

Post by Bichrome »

I've got myself a NetTotal counter that is set up to record the amount of net traffic that I have over the period of a month. The issue I have here, is that I don't have a space to properly store the variable with each skin update; so whenever I restart my computer, the counter resets itself, instead of going from where it left off. How do I set up a variable to store the value (probably about every 10-15 seconds) and then call upon it everytime Rainmeter starts up? Any help would be appreciated.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to properly store a variable?

Post by jsmorley »

With Cumulative=1 on a NetIn/NetOut/NetTotal measure, it will keep track of the totals and won't reset anything if you refresh or restart Rainmeter or your computer. The information is already saved on an ongoing basis in Rainmeter.stats in your %APPDATA%\Rainmeter folder.

Those stats are accumulated until you send a !ResetStats bang to Rainmeter (or delete that .stats file).
Bichrome
Posts: 7
Joined: June 24th, 2012, 7:31 am

Re: How to properly store a variable?

Post by Bichrome »

How can I set it up so it knows to check the current amount for NetTotal and to get it's display value from there (say, with every refresh if the .stats file is where it is initially getting the data)? I understand that it will keep track of things until it is properly reset, but with the text that I'm using to display the current value it gets reset on skin refresh or rainmeter refresh.