Alias (Return +modes excluding $2)

By SyntaxIRC on Jun 15, 2007

Place in remotes, it returns +channelmodes, excluding $2.

Example:
$remode(#mirc,nTr)
+tl 5

^ Would return something like that
It would be useful when you use a script to add modes, then you can use this script to find and unset them when needed. You could use something like $replace($remode(#mirc,nTr),+,-)

Enjoy. I would like comments, and partial credit goes to Kerst of SwiftIRC for pointing out an error.

alias remode {  
  if (!$1) || ($chr(35) !isin $1) || (!$2) || ($me !ison $1) {
    return
  }
  var %i = $len($2)
  var %x = 1
  var %d = $chan($1).mode
  while (%x <= %i) { 
    var %d = $removecs(%d,$mid($2,%x,1))
    inc %x 
  }
  return %d 
}

Comments

Sign in to comment.
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.