word completer
Posted by Parasite-FT-
Saturday, May 08, 2004
Description: hit F1 to cycle through the possible matches

Simply stated, it's a word completer. Much like a nick completer (by pressing tab) you just type part of a word and hit F1 to cycle through your choices; when I think about it, it's really stupid and I'll prolly never use it unless I'm checking for an alternative spelling. Anyway, just like the tab nick completer it'll update your editbox dynamically, which is always fun.

ie,
I have this in my editbox:

hello ther

then i hit F1 and it shows this in my editbox:

hello therefore

i hit F1 again (within 3 seconds, else the next time it'll go back to the first result):

hello there

and YAY, I have the word I was looking for after cycling through 1 other word. The pain of it is that you may have to cycle through lots of words, and that's not cool. Thankfully, to reduce the number of possible matches, I'm using a dictionary file which lists words in the order they're commonly used. This means "Hello" will appear before "Hellanistic".

You must download the dictionary file and put it in the same directory you save the script (most often just the mIRC folder.) The dictionary file can be found here: http://www.dict.org/100kfound.txt.gz - keep the file name the same after you unzip it.

Cheers, hope someone uses it.

- Para



;; Function: autocompletes your words, kinda neat
;; Usage: hit F1 while typing a word - hit repeatedly to get new words that might match
;; Comments: uses the dictionary file from http://www.dict.org/100kfound.txt.gz
alias F1 {
  var %file = $scriptdir100kfound.txt
  ; increase the line number from which you should read (else it'll complete the same word each time)
  inc -u3 %completer.last
  ; set the word that you're trying to replace - or maintain the variable for another 3 seconds
  set -u3 %completer.word $iif(%completer.word,%completer.word,$gettok($editbox($active),-1,32))
  ; set the token number that you're trying to replace - or maintain the variable for another 3 seconds
  set -u3 %completer.num $iif(%completer.num,%completer.num,$numtok($editbox($active),32))
  ; read the bloody file (note that each line has a number, then a tab, then the word)
  var %read = $read(%file,nw,$+(*,$chr(9),%completer.word $+ *),%completer.last)
  if (%read) {
    ; parse out the new word (get rid of tab and any multiple words)
    var %newword = $gettok($gettok(%read,2,9),1,32)
    ; update the editbox
    editbox -ap $puttok($editbox($active),%newword,%completer.num,32)
    ; set the last read line number
    set -u5 %completer.last $readn
  }
}
hey now
Posted by CrashB
Sunday, May 16, 2004 05:45am PDT
this is actually kinda cool.  i consider my vocabulary to be quite extensive, but on a very seldom occasion, i find myself trying to remember how to spell something, and well, yea.... w00tipops!
*nix got me going on that
Posted by B1NG3
Friday, May 21, 2004 07:56pm PDT
Over the years I have noticed myself pressing tab to finish a word in the mIRC editbox to complete a word because linux has always done that :P
Now I can sleep at night knowing that in the morning I can press F1 and not feel stupid when nothing happens :D
not working
Posted by Scoobster
Thursday, May 27, 2004 05:18pm PDT
it isnt working for me :/
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world