mIRC Homepage
Posted By: GalaxeY Word counter - 15/06/04 08:37 PM
I'm a very noob at scripting. but is there a way to count the words on a channel?

on *:text:*:#:{
set %words
}
on *:text:!words:#:{
Its been typed %words of words here!
}

or sumthing..?
Posted By: Zyzzyx26 Re: Word counter - 15/06/04 08:39 PM
Code:
on *:TEXT:*:#: set %words %words $1-

on *:text:!words:#:{
 var %typed = $numtok(%words,32)
 msg # Its been typed %typed of words here!
}
This is untested, but should work.

Zyzzy smile
Posted By: tidy_trax Re: Word counter - 15/06/04 08:42 PM
on *:text:*:#:{
inc %words $+ $chan $0
if $1 == !words { msg $chan %word [ $+ [ $chan ] ] words have been said here }
}

edit:
Zyzzyx26: that would work, but mIRC's variable character limit is too small for this task, that also keeps a count of all words on all channels, instead of a counter for each channel.
Posted By: GalaxeY Re: Word counter - 15/06/04 08:49 PM
Thanks, but now I got a problem..:

<GalaxeY> !words
<GalaxeYBot> 4 words have been said here
<GalaxeY[TPS]> !words
<EWatsonBot> 5 words have been said here

Thats a probelem. how to do that? if typed !words, it not count !words?
Posted By: Zyzzyx26 Re: Word counter - 15/06/04 08:51 PM
Very true, thanks! smile Didn't think about that!
Posted By: DixrouE Re: Word counter - 15/06/04 09:08 PM
on *:text:*:#:{
if $1 == !words { msg $chan %word [ $+ [ $chan ] ] words have been said here }
else inc %words $+ $chan $0
}
Posted By: GalaxeY Re: Word counter - 15/06/04 09:11 PM
Thanks! But..

<GalaxeY> !words
<GalaxeYBot> words have been said here
<GalaxeY> s
<GalaxeYBot> 1 words have been said here

can it be like if %words = 0 halt or sumthing?
Posted By: DixrouE Re: Word counter - 15/06/04 09:24 PM
on *:text:*:#:{
if ($1 == !words) && (%word [ $+ [ $chan ] ]) { msg $chan %word [ $+ [ $chan ] ] words have been said here }
else inc %words $+ $chan $0
}
Posted By: GalaxeY Re: Word counter - 15/06/04 09:27 PM
Thanks ALOT DixrouE!!!!!!
© mIRC Discussion Forums