Wolph42's 'SET' Card Game Framework v4

MapTool campaign files that encapsulate properties, tokens, and macros for a particular ruleset or game world. "Framework" is often abbreviated "FW".

Moderators: Azhrei, dorpond, trevor, giliath, Gamerdude, jay, Mr.Ice

Forum rules
This forum is LOCKED. If a thread belongs here, use the "Report" feature of the post to let a moderator know to move it. General discussion should occur in the User Creations or MapTool forums.
Post Reply
User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Wolph42's 'SET' Card Game Framework v4

Post by wolph42 »

It has been a far too long time that I created anything outside my W40K framework or the Bag of Tricks, but inspired my AM's latest release I thought, I can do that too. So here it is, one of my favourite 'brain wreck games'

Beyond that, there's not much to tell:

Here is a description of the game. There is an instructions macro in the framework though. All you need is placed on the campaign panel.

[spoiler=Here's a screenshot]
Set Screenshot.jpg
Set Screenshot.jpg (196.76 KiB) Viewed 8845 times
[/spoiler]

And here's the DOWNLOAD

Note: you can play this game on you're own as well.

Version update:
Version 4
- Added extra map with different set of cards. Just switch map to play with the other type.
Version 3
- Succeeded in creating a findSets() macro that can go through (and check) ALL combinations in less than a second.
- Implemented this functions to give penalty for 'add cards' (when there are still sets on the table). And create the 'help me' macro, which also gives a penalty when used.
- I also added some timer functions to the BoT which lets me pause and resume the timer, and use these in SET. So when you use the macros the timer is temporarily stopped, giving slow computers an advantage in stead of a disadvantage :wink:

Version 2
- added solitaire mode with comprehensive point system.

Version 1
- Created the game for online play.

User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'SET' Card Game Framework v2.0

Post by wolph42 »

New version 2.0

I've added a solitaire mode. It was already possible to play on you're own but now its a seperate mode that tracks time and has a comprehensive point system.

If you manage to score 425 points in solo mode, pls let me know (post here) as you have then transcended to a SET diety. (there is a far fetched pun in there).

User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by wolph42 »

Version 3

WOOT !

One of the biggest challenges of this game is to create a macro that can find all current sets on the table. This means that you need to loop through all combinations of 3 cards out of (eg) 18 (which are 816 combinations) and THEN cycle through all 3 cards to get their properties and THEN check if they make a set or not.
Obviously this is not too hard to program, but it is if your goal is to do the entire calcuation < 1s in maptool! But I did!
The max is set to 18 cards (as there is ALWAYS a set in 20+) partially also due to the loop limiter in maptools (1000) as there are 1330 combinations. I think it would still be well within the time limit but the loop limit prevents that.
Anyway. This new function let me add a couple of things;
1. in solitaire mode now using the 'add cards' button will give you a penalty for every set thats currently on the table (so use it wisely!)
2. I added a 'help me' button which shows you the current sets on the table (again with penalty in the solitaire mode).

In addition to this I also added some timer functions to the BoT which lets me pause and resume the timer. So when you use the macros the timer is temporarily stopped, giving slow computers an advantage in stead of a disadvantage :wink:
Enjoy!

User avatar
aliasmask
Deity
Posts: 8578
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by aliasmask »

I did get an error :(

Code: Select all

 Error in body of roll.       Statement options (if any): h,if(indexOf(args,"SET") != -1), CODE       Statement Body : {  [checkSet(toks,solitaire)] };{}


SET error example.jpg
SET error example.jpg (48.38 KiB) Viewed 8784 times


I obviously suck at this game.

User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by wolph42 »

urgh. 'Tested' this game throroughly and still something falls through. Ill have a look. thnx. may i assume that you got the error when you clicked 'SET!!' ?

good set btw!

User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by wolph42 »

This is the old and VERY annoying maptool bug where with some pc's a routines 'bugs out' when an error is encountered and on some pc's not.
Interestingly enough this was in a spot where the outcome did not matter, so if it does NOT bug out it works perfectly (as it does on all my pcs') however if it does bug out... it simply stops.

apparently this is not ok:

Code: Select all

[switch(length(IDresult)):
    case 12:    <!-- ok -->;
    case 11:    IDresult    = "x"+IDresult;
    case 10:    IDresult    = "xx"+IDresult;
    default:     assert(0,"error with length of result ID ("+IDresult+"): "+length(IDresult),0);
]
 


I found an NPE on <!-- ok --> in the log.

changing it to 1=1; was also not good and finally
IDresult = IDresult;
worked ?!?!? No clue why.

Anyhoo, could you pls try again and let me know if it works now?

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by CoveredInFish »

I guess MT needs a statement. HTML is no an statement and you cannot assign something to a value (1=1). I would think a value (like 1 or "") should be fine. If that doesnt work we could need some sort of no-operation command (eg empty UDF).
(currently mobile with no chance to test stuff)

User avatar
aliasmask
Deity
Posts: 8578
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by aliasmask »

Correct, when I clicked SET. Actually, my example wasn't good set (2 squares). But after reloading and trying again, I kept getting that same error, even with good Sets. I'm guessing your find set function is going over the index of the array. BTW, how do you find your sets? Do you just set a flag on each card? I would recommend Wiki: bxor(). Give each attribute their own bit position and assign a value to that card based on the sum of those bit positions and then use bxor. If it's 0, then is good, if not then bad. Actually, that good to test for matching. You'll have to use band to test for unique.

Attributes
  • green(G) = 1
  • blue(B) = 2
  • red(R) = 4
  • poly(P) = 8
  • circle(C) = 16
  • triangle(T) = 32
  • one(1) = 64
  • two(2) = 128
  • three(3) = 256
  • empty(E) = 512
  • shade(S) = 1024
  • Full(F) = 2048
So, GP1E = 1+8+64+512 = 585. You could write a macro to set the card values.

I figure you'll need 12 tests. 3 to compare each card to another and 4 for each grouping. Use band to filter the groups, so if you're only looking at color then card1 = band(card1.base,7) so only the color bits are set. Then you can compare value = max(1,bxor(card1,card2)) + max(1,bxor(card1,card3)) + max(1,bxor(card2,card3)). Value will need to be 0 or 3 to be valid.

User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by wolph42 »

do you happens to have a log? and can you send it. Cause I do not get that error anymore. Bloody annoying this. How I do it is close to what you suggest I use a combination of binary and regex :D and a couple of BIG arrays like this one:

Code: Select all

["[r:c0+c1+c2]","[r:c0+c1+c3]","[r:c0+c1+c4]","[r:c0+c1+c5]","[r:c0+c1+c6]","[r:c0+c1+c7]","[r:c0+c1+c8]","[r:c0+c1+c9]","[r:c0+c1+c10]","[r:c0+c1+c11]","[r:c0+c1+c12]","[r:c0+c1+c13]","[r:c0+c1+c14]","[r:c0+c1+c15]","[r:c0+c1+c16]","[r:c0+c1+c17]","[r:c0+c2+c3]","[r:c0+c2+c4]","[r:c0+c2+c5]","[r:c0+c2+c6]","[r:c0+c2+c7]","[r:c0+c2+c8]","[r:c0+c2+c9]","[r:c0+c2+c10]","[r:c0+c2+c11]","[r:c0+c2+c12]","[r:c0+c2+c13]","[r:c0+c2+c14]","[r:c0+c2+c15]","[r:c0+c2+c16]","[r:c0+c2+c17]","[r:c0+c3+c4]","[r:c0+c3+c5]","[r:c0+c3+c6]","[r:c0+c3+c7]","[r:c0+c3+c8]","[r:c0+c3+c9]","[r:c0+c3+c10]","[r:c0+c3+c11]","[r:c0+c3+c12]","[r:c0+c3+c13]","[r:c0+c3+c14]","[r:c0+c3+c15]","[r:c0+c3+c16]","[r:c0+c3+c17]","[r:c0+c4+c5]","[r:c0+c4+c6]","[r:c0+c4+c7]","[r:c0+c4+c8]","[r:c0+c4+c9]","[r:c0+c4+c10]","[r:c0+c4+c11]","[r:c0+c4+c12]","[r:c0+c4+c13]","[r:c0+c4+c14]","[r:c0+c4+c15]","[r:c0+c4+c16]","[r:c0+c4+c17]","[r:c0+c5+c6]","[r:c0+c5+c7]","[r:c0+c5+c8]","[r:c0+c5+c9]","[r:c0+c5+c10]","[r:c0+c5+c11]","[r:c0+c5+c12]","[r:c0+c5+c13]","[r:c0+c5+c14]","[r:c0+c5+c15]","[r:c0+c5+c16]","[r:c0+c5+c17]","[r:c0+c6+c7]","[r:c0+c6+c8]","[r:c0+c6+c9]","[r:c0+c6+c10]","[r:c0+c6+c11]","[r:c0+c6+c12]","[r:c0+c6+c13]","[r:c0+c6+c14]","[r:c0+c6+c15]","[r:c0+c6+c16]","[r:c0+c6+c17]","[r:c0+c7+c8]","[r:c0+c7+c9]","[r:c0+c7+c10]","[r:c0+c7+c11]","[r:c0+c7+c12]","[r:c0+c7+c13]","[r:c0+c7+c14]","[r:c0+c7+c15]","[r:c0+c7+c16]","[r:c0+c7+c17]","[r:c0+c8+c9]","[r:c0+c8+c10]","[r:c0+c8+c11]","[r:c0+c8+c12]","[r:c0+c8+c13]","[r:c0+c8+c14]","[r:c0+c8+c15]","[r:c0+c8+c16]","[r:c0+c8+c17]","[r:c0+c9+c10]","[r:c0+c9+c11]","[r:c0+c9+c12]","[r:c0+c9+c13]","[r:c0+c9+c14]","[r:c0+c9+c15]","[r:c0+c9+c16]","[r:c0+c9+c17]","[r:c0+c10+c11]","[r:c0+c10+c12]","[r:c0+c10+c13]","[r:c0+c10+c14]","[r:c0+c10+c15]","[r:c0+c10+c16]","[r:c0+c10+c17]","[r:c0+c11+c12]","[r:c0+c11+c13]","[r:c0+c11+c14]","[r:c0+c11+c15]","[r:c0+c11+c16]","[r:c0+c11+c17]","[r:c0+c12+c13]","[r:c0+c12+c14]","[r:c0+c12+c15]","[r:c0+c12+c16]","[r:c0+c12+c17]","[r:c0+c13+c14]","[r:c0+c13+c15]","[r:c0+c13+c16]","[r:c0+c13+c17]","[r:c0+c14+c15]","[r:c0+c14+c16]","[r:c0+c14+c17]","[r:c0+c15+c16]","[r:c0+c15+c17]","[r:c0+c16+c17]","[r:c1+c2+c3]","[r:c1+c2+c4]","[r:c1+c2+c5]","[r:c1+c2+c6]","[r:c1+c2+c7]","[r:c1+c2+c8]","[r:c1+c2+c9]","[r:c1+c2+c10]","[r:c1+c2+c11]","[r:c1+c2+c12]","[r:c1+c2+c13]","[r:c1+c2+c14]","[r:c1+c2+c15]","[r:c1+c2+c16]","[r:c1+c2+c17]","[r:c1+c3+c4]","[r:c1+c3+c5]","[r:c1+c3+c6]","[r:c1+c3+c7]","[r:c1+c3+c8]","[r:c1+c3+c9]","[r:c1+c3+c10]","[r:c1+c3+c11]","[r:c1+c3+c12]","[r:c1+c3+c13]","[r:c1+c3+c14]","[r:c1+c3+c15]","[r:c1+c3+c16]","[r:c1+c3+c17]","[r:c1+c4+c5]","[r:c1+c4+c6]","[r:c1+c4+c7]","[r:c1+c4+c8]","[r:c1+c4+c9]","[r:c1+c4+c10]","[r:c1+c4+c11]","[r:c1+c4+c12]","[r:c1+c4+c13]","[r:c1+c4+c14]","[r:c1+c4+c15]","[r:c1+c4+c16]","[r:c1+c4+c17]","[r:c1+c5+c6]","[r:c1+c5+c7]","[r:c1+c5+c8]","[r:c1+c5+c9]","[r:c1+c5+c10]","[r:c1+c5+c11]","[r:c1+c5+c12]","[r:c1+c5+c13]","[r:c1+c5+c14]","[r:c1+c5+c15]","[r:c1+c5+c16]","[r:c1+c5+c17]","[r:c1+c6+c7]","[r:c1+c6+c8]","[r:c1+c6+c9]","[r:c1+c6+c10]","[r:c1+c6+c11]","[r:c1+c6+c12]","[r:c1+c6+c13]","[r:c1+c6+c14]","[r:c1+c6+c15]","[r:c1+c6+c16]","[r:c1+c6+c17]","[r:c1+c7+c8]","[r:c1+c7+c9]","[r:c1+c7+c10]","[r:c1+c7+c11]","[r:c1+c7+c12]","[r:c1+c7+c13]","[r:c1+c7+c14]","[r:c1+c7+c15]","[r:c1+c7+c16]","[r:c1+c7+c17]","[r:c1+c8+c9]","[r:c1+c8+c10]","[r:c1+c8+c11]","[r:c1+c8+c12]","[r:c1+c8+c13]","[r:c1+c8+c14]","[r:c1+c8+c15]","[r:c1+c8+c16]","[r:c1+c8+c17]","[r:c1+c9+c10]","[r:c1+c9+c11]","[r:c1+c9+c12]","[r:c1+c9+c13]","[r:c1+c9+c14]","[r:c1+c9+c15]","[r:c1+c9+c16]","[r:c1+c9+c17]","[r:c1+c10+c11]","[r:c1+c10+c12]","[r:c1+c10+c13]","[r:c1+c10+c14]","[r:c1+c10+c15]","[r:c1+c10+c16]","[r:c1+c10+c17]","[r:c1+c11+c12]","[r:c1+c11+c13]","[r:c1+c11+c14]","[r:c1+c11+c15]","[r:c1+c11+c16]","[r:c1+c11+c17]","[r:c1+c12+c13]","[r:c1+c12+c14]","[r:c1+c12+c15]","[r:c1+c12+c16]","[r:c1+c12+c17]","[r:c1+c13+c14]","[r:c1+c13+c15]","[r:c1+c13+c16]","[r:c1+c13+c17]","[r:c1+c14+c15]","[r:c1+c14+c16]","[r:c1+c14+c17]","[r:c1+c15+c16]","[r:c1+c15+c17]","[r:c1+c16+c17]","[r:c2+c3+c4]","[r:c2+c3+c5]","[r:c2+c3+c6]","[r:c2+c3+c7]","[r:c2+c3+c8]","[r:c2+c3+c9]","[r:c2+c3+c10]","[r:c2+c3+c11]","[r:c2+c3+c12]","[r:c2+c3+c13]","[r:c2+c3+c14]","[r:c2+c3+c15]","[r:c2+c3+c16]","[r:c2+c3+c17]","[r:c2+c4+c5]","[r:c2+c4+c6]","[r:c2+c4+c7]","[r:c2+c4+c8]","[r:c2+c4+c9]","[r:c2+c4+c10]","[r:c2+c4+c11]","[r:c2+c4+c12]","[r:c2+c4+c13]","[r:c2+c4+c14]","[r:c2+c4+c15]","[r:c2+c4+c16]","[r:c2+c4+c17]","[r:c2+c5+c6]","[r:c2+c5+c7]","[r:c2+c5+c8]","[r:c2+c5+c9]","[r:c2+c5+c10]","[r:c2+c5+c11]","[r:c2+c5+c12]","[r:c2+c5+c13]","[r:c2+c5+c14]","[r:c2+c5+c15]","[r:c2+c5+c16]","[r:c2+c5+c17]","[r:c2+c6+c7]","[r:c2+c6+c8]","[r:c2+c6+c9]","[r:c2+c6+c10]","[r:c2+c6+c11]","[r:c2+c6+c12]","[r:c2+c6+c13]","[r:c2+c6+c14]","[r:c2+c6+c15]","[r:c2+c6+c16]","[r:c2+c6+c17]","[r:c2+c7+c8]","[r:c2+c7+c9]","[r:c2+c7+c10]","[r:c2+c7+c11]","[r:c2+c7+c12]","[r:c2+c7+c13]","[r:c2+c7+c14]","[r:c2+c7+c15]","[r:c2+c7+c16]","[r:c2+c7+c17]","[r:c2+c8+c9]","[r:c2+c8+c10]","[r:c2+c8+c11]","[r:c2+c8+c12]","[r:c2+c8+c13]","[r:c2+c8+c14]","[r:c2+c8+c15]","[r:c2+c8+c16]","[r:c2+c8+c17]","[r:c2+c9+c10]","[r:c2+c9+c11]","[r:c2+c9+c12]","[r:c2+c9+c13]","[r:c2+c9+c14]","[r:c2+c9+c15]","[r:c2+c9+c16]","[r:c2+c9+c17]","[r:c2+c10+c11]","[r:c2+c10+c12]","[r:c2+c10+c13]","[r:c2+c10+c14]","[r:c2+c10+c15]","[r:c2+c10+c16]","[r:c2+c10+c17]","[r:c2+c11+c12]","[r:c2+c11+c13]","[r:c2+c11+c14]","[r:c2+c11+c15]","[r:c2+c11+c16]","[r:c2+c11+c17]","[r:c2+c12+c13]","[r:c2+c12+c14]","[r:c2+c12+c15]","[r:c2+c12+c16]","[r:c2+c12+c17]","[r:c2+c13+c14]","[r:c2+c13+c15]","[r:c2+c13+c16]","[r:c2+c13+c17]","[r:c2+c14+c15]","[r:c2+c14+c16]","[r:c2+c14+c17]","[r:c2+c15+c16]","[r:c2+c15+c17]","[r:c2+c16+c17]","[r:c3+c4+c5]","[r:c3+c4+c6]","[r:c3+c4+c7]","[r:c3+c4+c8]","[r:c3+c4+c9]","[r:c3+c4+c10]","[r:c3+c4+c11]","[r:c3+c4+c12]","[r:c3+c4+c13]","[r:c3+c4+c14]","[r:c3+c4+c15]","[r:c3+c4+c16]","[r:c3+c4+c17]","[r:c3+c5+c6]","[r:c3+c5+c7]","[r:c3+c5+c8]","[r:c3+c5+c9]","[r:c3+c5+c10]","[r:c3+c5+c11]","[r:c3+c5+c12]","[r:c3+c5+c13]","[r:c3+c5+c14]","[r:c3+c5+c15]","[r:c3+c5+c16]","[r:c3+c5+c17]","[r:c3+c6+c7]","[r:c3+c6+c8]","[r:c3+c6+c9]","[r:c3+c6+c10]","[r:c3+c6+c11]","[r:c3+c6+c12]","[r:c3+c6+c13]","[r:c3+c6+c14]","[r:c3+c6+c15]","[r:c3+c6+c16]","[r:c3+c6+c17]","[r:c3+c7+c8]","[r:c3+c7+c9]","[r:c3+c7+c10]","[r:c3+c7+c11]","[r:c3+c7+c12]","[r:c3+c7+c13]","[r:c3+c7+c14]","[r:c3+c7+c15]","[r:c3+c7+c16]","[r:c3+c7+c17]","[r:c3+c8+c9]","[r:c3+c8+c10]","[r:c3+c8+c11]","[r:c3+c8+c12]","[r:c3+c8+c13]","[r:c3+c8+c14]","[r:c3+c8+c15]","[r:c3+c8+c16]","[r:c3+c8+c17]","[r:c3+c9+c10]","[r:c3+c9+c11]","[r:c3+c9+c12]","[r:c3+c9+c13]","[r:c3+c9+c14]","[r:c3+c9+c15]","[r:c3+c9+c16]","[r:c3+c9+c17]","[r:c3+c10+c11]","[r:c3+c10+c12]","[r:c3+c10+c13]","[r:c3+c10+c14]","[r:c3+c10+c15]","[r:c3+c10+c16]","[r:c3+c10+c17]","[r:c3+c11+c12]","[r:c3+c11+c13]","[r:c3+c11+c14]","[r:c3+c11+c15]","[r:c3+c11+c16]","[r:c3+c11+c17]","[r:c3+c12+c13]","[r:c3+c12+c14]","[r:c3+c12+c15]","[r:c3+c12+c16]","[r:c3+c12+c17]","[r:c3+c13+c14]","[r:c3+c13+c15]","[r:c3+c13+c16]","[r:c3+c13+c17]","[r:c3+c14+c15]","[r:c3+c14+c16]","[r:c3+c14+c17]","[r:c3+c15+c16]","[r:c3+c15+c17]","[r:c3+c16+c17]","[r:c4+c5+c6]","[r:c4+c5+c7]","[r:c4+c5+c8]","[r:c4+c5+c9]","[r:c4+c5+c10]","[r:c4+c5+c11]","[r:c4+c5+c12]","[r:c4+c5+c13]","[r:c4+c5+c14]","[r:c4+c5+c15]","[r:c4+c5+c16]","[r:c4+c5+c17]","[r:c4+c6+c7]","[r:c4+c6+c8]","[r:c4+c6+c9]","[r:c4+c6+c10]","[r:c4+c6+c11]","[r:c4+c6+c12]","[r:c4+c6+c13]","[r:c4+c6+c14]","[r:c4+c6+c15]","[r:c4+c6+c16]","[r:c4+c6+c17]","[r:c4+c7+c8]","[r:c4+c7+c9]","[r:c4+c7+c10]","[r:c4+c7+c11]","[r:c4+c7+c12]","[r:c4+c7+c13]","[r:c4+c7+c14]","[r:c4+c7+c15]","[r:c4+c7+c16]","[r:c4+c7+c17]","[r:c4+c8+c9]","[r:c4+c8+c10]","[r:c4+c8+c11]","[r:c4+c8+c12]","[r:c4+c8+c13]","[r:c4+c8+c14]","[r:c4+c8+c15]","[r:c4+c8+c16]","[r:c4+c8+c17]","[r:c4+c9+c10]","[r:c4+c9+c11]","[r:c4+c9+c12]","[r:c4+c9+c13]","[r:c4+c9+c14]","[r:c4+c9+c15]","[r:c4+c9+c16]","[r:c4+c9+c17]","[r:c4+c10+c11]","[r:c4+c10+c12]","[r:c4+c10+c13]","[r:c4+c10+c14]","[r:c4+c10+c15]","[r:c4+c10+c16]","[r:c4+c10+c17]","[r:c4+c11+c12]","[r:c4+c11+c13]","[r:c4+c11+c14]","[r:c4+c11+c15]","[r:c4+c11+c16]","[r:c4+c11+c17]","[r:c4+c12+c13]","[r:c4+c12+c14]","[r:c4+c12+c15]","[r:c4+c12+c16]","[r:c4+c12+c17]","[r:c4+c13+c14]","[r:c4+c13+c15]","[r:c4+c13+c16]","[r:c4+c13+c17]","[r:c4+c14+c15]","[r:c4+c14+c16]","[r:c4+c14+c17]","[r:c4+c15+c16]","[r:c4+c15+c17]","[r:c4+c16+c17]","[r:c5+c6+c7]","[r:c5+c6+c8]","[r:c5+c6+c9]","[r:c5+c6+c10]","[r:c5+c6+c11]","[r:c5+c6+c12]","[r:c5+c6+c13]","[r:c5+c6+c14]","[r:c5+c6+c15]","[r:c5+c6+c16]","[r:c5+c6+c17]","[r:c5+c7+c8]","[r:c5+c7+c9]","[r:c5+c7+c10]","[r:c5+c7+c11]","[r:c5+c7+c12]","[r:c5+c7+c13]","[r:c5+c7+c14]","[r:c5+c7+c15]","[r:c5+c7+c16]","[r:c5+c7+c17]","[r:c5+c8+c9]","[r:c5+c8+c10]","[r:c5+c8+c11]","[r:c5+c8+c12]","[r:c5+c8+c13]","[r:c5+c8+c14]","[r:c5+c8+c15]","[r:c5+c8+c16]","[r:c5+c8+c17]","[r:c5+c9+c10]","[r:c5+c9+c11]","[r:c5+c9+c12]","[r:c5+c9+c13]","[r:c5+c9+c14]","[r:c5+c9+c15]","[r:c5+c9+c16]","[r:c5+c9+c17]","[r:c5+c10+c11]","[r:c5+c10+c12]","[r:c5+c10+c13]","[r:c5+c10+c14]","[r:c5+c10+c15]","[r:c5+c10+c16]","[r:c5+c10+c17]","[r:c5+c11+c12]","[r:c5+c11+c13]","[r:c5+c11+c14]","[r:c5+c11+c15]","[r:c5+c11+c16]","[r:c5+c11+c17]","[r:c5+c12+c13]","[r:c5+c12+c14]","[r:c5+c12+c15]","[r:c5+c12+c16]","[r:c5+c12+c17]","[r:c5+c13+c14]","[r:c5+c13+c15]","[r:c5+c13+c16]","[r:c5+c13+c17]","[r:c5+c14+c15]","[r:c5+c14+c16]","[r:c5+c14+c17]","[r:c5+c15+c16]","[r:c5+c15+c17]","[r:c5+c16+c17]","[r:c6+c7+c8]","[r:c6+c7+c9]","[r:c6+c7+c10]","[r:c6+c7+c11]","[r:c6+c7+c12]","[r:c6+c7+c13]","[r:c6+c7+c14]","[r:c6+c7+c15]","[r:c6+c7+c16]","[r:c6+c7+c17]","[r:c6+c8+c9]","[r:c6+c8+c10]","[r:c6+c8+c11]","[r:c6+c8+c12]","[r:c6+c8+c13]","[r:c6+c8+c14]","[r:c6+c8+c15]","[r:c6+c8+c16]","[r:c6+c8+c17]","[r:c6+c9+c10]","[r:c6+c9+c11]","[r:c6+c9+c12]","[r:c6+c9+c13]","[r:c6+c9+c14]","[r:c6+c9+c15]","[r:c6+c9+c16]","[r:c6+c9+c17]","[r:c6+c10+c11]","[r:c6+c10+c12]","[r:c6+c10+c13]","[r:c6+c10+c14]","[r:c6+c10+c15]","[r:c6+c10+c16]","[r:c6+c10+c17]","[r:c6+c11+c12]","[r:c6+c11+c13]","[r:c6+c11+c14]","[r:c6+c11+c15]","[r:c6+c11+c16]","[r:c6+c11+c17]","[r:c6+c12+c13]","[r:c6+c12+c14]","[r:c6+c12+c15]","[r:c6+c12+c16]","[r:c6+c12+c17]","[r:c6+c13+c14]","[r:c6+c13+c15]","[r:c6+c13+c16]","[r:c6+c13+c17]","[r:c6+c14+c15]","[r:c6+c14+c16]","[r:c6+c14+c17]","[r:c6+c15+c16]","[r:c6+c15+c17]","[r:c6+c16+c17]","[r:c7+c8+c9]","[r:c7+c8+c10]","[r:c7+c8+c11]","[r:c7+c8+c12]","[r:c7+c8+c13]","[r:c7+c8+c14]","[r:c7+c8+c15]","[r:c7+c8+c16]","[r:c7+c8+c17]","[r:c7+c9+c10]","[r:c7+c9+c11]","[r:c7+c9+c12]","[r:c7+c9+c13]","[r:c7+c9+c14]","[r:c7+c9+c15]","[r:c7+c9+c16]","[r:c7+c9+c17]","[r:c7+c10+c11]","[r:c7+c10+c12]","[r:c7+c10+c13]","[r:c7+c10+c14]","[r:c7+c10+c15]","[r:c7+c10+c16]","[r:c7+c10+c17]","[r:c7+c11+c12]","[r:c7+c11+c13]","[r:c7+c11+c14]","[r:c7+c11+c15]","[r:c7+c11+c16]","[r:c7+c11+c17]","[r:c7+c12+c13]","[r:c7+c12+c14]","[r:c7+c12+c15]","[r:c7+c12+c16]","[r:c7+c12+c17]","[r:c7+c13+c14]","[r:c7+c13+c15]","[r:c7+c13+c16]","[r:c7+c13+c17]","[r:c7+c14+c15]","[r:c7+c14+c16]","[r:c7+c14+c17]","[r:c7+c15+c16]","[r:c7+c15+c17]","[r:c7+c16+c17]","[r:c8+c9+c10]","[r:c8+c9+c11]","[r:c8+c9+c12]","[r:c8+c9+c13]","[r:c8+c9+c14]","[r:c8+c9+c15]","[r:c8+c9+c16]","[r:c8+c9+c17]","[r:c8+c10+c11]","[r:c8+c10+c12]","[r:c8+c10+c13]","[r:c8+c10+c14]","[r:c8+c10+c15]","[r:c8+c10+c16]","[r:c8+c10+c17]","[r:c8+c11+c12]","[r:c8+c11+c13]","[r:c8+c11+c14]","[r:c8+c11+c15]","[r:c8+c11+c16]","[r:c8+c11+c17]","[r:c8+c12+c13]","[r:c8+c12+c14]","[r:c8+c12+c15]","[r:c8+c12+c16]","[r:c8+c12+c17]","[r:c8+c13+c14]","[r:c8+c13+c15]","[r:c8+c13+c16]","[r:c8+c13+c17]","[r:c8+c14+c15]","[r:c8+c14+c16]","[r:c8+c14+c17]","[r:c8+c15+c16]","[r:c8+c15+c17]","[r:c8+c16+c17]","[r:c9+c10+c11]","[r:c9+c10+c12]","[r:c9+c10+c13]","[r:c9+c10+c14]","[r:c9+c10+c15]","[r:c9+c10+c16]","[r:c9+c10+c17]","[r:c9+c11+c12]","[r:c9+c11+c13]","[r:c9+c11+c14]","[r:c9+c11+c15]","[r:c9+c11+c16]","[r:c9+c11+c17]","[r:c9+c12+c13]","[r:c9+c12+c14]","[r:c9+c12+c15]","[r:c9+c12+c16]","[r:c9+c12+c17]","[r:c9+c13+c14]","[r:c9+c13+c15]","[r:c9+c13+c16]","[r:c9+c13+c17]","[r:c9+c14+c15]","[r:c9+c14+c16]","[r:c9+c14+c17]","[r:c9+c15+c16]","[r:c9+c15+c17]","[r:c9+c16+c17]","[r:c10+c11+c12]","[r:c10+c11+c13]","[r:c10+c11+c14]","[r:c10+c11+c15]","[r:c10+c11+c16]","[r:c10+c11+c17]","[r:c10+c12+c13]","[r:c10+c12+c14]","[r:c10+c12+c15]","[r:c10+c12+c16]","[r:c10+c12+c17]","[r:c10+c13+c14]","[r:c10+c13+c15]","[r:c10+c13+c16]","[r:c10+c13+c17]","[r:c10+c14+c15]","[r:c10+c14+c16]","[r:c10+c14+c17]","[r:c10+c15+c16]","[r:c10+c15+c17]","[r:c10+c16+c17]","[r:c11+c12+c13]","[r:c11+c12+c14]","[r:c11+c12+c15]","[r:c11+c12+c16]","[r:c11+c12+c17]","[r:c11+c13+c14]","[r:c11+c13+c15]","[r:c11+c13+c16]","[r:c11+c13+c17]","[r:c11+c14+c15]","[r:c11+c14+c16]","[r:c11+c14+c17]","[r:c11+c15+c16]","[r:c11+c15+c17]","[r:c11+c16+c17]","[r:c12+c13+c14]","[r:c12+c13+c15]","[r:c12+c13+c16]","[r:c12+c13+c17]","[r:c12+c14+c15]","[r:c12+c14+c16]","[r:c12+c14+c17]","[r:c12+c15+c16]","[r:c12+c15+c17]","[r:c12+c16+c17]","[r:c13+c14+c15]","[r:c13+c14+c16]","[r:c13+c14+c17]","[r:c13+c15+c16]","[r:c13+c15+c17]","[r:c13+c16+c17]","[r:c14+c15+c16]","[r:c14+c15+c17]","[r:c14+c16+c17]","[r:c15+c16+c17]"]

every card has an ID like this:100001001010 which can be read like this:

Code: Select all

<!--
   ID build up:         100   100   100   100
   numeric reference:   012   345   678   9-10-11
   types                Num   Shp   Clr   Fill
   properties           123   SOT   GBR   Full-1/2-Empty
-->


and works like this:

Code: Select all

<!-- 
    This function uses one large array with all possible combinations 
(e.g. 3 cards out of 9) and uses the ID of the cards to identify possible sets .  
    A typical ID looks like this
: 100100010100 which can be read like: 100 100 010 100 which are binary representations of Number - Shape - Color - Fill.
    Where e.g. Number (bbb) can be read as Green-Blue-Red, thus a Green card is 100, a blue 010 and red 001. Similar for the other card properties.
    When adding the card IDs of three cards the result (for one color) will thus  be: 0 (means no card has that color), 1(one card has that color), 
    2
(two cards have that color) and 3 (three cards have that color.). Of all these combinations only 2 is *wrong*. Hence is (after addition of the IDs) 
    the number 2 is found
, then the three cards do NOT form a set. 
-->

 


edit: the error clearly happens in checkSet (error in body of roll). I checked my log and specifically that routine, but it just works. No errors...
Does it happen at the start, 'after a while' or near the end?

edit2: just noticed CIFs remark. Indeed 1=1 should render an error, 1==1 should work and "" probly as well. Anyhoo the current solution is good enough, works and is more intuitive.

User avatar
aliasmask
Deity
Posts: 8578
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by aliasmask »

This is the original one. I just picked three random cards and clicked SET. I'll try your new download and see if problem goes away.

[spoiler=]

Code: Select all

2014-04-16 02:30:34,076 [client.MapToolLineParser:1272] DEBUG - '<!-- -------------------------------- playButtonHandler () --------------------------------------->'
2014-04-16 02:30:34,079 [client.MapToolLineParser:1272] DEBUG - args      = macro.args
2014-04-16 02:30:34,081 [client.MapToolLineParser:1272] DEBUG - varsFromStrProp(args)
2014-04-16 02:30:34,083 [client.MapToolLineParser:1272] DEBUG - 'pause("args")'
2014-04-16 02:30:34,086 [client.MapToolLineParser:1272] DEBUG - if(indexOf(args,"delete") != -1, 1, 0)
2014-04-16 02:30:34,089 [client.MapToolLineParser:1272] DEBUG - if(indexOf(args,"SET") != -1, 1, 0)
2014-04-16 02:30:34,092 [client.MapToolLineParser:1272] DEBUG - checkSet(toks,solitaire)
2014-04-16 02:30:34,095 [client.MapToolLineParser:1272] DEBUG -  '<!-- ----------------------------------- checkSet -------------------------------------- -->'
2014-04-16 02:30:34,097 [client.MapToolLineParser:1272] DEBUG -  bot_pauseTime()
2014-04-16 02:30:34,099 [client.MapToolLineParser:1272] DEBUG -   '<!-- ----------------------- bot_pauseTime() ---------------------------------- -->'
2014-04-16 02:30:34,102 [client.MapToolLineParser:1272] DEBUG -   time         = if(   getLibProperty("w42.bot.timeIsPaused", "lib:EventMacros"),
                  getLibProperty("w42.bot.pauseTime", "lib:EventMacros") ,
                  json.get(getInfo("client"), "timeInMs") - getLibProperty("w42.bot.pausedTime", "lib:EventMacros")
)
2014-04-16 02:30:34,112 [client.MapToolLineParser:1272] DEBUG -   setLibProperty("w42.bot.pauseTime", time, "lib:EventMacros")
2014-04-16 02:30:34,120 [client.MapToolLineParser:1272] DEBUG -   setLibProperty("w42.bot.timeIsPaused", 1, "lib:EventMacros")
2014-04-16 02:30:34,128 [client.MapToolLineParser:1272] DEBUG -  toks            = arg(0)
2014-04-16 02:30:34,129 [client.MapToolLineParser:1272] DEBUG -  loc.solitaire   = arg(1)
2014-04-16 02:30:34,130 [client.MapToolLineParser:1272] DEBUG -  broadcast("<b>Check Set</b>")
2014-04-16 02:30:34,132 [client.MapToolLineParser:1272] DEBUG -  assert(listCount(toks) == 3, "You need to select exactly three cards",0)
2014-04-16 02:30:34,134 [client.MapToolLineParser:1272] DEBUG -  IDresult      = 0
2014-04-16 02:30:34,135 [client.MapToolLineParser:1272] DEBUG -  set         = ""
2014-04-16 02:30:34,136 [client.MapToolLineParser:1272] DEBUG -  cToks      = ""
2014-04-16 02:30:34,137 [client.MapToolLineParser:1272] DEBUG -  toks
2014-04-16 02:30:34,138 [client.MapToolLineParser:1272] DEBUG -  switchToken(card)
2014-04-16 02:30:34,139 [client.MapToolLineParser:1272] DEBUG -  set      = listAppend(set, "<img src='"+getTokenImage()+"' height='50' width='50' border='1' alt='"+token.name+"' />"," ")
2014-04-16 02:30:34,141 [client.MapToolLineParser:1272] DEBUG -  cToks      = json.append(cToks,substring(card, 5))
2014-04-16 02:30:34,142 [client.MapToolLineParser:1272] DEBUG -  IDresult   = IDresult + ID
2014-04-16 02:30:34,143 [model.Token:1028] DEBUG - Evaluating property: 'ID' for token Card_N3-S2-C1-F1(0A0000051C88DC69C603000008000004)----------------------------------------------------------------------------------
2014-04-16 02:30:34,144 [client.MapToolLineParser:1272] DEBUG -  switchToken(card)
2014-04-16 02:30:34,145 [client.MapToolLineParser:1272] DEBUG -  set      = listAppend(set, "<img src='"+getTokenImage()+"' height='50' width='50' border='1' alt='"+token.name+"' />"," ")
2014-04-16 02:30:34,147 [client.MapToolLineParser:1272] DEBUG -  cToks      = json.append(cToks,substring(card, 5))
2014-04-16 02:30:34,149 [client.MapToolLineParser:1272] DEBUG -  IDresult   = IDresult + ID
2014-04-16 02:30:34,150 [model.Token:1028] DEBUG - Evaluating property: 'ID' for token Card_N3-S3-C3-F2(0A0000050488DC69A203000008000004)----------------------------------------------------------------------------------
2014-04-16 02:30:34,150 [client.MapToolLineParser:1272] DEBUG -  switchToken(card)
2014-04-16 02:30:34,152 [client.MapToolLineParser:1272] DEBUG -  set      = listAppend(set, "<img src='"+getTokenImage()+"' height='50' width='50' border='1' alt='"+token.name+"' />"," ")
2014-04-16 02:30:34,153 [client.MapToolLineParser:1272] DEBUG -  cToks      = json.append(cToks,substring(card, 5))
2014-04-16 02:30:34,155 [client.MapToolLineParser:1272] DEBUG -  IDresult   = IDresult + ID
2014-04-16 02:30:34,156 [model.Token:1028] DEBUG - Evaluating property: 'ID' for token Card_N2-S3-C3-F3(0A000005E987DC697E03000008000001)----------------------------------------------------------------------------------
2014-04-16 02:30:34,157 [client.MapToolLineParser:1272] DEBUG -  setScore      = checkIDresult(IDresult)
2014-04-16 02:30:34,158 [client.MapToolLineParser:1272] DEBUG -   '<!-- ----------------------------------- checkIDresult(idResult)) -------------------------------------- -->'
2014-04-16 02:30:34,159 [client.MapToolLineParser:1272] DEBUG -   IDresult      = arg(0)
2014-04-16 02:30:34,161 [client.MapToolLineParser:1272] DEBUG -   if(argCount() > 1, 1, 0)
2014-04-16 02:30:34,162 [client.MapToolLineParser:1272] DEBUG -   loc.penalty = 0
2014-04-16 02:30:34,163 [client.MapToolLineParser:1272] DEBUG -   length(IDresult)
2014-04-16 02:30:34,164 [client.MapToolLineParser:1272] DEBUG -   <!-- ok -->
2014-04-16 02:30:34,165 [client.MapToolLineParser:1290] DEBUG - java.lang.NullPointerException
2014-04-16 02:30:34,166 [client.MapToolLineParser:1235] INFO - [h:'<!-- ----------------------------------- checkIDresult(idResult)) -------------------------------------- -->']
<!-- NO NEW SCOPE -->

<!--
   ID build up:      100   100   100   100
   numeric reference:   012   345   678   9-10-11
   types            Num   Shp   Clr   Fill
   properties         123   SOT   GBr   Full-1/2-Empty
-->
[h:IDresult      = arg(0)]
[h,if(argCount() > 1): loc.penalty   = arg(1) ; loc.penalty = 0]

<!-- make sure that the entire IDresult is 12 characters long (which it wont in case of eg 001001001001, where the first 2 0s will be truncated) -->
[switch(length(IDresult)):
   case 12:   <!-- ok -->;
   case 11:   IDresult   = "x"+IDresult;
   case 10:   IDresult   = "xx"+IDresult;
   default:    assert(0,"error with length of result ID ("+IDresult+"): "+length(IDresult),0)
]

[h,if(loc.penalty), CODE:{
   <!--   add a penalty score when add cards is used while there are sets! The point cost works the other way round so if:
         - 3 features are the SAME then it costs 7 points
         - 2 features the same: 5 points
         - 1 features the same: 3 point
         - 0 features the same: 1 point
         there is no interest for the specifics so its ony a 1 count!
   -->
   [h:setScore      = -1-2*getFindCount(strfind(IDresult, 3))]
};{
   <!-- if any 2 is found return wrong (2) else return the number of found 1 s, which is either 1 or 3. Hence this will return the value 1,2 or 3 ) -->
   [h:numbers      = if(indexOf(substring(IDresult, 0, 3),   2)   != -1, 2, getFindCount(strfind( substring(IDresult, 0, 3),    1  )))]
   [h:shapes      = if(indexOf(substring(IDresult, 3, 6),   2)   != -1, 2, getFindCount(strfind( substring(IDresult, 3, 6),    1  )))]
   [h:colors      = if(indexOf(substring(IDresult, 6, 9),   2)   != -1, 2, getFindCount(strfind( substring(IDresult, 6, 9),    1  )))]
   [h:fills      = if(indexOf(substring(IDresult, 9, 12),2)   != -1, 2, getFindCount(strfind( substring(IDresult, 9, 12),   1  )))]
   [h:setScore      = max(0,numbers-1) + max(0,colors-1) + max(0,fills-1) + max(0,shapes-1) - 1]
}]
[h:'pause("numbers","shapes","colors","fills","IDresult","setScore")']

[macro.return      = setScore]
net.rptools.parser.ParserException: java.lang.NullPointerException error executing expression <!-- ok -->.
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1291)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1146)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.functions.UserDefinedMacroFunctions.evaluate(UserDefinedMacroFunctions.java:101)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:107)
   at net.rptools.parser.Expression.evaluate(Expression.java:55)
   at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:181)
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1274)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1127)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.functions.UserDefinedMacroFunctions.evaluate(UserDefinedMacroFunctions.java:101)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
   at net.rptools.parser.Expression.evaluate(Expression.java:55)
   at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:181)
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1274)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1146)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1495)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1190)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1326)
   at net.rptools.maptool.client.functions.MacroLinkFunction.runMacroLink(MacroLinkFunction.java:440)
   at net.rptools.maptool.client.functions.MacroLinkFunction.runMacroLink(MacroLinkFunction.java:359)
   at net.rptools.maptool.client.ui.htmlframe.HTMLFrame.actionPerformed(HTMLFrame.java:236)
   at net.rptools.maptool.client.ui.htmlframe.HTMLPane.doSubmit(HTMLPane.java:101)
   at net.rptools.maptool.client.ui.htmlframe.HTMLPaneFormView.submitData(HTMLPaneFormView.java:130)
   at javax.swing.text.html.FormView.actionPerformed(Unknown Source)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:38)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
2014-04-16 02:30:34,167 [client.MapToolLineParser:1287] DEBUG - net.rptools.parser.ParserException: <br>&nbsp;&nbsp;&nbsp;Error in body of roll.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement options (if any)</u>: switch(length(IDresult))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement Body </u>:
   case 12:   <!-- ok -->;
   case 11:   IDresult   = "x"+IDresult;
   case 10:   IDresult   = "xx"+IDresult;
   default:    assert(0,"error with length of result ID ("+IDresult+"): "+length(IDresult),0)

2014-04-16 02:30:34,168 [client.MapToolLineParser:1235] INFO - [h:'<!-- ----------------------------------- checkSet -------------------------------------- -->']
[h:bot_pauseTime()]
[h:toks            = arg(0)]
[h:loc.solitaire   = arg(1)]
[broadcast("<b>Check Set</b>")]
[h:assert(listCount(toks) == 3, "You need to select exactly three cards",0)]

[h:IDresult      = 0]
[h:set         = ""]
[h:cToks      = ""]

[h,foreach(card, toks), CODE:{
   [switchToken(card)]
   [set      = listAppend(set, "<img src='"+getTokenImage()+"' height='50' width='50' border='1' alt='"+token.name+"' />"," ")]
   [cToks      = json.append(cToks,substring(card, 5))]
   [IDresult   = IDresult + ID]
}]

<!-- Defines the following variables (no new scope): numbers, colors, fills, shapes -->
[h:setScore      = checkIDresult(IDresult)]

[h:wrong      = ""]
[h,if(numbers   == 2): wrong = listAppend(wrong, "the numbers are incorrect", "<br>")]
[h,if(colors   == 2): wrong = listAppend(wrong, "the colors are incorrect", "<br>")]
[h,if(fills      == 2): wrong = listAppend(wrong, "the fills are incorrect", "<br>")]
[h,if(shapes   == 2): wrong = listAppend(wrong, "the shapes are incorrect", "<br>")]


[h,if(wrong != ""), CODE:{
   <!-- WRONG -->
   [message   = listAppend("<table><tr><td><u>"+getPlayerName()+"</u> has it <font color = 'red'>WRONG</font>",wrong,"<br>")]
   [message   = message + "</td><td>"+set+"</td></tr></table>"]
   [if(loc.solitaire), CODE:{
      [score      = getLibProperty("score", "lib:set")]
      [currPlayer   = getPlayerName()]
      [currScore   = json.get(score, currPlayer) - 1]
      [score      = json.set(score, currPlayer, currScore)]
      [setLibProperty("score", score, "lib:set")]
      [message   = message + strformat("<br>One point deducted, current score: %{currScore}"))]
   };{}]
   <!-- reset frame -->
   [playFrame("", loc.solitaire)]
};{
   <!-- CORRECT -->
   [subTime         = bot_subTime(0)]
   [totTime         = bot_totalTime(0)]
   [setTimes         = json.append(getLibProperty("setTimes", "lib:set"),subTime)]
   [setLibProperty("setTimes", setTimes, "lib:set")]
   [foundSets         = getLibProperty("foundSets", "lib:set") + 1]
   [setLibProperty("foundSets", foundSets, "lib:set")]

   [if(loc.solitaire): timeTxt   = "
      <tr><td>Time it took you to find this set: </td><td>"+bot_formatTime(subTime)+"</td></tr>
      <tr><td>Total play time: </td><td>"+bot_formatTime(totTime)+"</td></tr>
      "
   ;
      timeTxt = ""
   ]
   [bestSetTime      = json.get(json.sort(setTimes),0)]
   [bestOverallSetTime   = getLibProperty("bestOverallSetTime", "lib:set")]

   [if(bestSetTime < bestOverallSetTime), CODE:{
      [setLibProperty("bestOverallSetTime", bestSetTime, "lib:set")]
      [newRecordTxt   = "<tr><td><font color='red'><b>NEW RECORD</b> (fastest identified set):</font></td><td>"+bot_formatTime(bestSetTime)+"</td></tr>"]
   };{
      [newRecordTxt   = ""]
   }]
   [message       = "<table><tr><td><u>"+getPlayerName()+"</u> has it <font color = 'green'>RIGHT </font></td><td>"+set+"</td></tr>"+timeTxt+newRecordTxt+"</table>"]

['pause("subTime","totTime","setTimes","loc.solitaire","timeTxt","bestSetTime","bestOverallSetTime","newRecordTxt","message")']
   <!-- clear the table -->
   [loc.currentTable   = getLibProperty("currentTable", "lib:set")]
   [nTable            = json.length(loc.currentTable)]
   [oldNTable         = nTable]
   [foreach(tok, loc.currentTable): removeToken("Card_"+tok)]

   <!-- remove cards from table deck -->
   [loc.currentTable   = json.difference(loc.currentTable, cToks)]

   <!-- spread the current table cards on the table -->
   [nTable         = json.length(loc.currentTable)]
   [divider      = floor(sqrt(nTable))]
   [count(nTable), CODE:{
      [y         = mod(roll.count,divider)]
      [x         = floor(roll.count/divider)]
      [tok      = json.get(loc.currentTable, roll.count)]
      [copyToken(tok, 1, getCurrentMapName(), strformat('{"x":%{x}, "y":%{y}, "name":"Card_%{tok}"}'))]
   }]

   <!-- add cards if below 12 -->
   [setLibProperty("currentTable", loc.currentTable, "lib:set")]
   [if(nTable < 12): addCards()]
      
   <!-- update score -->   
   [players   = getAllPlayerNames()]
   [currPlayer   = getPlayerName()]
   [score      = getLibProperty("score", "lib:set")]

   <!-- in solitaire mode you get:
   - 1 point + 2 extra points for every *extra* different property the set has and (result is either 0=all same or 3=all different)
   - 3 extra points when the table counts 12 (2 on 15, 1 on 18 and 0 on 21)
   - 5 points for faster than 5 seconds, 4 for 10, 3 for 15 etc.
   -->
   [if(loc.solitaire), CODE:{
      [nCardScore   = 8 - (oldNTable/3)]
      <!-- setScore is calculated in checkIDresult -->
      [timeScore   = max(0, 5 - ceil(subTime/5000))]
      [solScore   = nCardScore + setScore + timeScore]
   };{
      [solScore   = 1]
      [oldNTable   = 0]
   }]
   
   [nDeck      = json.length(getLibProperty("currentDeck", "lib:set"))]
   [msgScore   = strformat("<table>"
                  +if(loc.solitaire, "<tr><td>This set is %{solScore} points worth (%{oldNTable} cards = %{nCardScore} ; set = %{setScore} ; time = %{timeScore}).</td></tr>", "")+
                  "<tr><td>Current Score (%{nDeck} Cards left):"
   )]
   [foreach(player, players), CODE:{
      [currScore   = json.get(score, player)]
      [if(currPlayer == player): currScore = currScore + solScore]
      [score      = json.set(score, player, currScore)]
      [msgScore   = listAppend(msgScore, player+": </td><td>"+currScore, "</td></tr><tr><td>")]
   }]
   [msgScore      = msgScore + "</td></tr></table>"]
   [message      = message + msgScore]
   [setLibProperty("score", score, "lib:set")]

   <!-- reset all frames -->
   [openPlayerFrame(loc.solitaire)]
}]

[broadcast(message)]

[h:loc.currentTable   = getLibProperty("currentTable", "lib:set")]
[h:nTable         = json.length(loc.currentTable)]
[h:nDeck         = json.length(getLibProperty("currentDeck", "lib:set"))]

[h,if(nDeck + nTable < 1 && loc.solitaire): endGame(totTime)]
[h:bot_resumeTime()]
net.rptools.parser.ParserException: <br>&nbsp;&nbsp;&nbsp;Error in body of roll.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement options (if any)</u>: switch(length(IDresult))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement Body </u>:
   case 12:   <!-- ok -->;
   case 11:   IDresult   = "x"+IDresult;
   case 10:   IDresult   = "xx"+IDresult;
   default:    assert(0,"error with length of result ID ("+IDresult+"): "+length(IDresult),0)

   at net.rptools.maptool.client.MapToolLineParser.doError(MapToolLineParser.java:1631)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1236)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.functions.UserDefinedMacroFunctions.evaluate(UserDefinedMacroFunctions.java:101)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:107)
   at net.rptools.parser.Expression.evaluate(Expression.java:55)
   at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:181)
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1274)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1127)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.functions.UserDefinedMacroFunctions.evaluate(UserDefinedMacroFunctions.java:101)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
   at net.rptools.parser.Expression.evaluate(Expression.java:55)
   at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:181)
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1274)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1146)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1495)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1190)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1326)
   at net.rptools.maptool.client.functions.MacroLinkFunction.runMacroLink(MacroLinkFunction.java:440)
   at net.rptools.maptool.client.functions.MacroLinkFunction.runMacroLink(MacroLinkFunction.java:359)
   at net.rptools.maptool.client.ui.htmlframe.HTMLFrame.actionPerformed(HTMLFrame.java:236)
   at net.rptools.maptool.client.ui.htmlframe.HTMLPane.doSubmit(HTMLPane.java:101)
   at net.rptools.maptool.client.ui.htmlframe.HTMLPaneFormView.submitData(HTMLPaneFormView.java:130)
   at javax.swing.text.html.FormView.actionPerformed(Unknown Source)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:38)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
2014-04-16 02:30:34,169 [client.MapToolLineParser:1287] DEBUG - net.rptools.parser.ParserException: <br>&nbsp;&nbsp;&nbsp;Error in body of roll.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement options (if any)</u>: h<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement Body </u>: setScore      = checkIDresult(IDresult)
2014-04-16 02:30:34,170 [client.MapToolLineParser:1235] INFO - <!-- SET -->
   [checkSet(toks,solitaire)]
net.rptools.parser.ParserException: <br>&nbsp;&nbsp;&nbsp;Error in body of roll.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement options (if any)</u>: h<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement Body </u>: setScore      = checkIDresult(IDresult)
   at net.rptools.maptool.client.MapToolLineParser.doError(MapToolLineParser.java:1631)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1236)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.functions.UserDefinedMacroFunctions.evaluate(UserDefinedMacroFunctions.java:101)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
   at net.rptools.parser.Expression.evaluate(Expression.java:55)
   at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:181)
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1274)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1146)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1495)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1190)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1326)
   at net.rptools.maptool.client.functions.MacroLinkFunction.runMacroLink(MacroLinkFunction.java:440)
   at net.rptools.maptool.client.functions.MacroLinkFunction.runMacroLink(MacroLinkFunction.java:359)
   at net.rptools.maptool.client.ui.htmlframe.HTMLFrame.actionPerformed(HTMLFrame.java:236)
   at net.rptools.maptool.client.ui.htmlframe.HTMLPane.doSubmit(HTMLPane.java:101)
   at net.rptools.maptool.client.ui.htmlframe.HTMLPaneFormView.submitData(HTMLPaneFormView.java:130)
   at javax.swing.text.html.FormView.actionPerformed(Unknown Source)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:38)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
2014-04-16 02:30:34,171 [client.MapToolLineParser:1235] INFO - [h:'<!-- -------------------------------- playButtonHandler () --------------------------------------->']
[h:args      = macro.args]
[h:varsFromStrProp(args)]
[h:'pause("args")']
[h,if(indexOf(args,"delete") != -1), CODE:{
   <!-- REMOVE CARD -->
   [delete = json.fromList("Card_"+substring(delete, 13))]
   [playFrame(json.difference(toks, delete), solitaire)]
};{}]

[h,if(indexOf(args,"SET") != -1), CODE:{
   <!-- SET -->
   [checkSet(toks,solitaire)]
};{}]

[h,if(indexOf(args,"CLEAR") != -1), CODE:{
   <!-- CLEAR PANEL -->
   [playFrame("", solitaire)]
};{}]
net.rptools.parser.ParserException: <br>&nbsp;&nbsp;&nbsp;Error in body of roll.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement options (if any)</u>: <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement Body </u>: checkSet(toks,solitaire)
   at net.rptools.maptool.client.MapToolLineParser.doError(MapToolLineParser.java:1631)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1236)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1495)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1190)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1326)
   at net.rptools.maptool.client.functions.MacroLinkFunction.runMacroLink(MacroLinkFunction.java:440)
   at net.rptools.maptool.client.functions.MacroLinkFunction.runMacroLink(MacroLinkFunction.java:359)
   at net.rptools.maptool.client.ui.htmlframe.HTMLFrame.actionPerformed(HTMLFrame.java:236)
   at net.rptools.maptool.client.ui.htmlframe.HTMLPane.doSubmit(HTMLPane.java:101)
   at net.rptools.maptool.client.ui.htmlframe.HTMLPaneFormView.submitData(HTMLPaneFormView.java:130)
   at javax.swing.text.html.FormView.actionPerformed(Unknown Source)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.awt.EventQueue$4.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:38)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
[/spoiler]

edit: error not there with new download. I'll play around with it and let you know.

User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by wolph42 »

wow you get an entirely different error report then me! I got ONE line npe. You got a full blown report. anyway:
net.rptools.parser.ParserException: java.lang.NullPointerException error executing expression <!-- ok -->.


see post above. You were testing the old version.

edit: added a version button so you can check the version. On the lib there should be a black button at the bottom called version 3.1

User avatar
aliasmask
Deity
Posts: 8578
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Wolph42's 'SET' Card Game Framework v3.2

Post by aliasmask »

I did get a new error when clicking End Game.

[spoiler=]

Code: Select all

2014-04-16 02:34:47,494 [client.MapToolLineParser:1272] DEBUG - endGame()
2014-04-16 02:34:47,495 [client.MapToolLineParser:1272] DEBUG -  '<!-- ----------------------------------- endGame (totTime) -------------------------------------- -->'
2014-04-16 02:34:47,496 [client.MapToolLineParser:1272] DEBUG -  if(argCount(), 1, 0)
2014-04-16 02:34:47,496 [client.MapToolLineParser:1272] DEBUG -  totTime      = bot_totalTime(0)
2014-04-16 02:34:47,497 [client.MapToolLineParser:1272] DEBUG -   '<!-- ----------------------- bot_totalTime([makeup]) ---------------------------------- -->'
2014-04-16 02:34:47,498 [client.MapToolLineParser:1272] DEBUG -   if(argCount() > 0, 1, 0)
2014-04-16 02:34:47,498 [client.MapToolLineParser:1272] DEBUG -   makeUp = arg(0)
2014-04-16 02:34:47,499 [client.MapToolLineParser:1272] DEBUG -   time         = if(   getLibProperty("w42.bot.timeIsPaused", "lib:EventMacros"),
                  getLibProperty("w42.bot.pauseTime", "lib:EventMacros") ,
                  json.get(getInfo("client"), "timeInMs") - getLibProperty("w42.bot.pausedTime", "lib:EventMacros")
)
2014-04-16 02:34:47,522 [client.MapToolLineParser:1272] DEBUG -   startTime   = getLibProperty("w42.bot.startTime", "lib:EventMacros")
2014-04-16 02:34:47,523 [client.MapToolLineParser:1272] DEBUG -   resultTime   = time - startTime
2014-04-16 02:34:47,524 [client.MapToolLineParser:1272] DEBUG -   if(makeUp, 1, 0)
2014-04-16 02:34:47,525 [client.MapToolLineParser:1272] DEBUG -   ''
2014-04-16 02:34:47,526 [client.MapToolLineParser:1272] DEBUG -   macro.return   = resultTime
2014-04-16 02:34:47,527 [client.MapToolLineParser:1272] DEBUG -  bestGameTime   = getLibProperty("bestGameTime", "lib:set")
2014-04-16 02:34:47,528 [client.MapToolLineParser:1272] DEBUG -  bestSetTime   = json.get(json.sort(getLibProperty("setTimes", "lib:set")),0)
2014-04-16 02:34:47,530 [client.MapToolLineParser:1290] DEBUG - java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
2014-04-16 02:34:47,530 [client.MapToolLineParser:1235] INFO - [h:'<!-- ----------------------------------- endGame (totTime) -------------------------------------- -->']
<!-- GAME OVER -->
[if(argCount()): totTime = arg(0) ; totTime      = bot_totalTime(0)]
[bestGameTime   = getLibProperty("bestGameTime", "lib:set")]
[bestSetTime   = json.get(json.sort(getLibProperty("setTimes", "lib:set")),0)]
[currScore      = json.get(getLibProperty("score", "lib:set"), getPlayerName())]
[loc.foundSets   = getLibProperty("foundSets", "lib:set")]
[loc.solitaire   = getLibProperty("solitaire", "lib:set")]
[nDeck         = json.length(getLibProperty("currentDeck", "lib:set"))]
[nTable         = json.length(getLibProperty("currentTable", "lib:set"))]

<!-- 20 extra points for clearing the table -->
[if(!nDeck + nTable): currScore   = currScore + 20]

[if(totTime < bestGameTime), CODE:{
   [setLibProperty("bestGameTime", totTime, "lib:set")]
   [newRecordTxt   = "<tr><td><font color='red'><b>NEW RECORD</b> (fastest played game):</font></td><td><font color='red'><b>" + bot_formatTime(bestGameTime) + "</b></font></td></tr>"]
};{
   [newRecordTxt   = ""]
}]

[bestScore   = getLibProperty("bestScore", "lib:set")]
[if(currScore < bestScore), CODE:{
   [setLibProperty("bestScore", score, "lib:set")]
   [newRecordTxt   = newRecordTxt + "<tr><td><font color='red'><b>NEW RECORD</b> (best solitaire mode score):</font></td><td><font color='red'><b>" + currScore + "</b></font></td></tr>"]
};{}]

[if(loc.solitaire):
   scoreTxt   =   if(!(nDeck + nTable), "<tr><td>Table Cleared</td><td>+20 points</td></tr>","") +
               "<tr><td><font color='red'><b>Total Score</b> (solitaire mode):</font></td><td><font color='red'><b>" + currScore + "</b></font></td></tr>"
;
   scoreTxt   = ""
]

[avgTime      = bot_formatTime(floor(totTime/27))]
[bestSetTime   = bot_formatTime(bestSetTime)]
[totTime      = bot_formatTime(totTime)]
[message      = strformat("
   <table>
      <tr><td colspan=2><font color = 'red'><b>GAME OVER! </b></font></td></tr>
      <tr><td>Total Game time:</td><td>%{totTime}</td></tr>
      <tr><td>Fastest identified set:</td><td>%{bestSetTime}</td></tr>
      <tr><td>Total identified sets:</td><td>%{loc.foundSets}</td></tr>
      <tr><td>Average time per set:</td><td>%{avgTime}</td></tr>
      %{scoreTxt}
      %{newRecordTxt}
   </table>
")]
[broadcast(message)]
[abort(0)]
net.rptools.parser.ParserException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 error executing expression bestSetTime   = json.get(json.sort(getLibProperty("setTimes", "lib:set")),0).
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1291)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1146)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.functions.UserDefinedMacroFunctions.evaluate(UserDefinedMacroFunctions.java:101)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
   at net.rptools.parser.Expression.evaluate(Expression.java:55)
   at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:181)
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1274)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1146)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:608)
   at net.rptools.maptool.client.macro.MacroManager.executeMacro(MacroManager.java:213)
   at net.rptools.maptool.client.ui.commandpanel.CommandPanel.commitCommand(CommandPanel.java:494)
   at net.rptools.maptool.model.MacroButtonProperties.executeCommand(MacroButtonProperties.java:419)
   at net.rptools.maptool.model.MacroButtonProperties.executeMacro(MacroButtonProperties.java:308)
   at net.rptools.maptool.client.ui.macrobuttons.buttons.MacroButton.mouseReleased(MacroButton.java:194)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access(Unknown Source)
   at java.awt.EventQueuerun(Unknown Source)
   at java.awt.EventQueuerun(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomaindoIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomaindoIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueuerun(Unknown Source)
   at java.awt.EventQueuerun(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomaindoIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:38)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
2014-04-16 02:34:47,531 [client.MapToolLineParser:1287] DEBUG - net.rptools.parser.ParserException: <br>&nbsp;&nbsp;&nbsp;Error in body of roll.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement options (if any)</u>: <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement Body </u>: bestSetTime   = json.get(json.sort(getLibProperty("setTimes", "lib:set")),0)
2014-04-16 02:34:47,531 [client.MapToolLineParser:1235] INFO - [endGame()]
net.rptools.parser.ParserException: <br>&nbsp;&nbsp;&nbsp;Error in body of roll.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement options (if any)</u>: <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Statement Body </u>: bestSetTime   = json.get(json.sort(getLibProperty("setTimes", "lib:set")),0)
   at net.rptools.maptool.client.MapToolLineParser.doError(MapToolLineParser.java:1631)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1236)
   at net.rptools.maptool.client.MapToolLineParser.runMacroBlock(MapToolLineParser.java:1500)
   at net.rptools.maptool.client.MapToolLineParser.runMacro(MapToolLineParser.java:1431)
   at net.rptools.maptool.client.functions.UserDefinedMacroFunctions.evaluate(UserDefinedMacroFunctions.java:101)
   at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
   at net.rptools.parser.Expression.evaluate(Expression.java:55)
   at net.rptools.common.expression.ExpressionParser.evaluate(ExpressionParser.java:181)
   at net.rptools.maptool.client.MapToolLineParser.parseExpression(MapToolLineParser.java:1274)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:1146)
   at net.rptools.maptool.client.MapToolLineParser.parseLine(MapToolLineParser.java:608)
   at net.rptools.maptool.client.macro.MacroManager.executeMacro(MacroManager.java:213)
   at net.rptools.maptool.client.ui.commandpanel.CommandPanel.commitCommand(CommandPanel.java:494)
   at net.rptools.maptool.model.MacroButtonProperties.executeCommand(MacroButtonProperties.java:419)
   at net.rptools.maptool.model.MacroButtonProperties.executeMacro(MacroButtonProperties.java:308)
   at net.rptools.maptool.client.ui.macrobuttons.buttons.MacroButton.mouseReleased(MacroButton.java:194)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access(Unknown Source)
   at java.awt.EventQueuerun(Unknown Source)
   at java.awt.EventQueuerun(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomaindoIntersectionPrivilege(Unknown Source)
   at java.security.ProtectionDomaindoIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueuerun(Unknown Source)
   at java.awt.EventQueuerun(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomaindoIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:38)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
[/spoiler]

User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'SET' Card Game Framework v3.0

Post by wolph42 »

indeed, if you 'give up' when you did not even got ONE set, you get that error. Added an assertion. Also see my earlier edits about versions.
New version available. Thnx for the patience and testing results!

version 3.2 by now.

funny thing is (for me) that the game is about as much fun playing as programming. Especially the findSets() macro was quite a challenge. Stupifyingly enough though I had the biggest problem with gettting json.evaluate working. (due to lack of example). I tried edting the wiki afterwards, but got an database error.


User avatar
wolph42
Deity
Posts: 9703
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Wolph42's 'SET' Card Game Framework v4

Post by wolph42 »

Good news everyone!

I found another set on the interweb en embedded that one as well. Its on another map, to play with it, just switch maps and hit the play button.

Post Reply

Return to “Campaign Frameworks”