Jethro commented on a Page, Star Awards  -  Dec 25, 2009

Here is my version:

on $*:TEXT:/((?<=\41)\w+)-star\s(\S+)/iS:#: {
  if ($regml(2) ison #) {
    if ($regml(1) = gold) { inc $+(%,$regml(1),$nick)
      .describe # gives $regml(2) a $regml(1) Star 8,2 ✩  for excellence. $&
        $nick has given out $iif($($+(%,$regml(1),$nick),2) = 1,$v1 $regml(1) Star award.,$v1 $regml(1) Star awards.)
    }
    if ($regml(1) = silver) { inc $+(%,$regml(1),$nick)
      .describe # gives $regml(2) a $regml(1) Star 0,2 ✩  for effort. $&
        $nick has given out $iif($($+(%,$regml(1),$nick),2) = 1,$v1 $regml(1) Star award.,$v1 $regml(1) Star awards.)
    }
    if ($regml(1) = bronze) { inc $+(%,$regml(1),$nick)
      .describe # gives $regml(2) a $regml(1) Star 7,2 ✩  for at least trying. $&
        $nick has given out $iif($($+(%,$regml(1),$nick),2) = 1,$v1 $regml(1) Star award.,$v1 $regml(1) Star awards.)
    }
  }
}

Using multiple $iif()s is going to make a mess and that color codes may not display correctly. The regular if statements are cleaner and clear to see. The usage is the same as Pangaea's.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.