In the on text event, it's missing an
evaluation of the variable to get not the variable's name, but it's value:
$($+(%,peak.,$chan)
,2)on *:text:!peak:#yourchan,#anotherchan,...: {
var %val = $($+(%,peak.,$chan),2)
msg $chan On $date($gettok(%val,2,32),mmm dd yyyy) $+ , there were $gettok(%val,1,32) users in $chan $+ !
}
To format the output of the date/time, check:
/help $asctime
e.g:
$asctime($gettok(%val,2,32)
,mmmm dd yyyy - hh:nn:ss tt) will return something like "July 07 2007 - 08:21:28 am"
... $date can be used as well, sure
Edit: And I wonder why you don't use Riamus2's nice hash based code...