mIRC Homepage
I am my colleagues find ourselves repeatedly trying to tab complete words that have been said in the channel (such as is the functionality with nicknames). I was wondering if it would be possible to add a feature that would allow users to tab-complete regular words that have been said in the last 2-10 lines.

Thank you, I hope this feature is a possibility.
this thread should interest you
I'd like to see this, it would make interacting with mirc QUITE a lot quicker...
Lets hope this post doesn't dissolve into a rant against lazy typers - lemmie bung out a quick script that might be able to do this.

alias f3 {
;Get active window text
var %temp = $editbox($active)
tokenize 32 %temp

;Work out the last word, this will typically be the word to complete
var %word = $eval($ $+ $0,2)

editbox -a $replace($1-,%word,$chr(32) $+ $read(words.txt, w,%word $+ *))
}
on *:text:*:#:{
var %i = 1
while (%i <= $0) {
write words.txt $eval($ $+ %i,2)
inc %i
}
}


This is just a really simple example script - you could do improvements in heaps of areas:
-Cleaning up the lines after N minutes
-Only adding words with a length longer than X amount of characters
-Seperate windows have seperate files
-Multiple calls to the alias store the last word and cycle through the words, remembering offsets and the like. The counters would be cleared if the word doesn't match the last remembered word.

But basically thats teh idea.
I do some programming work (web programming mostly, some C++) but I am not completely familiar with mIRC scripting. Could you give me some ideas of how to implement this script? I will test and try to improve it. Thanks!
Well, to get the last N lines of a window, you can use $lines and $line. Example, gett eh last 10 lines:

Code:
alias last10 {
  var %window = $active, %l = $line(%window, 0), %a = 0
  /window @last10
  /echo @last10 Last 10 lines in %window
  while (%a &lt; 10) {
    /echo @last10 $line(%window, %l)
    /inc %a
    /dec %l
  }
}


Save those last lines in a var or two, and relate what your trying to complete, with what is found. I'd probably add unique words to an array, then use something lik e$var to match prefixes.
© mIRC Discussion Forums