Jump to content

Archived

This topic is now archived and is closed to further replies.

coders-irc_Bot

Modes massifs :)

Recommended Posts

  • Administrators

cette alias permet d'"effectuer des modes de masse, example /massmode +v voicera tout le monde sur le salon

marche avec les parametres: +v +@ +o +% +h -v -@ -o -% -h +b -b

ps: cette alias n'encourage en aucun cas les takeover, la gestion du mode +b-b est la juste dans un but purement ludique et afin d'aider des administrateur a pouvoir intervenir plus rapidement pour un cas donné.

alias massmode {
  var %t = $ticks , %i 1 , %n = $nick($chan,0) , %k = $modespl , %o 1 , %left = $replace($mid($1,2,1),@,o,+,v,$chr(37),h) , %chan = $iif($2,$ifmatch,$chan)
  if ((!$1) || ($len($1) < 2) || (!%chan)) { return $iif($isid,ERR %chan $calc($ticks - %t) parametre insufisant(s),$null) }
  if ($me !ison %chan) { return $iif($isid,ERR %chan $calc($ticks - %t) you're not on %chan,$null) }
  if (%left == v) { var %mode = isvo }
  elseif (%left == h) { var %mode = ishop }
  elseif (%left == o) { var %mode = isop }
  elseif (%left == a) { var %mode = a }
  if (($right(%mode,2) == op) && ($me !isop %chan)) { return $iif($isid,ERR %chan $calc($ticks - %t) you're not a channel operator on %chan,$null) }
  elseif ((%mode == isvo) && ($me !isop %chan) && ($me !ishop %chan)) { return $iif($isid,ERR %chan $calc($ticks - %t) you're not a channel operator on %chan,$null) }
  if ($left($1,1) == $chr(45)) { var %mode = $chr(33) $+ %mode }
  while (%i <= %n) {
    while (%o <= %k) {
      if ((%left == h) || (%left == o) || (%left == v)) { 
        while ($nick(%chan,%i) %mode %chan) && (%i <= %n) { inc %i }
      }
      if ($nick(%chan,%i) == $me) { inc %i }
      if (%left == b) { var %nicks = %nicks $nick(%chan,%i) $address($nick(%chan,%i),2) }
      else { var %nicks = %nicks $nick(%chan,%i) }
      inc %i
      inc %o
      if (!%nicks) { return OK %chan $calc($ticks - %t) }
      if (%o > %k) { 
        var %o = 1 
        mode %chan $left($1,1) $+ $str(%left,$numtok(%nicks,32)) %nicks
        var %nicks = $null
      }
    }
    inc %i
  }
  if ($isid) { return OK %chan $calc($ticks - %t) }
}

 

Link to comment
Share on other sites



×
×
  • Create New...