word/letter counter

By `JoKeR´ on Sep 19, 2008

This was more or less a solution to the problem of Jamiie's predicament. The word counter is based off of another counter, I believe, but the letter counter was completely mine. Feel free to do whatever.

Total size: 688 bytes.

edit - Updated (yet again) with thanks to napa182, RusselB, and mountaindew for ideas, comments, and for the challenge to make it smaller. ^_^

on *:text:*:#:{
  if $1 = !score && !%spam {
    set -u3 %spam 1
    notice $nick $chr(91) Word Count: $readini(wlcount.ini,$nick,words) / Letter Count: $readini(wlcount.ini,$nick,letters) $chr(93) as of $fulldate $+ .
  }
  if $readini(wlcount.ini,$nick,words) = $null && $readini(wlcount.ini,$nick,letters) = $null {
    writeini -n wlcount.ini $nick words 0
    writeini -n wlcount.ini $nick letters 0
  }
  else {
    var %wscore $calc($0 + $readini(wlcount.ini,$nick,words))
    writeini -n wlcount.ini $nick words %wscore
    var %lscore $calc($len($remove($1-,$chr(32)))) + $readini(wlcount.ini,$nick,letters))
    writeini -n wlcount.ini $nick letters %lscore
  }
}

Comments

Sign in to comment.
Trotils   -  Jan 12, 2011

would love to see top 10 or top 5 of most typing users :)

 Respond  
jackster35-1   -  Jan 29, 2010

.

 Respond  
`JoKeR´   -  Sep 19, 2008

Ah, thanks. Didn't even think about it. :D Fixed. ^_^

 Respond  
napa182   -  Sep 19, 2008

why even use

var %letters $replace($1-,$chr(32),$chr(0))

when you can just use

$len($remove($1-,$chr(32)))
 Respond  
guest598594   -  Sep 19, 2008
    var %letters $replace($1-,$chr(32),$chr(0))

Could just use $remove:

    var %letters $remove($1-,$chr(32))
 Respond  
Jamiie   -  Sep 19, 2008

Thanks Joker, it works fine. 9/10+like

 Respond  
`JoKeR´   -  Sep 19, 2008

Removed the else halt and compacted it to a single event. Also made one *.ini file. Any other suggestions are welcomed. :)

 Respond  
napa182   -  Sep 19, 2008

why not just make it one text event
and why the else halt ?

 Respond  
56Avenue   -  Sep 19, 2008

Works really good, 8/10.

 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.