autocomplete channel names

By g2x3k on Aug 04, 2011

autocompletes channel(s): # into #active channel /sajoin nick # ... and it joins nick to channel you write it in, or usefull for regging multiple channels

on *:INPUT:#:{
  set %tmsg $1-
  if ($left($1,2) == //) {
   ; input starts with // do nothing ..
  }
  else if ($left($1,1) != /) {
    if ($gettok($1-,-1,32) == $chr(35)) {
      set %offs $calc($numtok($1-,32)-1)      
      set %tmsg $gettok(%tmsg, 1- $+ %offs,32) $chan
    }
    msg $chan $replace(%tmsg,$chr(35) $+ $chr(32),$chan $+ $chr(32))
    halt
  }
  else {
    if ($gettok($1-,-1,32) == $chr(35)) {
      set %offs $calc($numtok($1-,32)-1)      
      set %tmsg $gettok(%tmsg, 1- $+ %offs,32) $chan
    }
    $replace(%tmsg,$chr(35) $+ $chr(32),$chan $+ $chr(32))  
    halt
  }
}

Comments

Sign in to comment.
Dani_l11   -  Aug 16, 2011

You know mIRC already does that, right? //echo #

More
 Respond  
g2x3k   -  Aug 06, 2011

well true it could prob be optimized a bit was just way i had it in my head to parse if starts with //, / or its a msg

More
 Respond  
Jethro   -  Aug 04, 2011

I don't find this snippet useful and convenient. I'm not sure why you have to repeat the same exact routine from the elseif to else. Nevertheless, keep at it.

More
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.