Top

Word and Character Counter


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Dec 24, 2008
Last Updated  Dec 25, 2008
Tags  character  counter 

Introduction

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

Grab the Code

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
}
 

Comments

  (5)  RSS
^Neptune
Comments: 597
 
mIRC Snippet:  Word and Character Counter
Posted on Dec 24, 2008 8:11 am
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.

Code:

  did -ra cc 5 $len( $+ $did(1).text $+ )


Could just be

Code:

  did -ra cc 5 $len($did(1))


Don't see why you put the $+ in there :x.
Scakk
Comments: 296
 
mIRC Snippet:  Word and Character Counter
Posted on Dec 24, 2008 8:58 am
It stops adding at 949 even though you can continue to add to the edit box.
mountaindew
Comments: 1,826
 
mIRC Snippet:  Word and Character Counter
Posted on Dec 24, 2008 9:06 am
Code:

  if ($devent == sclick) {
    if ($did == 2) { did -r CC 1 }
  }
  if ($devent == sclick) {
    if ($did == 3) { dialog -x cc cc }
  }

You could combine the two if's
Code:

if ($devent == sclick) {
  if ($did == 2) did -r CC 1
  if ($did == 3) did -x cc cc
}
Typo
Comments: 224
 
mIRC Snippet:  Word and Character Counter
Posted on Dec 24, 2008 1:41 pm
`Green said:
Quote:
i don't know if i can make a word counter but i made a character counter :)

You can count words with:
Code:
$numtok(TEXT,32)

For instance, if you type the following in mirc:
Code:
//var %Words = How many words is this? | echo -a $qt(%Words) has $numtok(%Words,32) words.

You will see:
Quote:
"How many words is this?" has 5 words.

Good luck.
`Green
Comments: 34
 
mIRC Snippet:  Word and Character Counter
Posted on Dec 25, 2008 11:10 pm
oh and scakk. it stops at 4250 chars for me.

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom