Eh... another massmode.

By juhapuha on May 08, 2008

This is a SIMPLE massmode, though it works like it should. Maybe someone learns something from this little snippet.. making a massmode script is not that tricky you'd think it is.

How the script works then?

Here's a few examples:

Doing the massmode:

  • shitbreak sets mode: +vvvvvv Teen SilverRainAFK Putki[Tenesean] prem IF|SiLVeROFF gzt_
  • shitbreak sets mode: +vvvvvv Deppis deep`_off- bindi BangBong Ark[Space]Angel [TWR]Robo_Sleep
  • shitbreak sets mode: +vv Servicebots Q

Not opped on channel:

  • Can not use this script: not opped on channel.

The requested massmode is not +/-v or +/-o:

  • This massmode supports only op and voice (o & v).

That's it. Simple error preventing.

alias mass {
  if ($left($1,1) !isin +-) || ($right($1,-1) != o) && ($right($1,-1) != v) { echo 2 -a * This massmode supports only op and voice (o & v). }
  else {
    if ($me !isop $chan) { echo 2 -a * Can not use this script: not opped on channel. }
    else {
      var %i = $nick($chan,0)
      while (%i) {
        if ($nick($chan,%i) != $me) {
          if (!%mode) || ($gettok(%mode,0,32) < $modespl) { var %mode = $addtok(%mode,$nick($chan,%i),32) }
          if ($gettok(%mode,0,32) == $modespl) { mode $chan $+($left($1,1),$str($remove($1,$left($1,1)),$gettok(%mode,0,32))) %mode | unset %mode }
        }     
        dec %i
      }
      if (%mode) { mode $chan $+($left($1,1),$str($remove($1,$left($1,1)),$gettok(%mode,0,32))) %mode }
    }
  }
}

Comments

Sign in to comment.
juhapuha   -  May 10, 2008

There is of course more than one way to make a massmode script.
Tbh that was my first massmode script. :)

 Respond  
napa182   -  May 09, 2008

Pepsi_Man0077 said:

anyway to make it mass voice selected nicks from the nicklist?

um on the one i posted as a comment you can change the

 $nick($chan,0) and ($nick($chan,%o) != $me)

to

$snick($chan,0) and ($snick($chan,%o) != $me)

to make it mass op/voice only selected nicks in the nicklist.

 Respond  
Pepsi_Man0077   -  May 09, 2008

i made it xmass because my IRC already had a mass alias in the scripts, so change it if you wish

 Respond  
Pepsi_Man0077   -  May 09, 2008

i went and researched this and i made this quick alias, if it helps at all:

alias xmass {
var %nick.count $snick($chan,0)
:Nick.Select
if (%nick.count > 0) {
if ($1 = Voice) {
mode $chan v $snick($2,%nick.count)
dec %nick.count
}
elseif ($1 = op) {
mode $chan o $snick($2,%nick.count)
dec %nick.count
}
elseif ($1 = halfop) {
mode $chan h $snick($2,%nick.count)
dec %nick.count
goto Nick.Select
}
elseif ($1 = dehalfop) {
mode $chan -h $snick($2,%nick.count)
dec %nick.count
goto Nick.Select
}
elseif ($1 = kick) {
kick $chan $snick($2,%nick.count)
dec %nick.count
}
goto Nick.Select
}
}

 Respond  
Pepsi_Man0077   -  May 09, 2008

anyway to make it mass voice selected nicks from the nicklist?

 Respond  
napa182   -  May 08, 2008

er nvm i didnt read the last part lmao

 Respond  
napa182   -  May 08, 2008

also if you are making %mode a local var like you did then theres no need to unset it

 Respond  
napa182   -  May 08, 2008

nice but you can also do it like this as well

alias mass {
  if ($me !isop #) || (!$regex($1-,/^[+-][ov]$/)) { echo -a $iif($me !isop #,* Can not use this script: not opped on channel.,* This massmode supports only op and voice (o & v).) }
  else {
    var %a = $nick($chan,0), %o = 1
    while (%o <= %a) {
      if ($nick($chan,%o) != $me) var %m = $addtok(%m,$v1,32)
      inc %o
    }
    mode $chan $left($1,1) $+ $str($right($1,1),$modespl) %m
  }
}
 Respond  
juhapuha   -  May 08, 2008

fixed :)

 Respond  
juhapuha   -  May 08, 2008

Ah, so true ;d

 Respond  
guest598594   -  May 08, 2008
  if ($left($1,1) != +) && ($left($1,1) != -) || ($remove($1,$left($1,1)) != o) && ($remove($1,$left($1,1)) != v) { echo 2 -a * This massmode supports only op and voice (o & v). }

if ($left($1,1) != +) && ($left($1,1) != -) can be if ($left($1,1) !isin +-)

Also, $remove($1,$left($1,1)) can be simplified to $right($1,-1)

 Respond  
juhapuha   -  May 08, 2008

Comments!

 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.