gooshie commented on a Page, Nicklist popups  -  Feb 13, 2017

You may want to have a if/else for $modespl
if a server does not report it; although I've
never seen a server not report it.
Of all those $address(0-9), not all are useful.
Also does mass ban with $address(user,2)
I actually have it named MassMode.

alias changeState {
  var %i 1,%g,%n $2-,%s $left($1,1),%m $mid($1,2,1)
  if %m = b {
    %n = ""
    while $gettok($2-,%i,32) {
      %n = %n $address($v1,2)
      inc %i
    }
  }
  while %n {
    %g = $gettok(%n,1- $+ $modespl,32)
    mode # $+(%s,$str(%m,$numtok(%g,32))) %g
    %n = $gettok(%n,$calc($modespl +1) $+ -,32)
  }
}
Degausser  -  Feb 13, 2017

Thanks, I've updated it to work with $modespl - Don't understand why you pasted that function though?

gooshie  -  Feb 15, 2017

It does everything your changeState does and can also mass ban.

Degausser  -  Feb 15, 2017

It would be pretty simple to add an additional parameter to the changeState() function in order to catch the ban number or extract ban masks from nicknames (which is why i don't understand why an example was necessary), but i opted to separate logic handling nicknames and ban masks. 2 is the most common mask, but the point of this little script is convenience, and it's not convenient to leave out options. It's not always necessary to squish everything into one function either.

Also, your function would only remove bans if they match the user based on $address(nick,2) - Whether you wanted ban mask 2 to be your sole method of banning or not, you aren't taking into account bans set by other people. Maybe it slipped your mind trying to cram so much into one function? :P

In terms of improvement, the most significant additions would probably be making sure the ibl is up to date before attempting to remove bans, and the efficiency of matchAddress() in relation to a group of nicknames - neither of which are incredibly urgent, but substantial enough for a small update.

gooshie  -  Feb 15, 2017

If I was banning individuals I'd use a reason and do it solo.
The only reason I would be mass-unbanning is if I made
a mistake while mass-banning lots of zombies.
The almost never times I would need another mask I would
probably just do it manually and if I kept having to do it
then I'd create something for that or extend the script.
Mostly it's an example. I cannot see why anyone would
use ban mask 5-9 or 0,1,3 for that matter. If your making
a plea for options then why did you leave out ban mask 10-19?
d;-P
Now, explain how ANYONE is going to remember
which ban mask #number to use in that popup.
At the very least do something like:
.Ban
..Ban mask *!user@host: banUser 0 + $$1-

It's not just about writing code it's knowing why and how it will be used.

Degausser  -  Feb 15, 2017

Fair enough, i've added a "default" ban, which also covers ban mask 2, and i've removed ban indexes and instead listed ban masks. I still think the inclusion of different masks is important, as it's better to have an option you never use, than lack an option you'd like to use.

gooshie  -  Feb 15, 2017

Well, the only other ban mask needed would be 4. Most of those other options exist for other uses like adding to users list where they can still fall flat since you have to do your own authentication check, since most people have a dynamic IP addy and the best you can do is: Nick!user@*
Something that can easily be spoofed under certain situations.

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.