Multi server modes

By Lindrian on Jun 19, 2007

Well, I was looking for a script to do one specefic mode in all channels im op in on all my networks. I ended up with this.
Simply paste it into remotes and type /mass $1 $2, eg; /mass +b Lindrian!@

Just wrote the script, its 4 am, and its sunrise. ^_^

This code can be used for blacklists etc, to massivly add bans etc.

Works with modes [+|-] e I b (Excepts, Invites, Bans)

Edit 07/06/20: Shortened the code down by using $v2.

  • '' -: Code updated again. Now you can use multiple modes. Such as:
    /mass +b Hey how are you [/mass $1 $2-]
    Also updated the $scon.

Enjoy!

alias mass {
  var %a = 1
  while ($scon(%a)) {
    scon %a
    ; Simply checks all connections
    if $regex($1,/^[\+-]?[beI]$/) {
      ; This if statement checks if you've input a +/- and if your $1 matches beI. If you didnt input +/-,
      ; It will automaticly chose +.
      var %b = 1, %c = $comchan($me,0), %d = $left($1,1), %e = $right($1,1)
      while (%b <= %c) {
        if ($numtok($2-,32) <= $modespl) {
          ; This check here is to make sure that $2- isnt longer then $modespl, which means it will not try to set more modes
          ; Then possible!
          if ($me isop $comchan($me,%b)) { 
            ; Here the script makes sure you are OP in the current channel being checked.
            mode $v2 $+(%d,$str(%e,$numtok($2-,32))) $2-
            ; This is the part where the modes are being set. $v2 refers to $comchan($me,%b) [Just to shorten the code down] 
          }
        }
        inc %b
      }
    }
    inc %a
  }
}

; Here's the code without explenation.

alias mass {
  var %a = 1
  while ($scon(%a)) {
    scon %a
    if $regex($1,/^[\+-]?[beI]$/) {
      var %b = 1, %c = $comchan($me,0), %d = $left($1,1), %e = $right($1,1)
      while (%b <= %c) {
        if ($numtok($2-,32) <= $modespl) {
          if ($me isop $comchan($me,%b)) { 
            mode $v2 $+(%d,$str(%e,$numtok($2-,32))) $2- 
          }
        }
        inc %b
      }
    }
    inc %a
  }
}

; eof

Comments

Sign in to comment.
luiigi   -  Jul 13, 2007

i would love to Lindrian but i am such a noob it might take forever lol. seriously, still studying the basics of mirc scripting here. haha. :)

 Respond  
Lindrian   -  Jul 13, 2007

Thanks for the great feedback. And you can yourself modify my banlock to work for invites, excepts etc. :)

 Respond  
luiigi   -  Jul 13, 2007

good work, i find this very useful since it has options of more modes to set. i also found your other snippet, the ban lock snippet which i also use. :)

does this also lock the mode set?

maybe it would also nice if you make the same snippet for the invite and exempt (invite and/or exempt lock) as it can very well go with this snippet and would work against those ops who might try to -Ie you or any protected user while you\'re afk.. just a suggestion anyway :)

cool snippet.

 Respond  
Lindrian   -  Jun 20, 2007

Typos is nothing I care about. I just want comments on the code, not usless typos...

 Respond  
Noutrious   -  Jun 20, 2007

Not code, in last comment \"explenation\" is wrong - \"explanation\", then upper \"automaticaly\" should be \"automatically\" and little mistake \"isnt\" should be \"isn\'t\" - thanks to new Firefox dictation option. :)

 Respond  
Lindrian   -  Jun 20, 2007

Anyone wanna comment the new code :P?

 Respond  
Lindrian   -  Jun 20, 2007

Yeah, I can sorhten them down even more:
var %a = 1, %b = $scon(%a)
while %b {

But, doesnt make much difference :P

 Respond  
kerstt   -  Jun 20, 2007

while (%a <= $scon(0))
u can shorten down whiles like that;
while $scon(%a)

 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.