im stuck on one part

if ($did == 10) {
did -r $dname 13
var %nicks = $nick($active,0)
while (%nicks > 0) {
did -a $dname 13 $nick($active,%nicks)
dec %nicks
did -ra $dname 15 $nick($active,0)

i am having trouble gettin code to only add users to list box that have say %usergiveawaytokenDaRkCaSTLe- 5
only wanna add people to list that have
%usergiveawaytoken* = to 4 or more
can someone pls help with this tyvm in advance