auto unban script

By killerpit4e on Jan 27, 2011

auto unbans

on 1:Ban:#: { if ($banmask iswm $address($me,5)) { .cs unban $chan } }

on *:BAN:#: { 
  if ($me isop $chan) {
    if ($banmask iswm $address($me,5)) { 
      inc %kcount
      mode # -b $banmask 
      kick $chan $nick Nice try Jack@$$ - Noobs Pwnt: ( %kcount )
      ban $chan $nick 3 
    } 
  }
}

Comments

Sign in to comment.
Phil_FW   -  Jan 28, 2011

it did Jethro_ and you seem like some extremely smart computer genius or something lol. I appreciate your efforts to motivate me. I just need to find time to do it all. I get distracted between fixing other scripts, chatting, texting, or playing Black Ops. lol

 Respond  
Jethro   -  Jan 28, 2011

:P napa. We all need to be self-motivated or else we can't go on with our lives. Evidently phil24 needs some encouragement, and I hope my post has served as an incentive to propel him into the world of regex.

 Respond  
napa182   -  Jan 28, 2011

lol @ Jethro_ the self motivational speaker.. =P

 Respond  
Jethro   -  Jan 28, 2011

If people can learn regex, so can you. Believe in yourself, phil24. Some folks take more time to understand a programming language, and some of them get the drift rather quickly. At any rate, it's the effort and determination that'll get you to success.

 Respond  
Phil_FW   -  Jan 28, 2011

it seems complicated, i supose after I learn it, it will not seem so. right?

 Respond  
Jethro   -  Jan 27, 2011

I didn't mean trying to show off or anything; I was just trying to find an inventive way to go about the generic method of a snippet. This is a part of my learning experience.

phil24, if you despise regex, you'll never learn of its benefits for many coding situations. Regex is universal and recognized by many programming languages. So try to get acquainted with it and you might like it gradually.

 Respond  
Phil_FW   -  Jan 27, 2011

i think the original script up there is fine :P and easily understandable to new scripters

 Respond  
Phil_FW   -  Jan 27, 2011

regex.. i despise it LOL

 Respond  
Jethro   -  Jan 27, 2011

Just a little experiment with the $mode(). This should work correctly to reverse the ban set upon the client running the code. Feel free to give me some pointers, jaytea:

on !@*:rawmode:#:{
  if ($mode(1).ban == $+($me,!*@*)) {
    mode # -b $v1
  }
  else {
    var %x = 1
    while ($mode(%x).ban) {
      var %v1 = $v1
      if ($istok($+($address($me,0),$chr(32),$&
        $regsubex($str(.,9),/./g,$&
        $+($chr(32),$address($me,\n)))),%v1,32)) {
        mode # -b %v1
      }
      inc %x
    }
  }
}
 Respond  
Jethro   -  Jan 27, 2011

Yeah well, you got me this time, jaytea. It wasn't such a good suggestion after all. :$

 Respond  
jaytea   -  Jan 27, 2011

er Jethro, $mode().ban generally returns a ban mask (not a nick) and cannot be equal to $me. also, why restrict the check to only $mode(1).ban while it's easily possible for $mode(2).ban, $mode(3).ban etc. to affect you? and solely checking for nick bans while letting other types of bans slip through? i don't understand the suggestion at all i'm afraid :P

ignoring the rest of the code, the method killerpit4e uses to detect self-affecting bans is simple, functional and absolutely fine. the only advantage to using rawmode and looping through $mode() is the ability to handle multiple self-affecting bans in one fell swoop.

 Respond  
Jethro   -  Jan 27, 2011

Deleted due to bad suggestion.

 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.