The option (not the command) getpiecelists give comma separated lists of positions. You must parse this list e.g. with \@for to count them:
\documentclass{article}
\usepackage{xskak,chessboard}
\begin{document}
\newchessgame
\chessboard[getpiecelists]%
\newcounter{countrook}
\setcounter{countrook}{0}
\makeatletter
\@for\templist:=\cblistr \do {\stepcounter{countrook}}
\makeatother
Number of black rooks: \thecountrook. They are at the positions \cblistr.
\end{document}
Edit: You can try this to get the various counts (I also change the command so that \cblist... now it defined also for pieces which are not on the board):
\documentclass{article}
\usepackage{xskak,chessboard}
\makeatletter
\renewcommand\board@do@getpiecelists{%
\setcounter{cnt@board@file}{\board@val@minfilenum}%
\setcounter{cnt@board@rank}{\board@val@minranknum}%
\edef\board@temp@curlist{% changed 3.2.2012 to parse all pieces.
\board@skak@piececharlist}
\@for\board@temp@piecechar:=\board@temp@curlist
\do {%
\expandafter\xdef\csname cblist\board@temp@piecechar\endcsname{}% 3.2.2012 global
\expandafter\xdef\csname cblistnum\board@temp@piecechar\endcsname{0}% 3.2.2012 new
\expandafter\def\csname board@temp@\board@temp@piecechar @comma\endcsname{}}%
\xdef\cblistempty{}%
\xdef\cblistnumempty{}% 3.2.2012
\def\board@temp@empty@comma{}%
\whiledo
{\value{cnt@board@file}<\numexpr \board@val@maxfilenum+1\relax}%
{\whiledo
{\value{cnt@board@rank}<\numexpr \board@val@maxranknum+1\relax}%
{\edef\board@temp@piecechar{%
\csname
board@val@f\the\c@cnt@board@file r\the\c@cnt@board@rank @piecechar\endcsname}%
\edef\board@temp@curlist{%
\csname cblist\board@temp@piecechar\endcsname}%
\edef\board@temp@comma{%
\csname board@temp@\board@temp@piecechar @comma\endcsname}%
\expandafter\xdef\csname cblist\board@temp@piecechar \endcsname{%
\board@temp@curlist
\board@temp@comma
\alph{cnt@board@file}\the\c@cnt@board@rank}%
\expandafter\xdef\csname cblistnum\board@temp@piecechar\endcsname{\the\numexpr \csname cblistnum\board@temp@piecechar\endcsname +1}% 3.2.2012
\expandafter\def
\csname board@temp@\board@temp@piecechar @comma\endcsname
{,}%
\stepcounter{cnt@board@rank}}%
\setcounter{cnt@board@rank}{\board@val@minranknum}%
\stepcounter{cnt@board@file}}}
\makeatother
\begin{document}
\newchessgame
\chessboard[setpieces={Ke1,Ra1,Ra3,Ra5},getpiecelists,marginleft=false]
White king: \cblistnumK
White rooks: \cblistnumR
White pieces: \the\numexpr \cblistnumK + \cblistnumQ +\cblistnumR
+\cblistnumB + \cblistnumN + \cblistnumP\relax
empty fields: \cblistnumempty
\end{document}
xskakandchessboard: then experienced TeX users who don't know about those slightly uncommon packages can try this MWE and dissect it/hack. – Bruno Le Floch Feb 3 '12 at 2:21