Mass PM/INVITE Snippet

By Vegito on Dec 01, 2013

Example:
/Mass PM #chan1,#chan2,#chan3 This is a mass message
This will pm your message to everyone within the specified channels as long as you're in them.

Example:
/Mass Invite #chan1,#chan2,#chan3
This will invite everyone within the specified channels as long as you're in them.

Don't abuse it.

alias mass {
  if ($regex($1,/^(pm|invite)$/Si)) {
    var %cmd $1, %totalChans $numtok($2, 44), %i 1
    while (%i <= %totalChans) {   
      var %chan $gettok($2, %i, 44), %totalUsers $nick(%chan, 0), %j 1
      if ($left(%chan, 1) != $chr(35)) echo -a Invalid channel name %chan $+ . 
      elseif ($me !ison %chan) echo -a You have to join $v2 first. 
      while (%j <= %totalUsers) {
        if ($nick(%chan, %j) != $me) $iif(%cmd = pm,msg,$1) $nick(%chan, %j) $iif($v1 = $v2,$3-,#)
        inc %j    
      }
      inc %i
    }
  }
}

Comments

Sign in to comment.
ImArrow   -  May 14, 2015

Not a bad script. way to use Regex. nice work

 Respond  
Arigateaux   -  Dec 01, 2013

Couple things you can add is making a default channel and a channel list for the same message.

/massPM This is a mass message
This would make it send a message to all the people in the channel you're already in

/massPM #chan1,#chan2,#chan3 This is a mass message
This would make it send a message to all the people in these channels, as long as you're in them.

Vegito  -  Dec 04, 2013

Ok I updated the code.

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.