mIRC Homepage
Posted By: rippen Autocompleting Nicknames on @Windows - 30/08/05 06:52 PM
heya.
i'm on the channels all the time through @Windows.. and obviously these @Windows don't have any nicklist BUT they have the standard editbox to type.
but.. while on the @Windows i cannot complete nicknames with the TAB key which was really useful..

is there any way to complete nicknames on @Windows with TAB?

thanks.
Posted By: SladeKraven Re: Autocompleting Nicknames on @Windows - 30/08/05 07:53 PM
You can put nicklist in @Windows with the -l switch.

/window -el12 @Window

If your windows are like: @#Channel

Then you could use the On Keydown event anticipate the TAB key value and use an alias like:

Code:
alias tab {
  var %tab.chan = #$$1, %x = 1
  while (%x <= $nick(%tab.chan,0)) {
    if ($left($nick(%tab.chan,%x),1) == %tab.chan) {
      %token = $addtok(%token,$fline(%tab.chan,$nick(%tab.chan,%x),1,1),32)
    }
    inc %x
  }
  if ($numtok(%token,32) == 1) { 
    editbox $+($nick(%tab.chan,$gettok(%token,1,32)),:) 
  }
  elseif ($numtok(%token,32) > 1) { 
    inc %names $calc($gettok(%token,1,32) - 1)
    if ($istok(%token,%names,32)) {
      editbox $+($nick(%tab.chan,%names),:)
    }
    if (%names == $gettok(%token,$numtok(%token,32),32)) unset %names
  }
}


I'm pretty tired so it can be improved a hell of a lot but I didnt have much sleep last night so it is fairly hard to concentrate.. smile

You can test it in a channel.

/tab #Channel B

Obviously, if you use it in a window and keep pressing TAB to refresh the tab alias you wouldnt need to keep hitting the up arrow to get the next nickname.

-Andy
Posted By: DaveC Re: Autocompleting Nicknames on @Windows - 31/08/05 01:05 AM
You wheel reinventor you! smile

Quote:
You can put nicklist in @Windows with the -l switch.
/window -el12 @Window
If your windows are like: @#Channel
Then you could use the On Keydown event anticipate the TAB key value and use an alias like:
etc etc etc


An even better idea is to NOT intercept the TAB key at all and just let mirc do the job itself, since TAB completeion works of the contents of the listbox of what ever window your in, custom or channel. :-)
Posted By: SladeKraven Re: Autocompleting Nicknames on @Windows - 31/08/05 01:13 AM
How do you mean wheel reinventor dude? shocked

-Andy
Posted By: DaveC Re: Autocompleting Nicknames on @Windows - 31/08/05 01:37 AM
lol it was just a joke. you were gonna build a tab completor when its got one built in, you were reinventing the wheel.
Posted By: SladeKraven Re: Autocompleting Nicknames on @Windows - 31/08/05 01:49 AM
I guess I didn't even get that to work, kinda does for the most but bleh.. grin

-Andy
© mIRC Discussion Forums