mIRC Home    About    Download    Register    News    Help

Print Thread
Odd nickname completion #17647 31/03/03 11:36 PM
Joined: Jan 2003
Posts: 44
L
lambroger Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2003
Posts: 44
I think you guys will like this.

It only works in channels not query windows and other things that don't have a nicklist.

I got tired of typing funky symbols on pretags so I made this script.

How to use it. let's say someone has a name like {#do_g\$)The_dude. You know how hard it is to use tab nick completion on that. Well with the following script, that problem is no more, you would just type @@dude, and it will autofillin for you.

ie:
/msg @@dude hey dingle, change your nick.<smack enter>
would become
/msg {#do_g\$)The_dude hey dingle, change your nick.

also you can use multiple @@'s in your says and what nots that you execute from the main channel they will all autofillin for you.

note: when using this system you want to make sure you choose an unique enough pattern so as not to get the wrong one.

for instance int he previous example if someone else was named dude241. then that nick would've been chosen for the autofill.

here is the code, and as always I know some of you will critique etc. ps. if its only a complaint about me using brackets and not smashing everything onto 1 line, then don't bother responding.

the code.
Code:
on *:INPUT:*: {
  if ( @@ isin $1- ) {
    var %data = $1-
    var %output = %data
    var %matches = $wildtok(%data,@@*,0,32)
    var %index = 1
    if ( %matches ) {
      while ( %index &lt;= %matches ) {
        var %match = $wildtok(%data,@@*,%index,32)
        var %names = $nick($chan,0)
        var %names_index = 1
        var %shortnick = $right(%match,$calc($length(%match)-2))
        while ( %names_index &lt;= %names ) {
          if ( %shortnick isin $nick($chan,%names_index) ) {
            %output = $reptok(%output,%match,$nick($chan,%names_index),1,32)
            %names_index = $calc(%names + 1)
          }
          else {
            inc %names_index
          }
        }
        inc %index
      }
    }
    process %output
    if ( !$result ) return %output | haltdef
  }
}

alias process {
  if ( $1 == /msg ) {
    msg $2 $3-
    haltdef
  }
  elseif ( $1 == /ctcp ) {
    ctcp $2 $3-
    haltdef
  }
  elseif ( $1 == /dcc ) {
    dcc $2 $3-
    haltdef
  }
  elseif ( $1 == /me ) {
    me $2 $3-
    haltdef
  }
  elseif ( $1 == /describe ) {
    describe $2 $3-
    haltdef
  }
  elseif ( $1 == //echo ) {
    echo $2-
    haltdef
  }
  elseif ( $1 == /notice ) {
    notice $2-
    haltdef
  }
  elseif ( $1 == /invite ) {
    invite $2-
    haltdef
  }
  else {
    must be a say
    msg # $1-
    haltdef
  }
  return 0
}

also found at www.geocities.com/trimaster_98/scripts.html

Re: Odd nickname completion #17648 01/04/03 01:37 PM
Joined: Dec 2002
Posts: 2,985
Watchdog Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
here is the code, and as always I know some of you will critique etc. ps. if its only a complaint about me using brackets and not smashing everything onto 1 line, then don't bother responding.

Well... I have some good news for you, I like the multiline style and detest pipes, so I guess I like how you did it. I must say my nick completer is not quite as elaborate though, but when someone comes in with a really silly looking name I just hand-type the English version to annoy them. grin

Re: Odd nickname completion #17649 02/04/03 01:46 AM
Joined: Jan 2003
Posts: 44
L
lambroger Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2003
Posts: 44
heh, i searched the board, didn't find your nick completer. can you put a copy of it up again?

thx.

Re: Odd nickname completion #17650 02/04/03 02:15 AM
Joined: Jan 2003
Posts: 44
L
lambroger Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2003
Posts: 44
left out an if branch.

replace the process routine with this one:
now you can use it with queries

Code:
alias process {
  if ( $1 == /msg ) {
    msg $2 $3-
    haltdef
  }
  elseif ( $1 == /ctcp ) {
    ctcp $2 $3-
    haltdef
  }
  elseif ( $1 == /dcc ) {
    dcc $2 $3-
    haltdef
  }
  elseif ( $1 == /me ) {
    me $2 $3-
    haltdef
  }
  elseif ( $1 == /describe ) {
    describe $2 $3-
    haltdef
  }
  elseif ( $1 == //echo ) {
    echo $2-
    haltdef
  }
  elseif ( $1 == /notice ) {
    notice $2-
    haltdef
  }
  elseif ( $1 == /invite ) {
    invite $2-
    haltdef
  }
  elseif ( $1 == /query ) {
    query $2-
    haltdef
  }
  else {
    must be a say
    msg # $1-
    haltdef
  }
  return 0
}