this is a dialog snippet made to count the character's of a line. its not very useful but i think i remember someone saying that they wanted a word counter. i don't know if i can make a word counter but i made a character counter :)
UPDATED
now has a word counter and a character counter. thank you typo :)
BUG
only counts the first line
dialog CC {
title "Charactor Counter"
size -1 -1 147 63
option dbu
edit "", 1, 1 24 145 38, multi return autovs
button "Clear", 2, 1 1 72 11
button "Close", 3, 77 1 69 11
text "Words:", 4, 2 14 18 8
edit "", 5, 20 13 46 10, read
text "Caracters:", 6, 68 14 25 8
edit "", 7, 93 13 52 10, read
}
on *:dialog:CC:*:*:{
did -ra cc 5 $numtok($did(1),32)
did -ra cc 7 $len($did(1))
if ($devent == sclick) {
if ($did == 2) did -r CC 1
if ($did == 3) dialog -x cc cc
}
}
menu * {
.Charactor Counter: dialog -m CC CC
}
`Green said:
i don't know if i can make a word counter but i made a character counter :)
You can count words with:
$numtok(TEXT,32)
For instance, if you type the following in mirc:
//var %Words = How many words is this? | echo -a $qt(%Words) has $numtok(%Words,32) words.
You will see:
"How many words is this?" has 5 words.
Good luck.
Eh, it works I guess. You could expand it alot more by using a multi-line edit box for people to count essays, etc. Also, I think it would look cooler changing the length not on sclick, but on edit of the text box itself.
did -ra cc 5 $len( $+ $did(1).text $+ )
Could just be
did -ra cc 5 $len($did(1))
Don't see why you put the $+ in there :x.