[messages] Edit: Re: [Module Design] Counting card value

barbanera barbanera at fantafoot.com
Mon Jul 23 04:45:03 MST 2012

[This message has been edited.]

It might be possible to do something of the sort in a straightforward
manner with 3.2.0 by using Calculated properties and the beanshell

However, sticking with 3.1.x if your cards are in a deck you can first
of all turn on performing "counting of regular expressions" on the deck,
and export properties like:

1s: CardValue=1
2s: CardValue=2
3s: CardValue=3

Then your total will be given by the simple expression: $<deckname>_1s$
+ 2*$<deckname>_2s$ + 3*$<deckname>_3s$ + ...

For testing purposes you might want to print it out that total. However,
you cannot stick the above string in a text label because it won't work.
With 3.2.0 you could define a Calculated Property at this stage -
containing that exact expression - and then print that out with a text
label. With 3.1.x, instead, define some button with a right/left click
command to set up a global property with a bunch of "increment numeric
value by" commands, all firing on the same command: the first with
$<deckname>_1s$, the second and third with $<deckname>_2s$ etc. Then
have the text label print out the value of this global property instead.

Read this topic online here:

More information about the messages mailing list