Um, another idea would be, and this depends on the card game you are making, would be to only have variables for the cards in play. This seems like the route to me if you were making a poker or blackjack game. I guess reguardless you could set it up something like this...
command <draw> {
set numeric <cardsinhand; 0>
for each object in <inventory> set numeric <cardsinhand; %cardsinhand% + 1>
set numeric <carddraw; $rand(1;13)$>
set numeric <suitdraw; $rand(1;4)$>
for each object in <inventory> if not <%suitdraw%-%carddraw%> then {
for each object in <opponent-inventory> if not <%suitdraw%-%carddraw%> give <%suitedraw%-%carddraw%>
}
}
else exec <draw>
Or something like that, gotta go. Screaming BABIES!!!!