It is currently September 16th, 2019, 1:12 am

Cash Register Cash Counter

Help with creating, editing & fixing problems with skins
justsomeguyhere
Posts: 15
Joined: July 12th, 2019, 7:29 pm

Cash Register Cash Counter

justsomeguyhere » July 12th, 2019, 8:02 pm

Hey,

I was looking for help on making a little box that counted the amount of cash that goes in and out of the register at the place I work at. Here's what I have so far.
[Rainmeter]
Update=1000

[Variables]
Pennies=11
Nickels=23
Dimes=7
Quarters=36
Ones=26
Fives=9
Tens=7
Twenties=30
Fifties=2
Hundreds=0

[Total]
Measure=Calc
Formula=(Pennies/100)+(Nickels*0.05)+(Dimes*0.1)+(Quarters*0.25)+(Ones)+(Fives*5)+(Tens*10)+(Twenties*20)+(Fifties*50)+(Hundreds*100)

[Explaination 1]
;Add
[Pennies^]
Measure=Calc
Formula=Pennies+1

[Nickels^]
Measure=Calc
Formula=Nickels+1

[Dimes^]
Measure=Calc
Formula=Dimes+1

[Quarters^]
Measure=Calc
Formula=Quarters+1

[Ones^]
Measure=Calc
Formula=Ones+1

[Fives^]
Measure=Calc
Formula=Fives+1

[Tens^]
Measure=Calc
Formula=Tens+1

[Twenties^]
Measure=Calc
Formula=Twenties+1

[Fifties^]
Measure=Calc
Formula=Fifties+1

[Hundreds^]
Measure=Calc
Formula=Hundreds+1

[Explaination 2]
;Subtract
[PenniesV]
Measure=Calc
Formula=Pennies-1

[NickelsV]
Measure=Calc
Formula=Nickels-1

[DimesV]
Measure=Calc
Formula=Dimes-1

[QuartersV]
Measure=Calc
Formula=Quarters-1

[OnesV]
Measure=Calc
Formula=Ones-1

[FivesV]
Measure=Calc
Formula=Fives-1

[TensV]
Measure=Calc
Formula=Tens-1

[TwentiesV]
Measure=Calc
Formula=Twenties-1

[FiftiesV]
Measure=Calc
Formula=Fifties-1

[HundredsV]
Measure=Calc
Formula=Hundreds-1

[Explaination 3]
;Display
[PenniesCount]
Measure=Calc
Formula=Pennies

[NickelsCount]
Measure=Calc
Formula=Nickels

[DimesCount]
Measure=Calc
Formula=Dimes

[QuartersCount]
Measure=Calc
Formula=Quarters

[OnesCount]
Measure=Calc
Formula=Ones

[FivesCount]
Measure=Calc
Formula=Fives

[TensCount]
Measure=Calc
Formula=Tens

[TwentiesCount]
Measure=Calc
Formula=Twenties

[FiftiesCount]
Measure=Calc
Formula=Fifties

[HundredsCount]
Measure=Calc
Formula=Hundreds

[Box]
Meter=Shape
Shape=Rectangle 0,0,140,240 | Fill Color 52,52,52,255 | Stroke Color 0,0,0,0

[Display.01]
Meter=String
AntiAlias=1
FontFace=Century Gothic
FontSize=8
FontColor=51,181,229,255
Y=5
X=15
Text=Pennies
[Penny+]
Meter=String
AntiAlias=1
FontFace=Century Gothic
FontSize=15
FontColor=51,181,229,255
X=1
Y=7.5
Text=+
LeftMouseUpAction=!Execute [Pennies^][!Redraw]

[PennyCount]
Meter=String
MeasureName=PenniesCount
AntiAlias=1
FontFace=Century Gothic
FontSize=15
FontColor=51,181,229,255
StringAlign=Center
X=35
Y=15
DynamicVariables=1

[Penny-]
Meter=String
AntiAlias=1
FontFace=Century Gothic
FontSize=17
FontColor=51,181,229,255
X=3
Y=20
Text=-
LeftMouseUpAction=!Execute [PenniesV][!Redraw]
;Repeat for each currency unit at the bottom make a total box
I feel dummy stupid for asking for help on this, because it just seems so simple. Any help is super appreciated.
User avatar
balala
Rainmeter Sage
Posts: 8617
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Cash Register Cash Counter

balala » July 12th, 2019, 9:01 pm

Don't add those ^ symbols into the names of certain measures. Rename [Pennies^] as [Pennies], [Nickels^] as [Nickels], [Dimes^] as [Dimes] and so on. With those symbols, none of those measures won't work.
Also note that although not prohibited, but nor preferable isn't to use spaces into section names, whether it is a measure or a meter name. So replace the [Explaination 1] (practically not used) name with [Explaination1].
And other two small errors:
  • The !Execute bang is deprecated. Not needed to use it. You can simply remove them.
  • You can't execute simply a measure. Not sure what was your intention for instance with the [Pennies^] bang used into the LeftMouseUpAction option of the [Display.01] meter, but I suppose you want to execute it once when clicking the meter, right? If so, add an UpdateDivider=-1 option to the [Pennies] measure (this option prevents the measure to be updated, or executed), then replace the [Pennies] bang with [!UpdateMeasure "Pennies"] into the above mentioned LeftMouseUpAction option.
justsomeguyhere
Posts: 15
Joined: July 12th, 2019, 7:29 pm

Re: Cash Register Cash Counter

justsomeguyhere » July 13th, 2019, 4:41 pm

So I did that everything you said (Remove the "^", Add UpdateDivider=-1, Remove !Execute, Change the Bangs to Update each Measure instead of calling it) and still the + and - signs don't increase and decrease the shown value. I moved the variables into a separate variable file so it was a little less cluttered. Here's what I have
[Rainmeter]
Update=100
;....
[Pennies]
Measure=Calc
Formula=#PenniesVar#+1
UpdateDivide=-1
;....
[PenniesV]
Measure=Calc
Formula=#PenniesVar#-1
UpdateDivide=-1
;....
[PenniesCount]
Measure=Calc
Formula=#PenniesVar#
;....
[Box]
Meter=Shape
Shape=Rectangle 0,0,140,240 | Fill Color 52,52,52,255 | Stroke Color 0,0,0,0

[PennyUp]
Meter=String
AntiAlias=1
FontFace=Century Gothic
FontSize=15
FontColor=51,181,229,255
X=1
Y=7.5
Text=+
LeftMouseUpAction=[!UpdateMeasure "Pennies"][!Redraw]

[PennyCount]
Meter=String
MeasureName=PenniesCount
AntiAlias=1
FontFace=Century Gothic
FontSize=15
FontColor=51,181,229,255
StringAlign=Center
X=35
Y=15
DynamicVariables=1

[PennyDown]
Meter=String
AntiAlias=1
FontFace=Century Gothic
FontSize=17
FontColor=51,181,229,255
X=3
Y=20
Text=-
LeftMouseUpAction=[!UpdateMeasure "PenniesV"][!Redraw]

The good thing is now it's displaying the values it should be, but what else could be wrong?
User avatar
balala
Rainmeter Sage
Posts: 8617
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Cash Register Cash Counter

balala » July 13th, 2019, 5:43 pm

justsomeguyhere wrote:
July 13th, 2019, 4:41 pm
The good thing is now it's displaying the values it should be, but what else could be wrong?
In this case no measure is needed. Everything can be done with just three (plus the background) meters, setting appropriately the variable. So, remove all existing measures and modify the LeftMouseUpAction options of the [PennyUp] and [PennyDown] meters, as it follows. Also add a needed DyanamicVariables=1 option to both meters. Another thing that is missing and you have to add is the [Variables] section, where you have to set the initial value of the PenniesVar variable:

Code: Select all

[Variables]
PenniesVar=0

[PennyUp]
...
LeftMouseUpAction=[!SetVariable PenniesVar "(#PenniesVar#+1)"][!UpdateMeter "PennyCount"][!UpdateMeter "PennyUp"][!UpdateMeter "PennyDown"][!Redraw]
DynamicVariables=1

...

[PennyDown]
...
LeftMouseUpAction=[!SetVariable PenniesVar "(#PenniesVar#-1)"][!UpdateMeter "PennyCount"][!UpdateMeter "PennyUp"][!UpdateMeter "PennyDown"][!Redraw]
DynamicVariables=1
(obviously you can add any value you want to start with).
Here is the complete code of the skin, containing all these changes:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
PenniesVar=0

[Box]
Meter=Shape
Shape=Rectangle 0,0,140,240 | Fill Color 52,52,52,255 | Stroke Color 0,0,0,0

[PennyUp]
Meter=String
AntiAlias=1
FontFace=Century Gothic
FontSize=15
FontColor=51,181,229,255
X=1
Y=7.5
Text=+
LeftMouseUpAction=[!SetVariable PenniesVar "(#PenniesVar#+1)"][!UpdateMeter "PennyCount"][!UpdateMeter "PennyUp"][!UpdateMeter "PennyDown"][!Redraw]
DynamicVariables=1

[PennyCount]
Meter=String
MeasureName=PenniesCount
AntiAlias=1
FontFace=Century Gothic
FontSize=15
FontColor=51,181,229,255
StringAlign=Center
X=35
Y=15
Text=#PenniesVar#
DynamicVariables=1

[PennyDown]
Meter=String
AntiAlias=1
FontFace=Century Gothic
FontSize=17
FontColor=51,181,229,255
X=3
Y=20
Text=-
LeftMouseUpAction=[!SetVariable PenniesVar "(#PenniesVar#-1)"][!UpdateMeter "PennyCount"][!UpdateMeter "PennyUp"][!UpdateMeter "PennyDown"][!Redraw]
DynamicVariables=1
Note the modified Update value within the [Rainmeter] section, which you've set to Update=100. This is a too low value, which isn't needed at all, the default Update=1000 is completely fine.