mIRC Home    About    Download    Register    News    Help

Print Thread
#94747 19/08/04 01:18 PM
Joined: Jan 2004
Posts: 24
W
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Jan 2004
Posts: 24
Hello, i'm trying to create something that does this:
If I ban someone, and then someone else unbans the person I banned, my script will automatically re-ban them.
This is what I got, but it doesn't work;

on @*:UNBAN:#:{
var %i = 1
while (%i <= $ibl($chan,0)) {
if ($banmask iswm $ibl($chan,%i)) && ($gettok($ibl($chan,%i).by,1,33) == $me) { mode $chan b $banmask }
inc %i
}
}

#94748 19/08/04 03:35 PM
Joined: Dec 2002
Posts: 145
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 145
I believe that the info has already been removed when your script kick in.

The following may do the work.

on @*:BAN:#: {
if ( $nick == $me ) set -u3600 $+(%,$chan,_,$2) 1
}

on @*:UNBAN:#: {
if (($nick != $me ) && ([ [ $+(%,$chan,_,$2) ] ] == 1)) mode $chan +b $2
}

$2 == ban address

If the ban is being removed automatically by a bot, I would reduce "u" value by 5 minutes in order to avoid any loop.
Ex.: If bantime is 1 hour set "u" to 3300

Last edited by gemeau50; 19/08/04 03:42 PM.
#94749 19/08/04 04:32 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
on @*:BAN:#: {
 if ($nick == $me) {
  var %i = $numtok($2-,32)
  while (%i) {
   set -u3600 $+(%,$chan,_,$gettok($2-,%i,32)) 1
   dec %i
  }
 }
}
on @*:UNBAN:#: {
 if ($nick == $me) { halt }
 var %i = $numtok($2-,32)
 while (%i) {
  if ($+(%,$chan,_,$gettok($2-,%i,32))) { mode $chan +b $gettok($2-,%i,32) }
  dec %i
 }
}
Just a little modification, so it can work with multiple bans smile

Eg: * Zyzzyx26 sets mode: +bb *!*@John.com *!*@Mary.net


"All we are saying is give peace a chance" -- John Lennon
#94750 19/08/04 10:45 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
In fact it almost already did support multibans, as on ban|unban triggers once for each ban set|unset. The $2 needs to be $banmask for it to work though. smile
  • on me:*:ban:#:inc -u3600 $+(%,myban.,#,$cid,$banmask)
    on @!*:unban:#:if $($+(%,myban.,#,$cid,$banmask),2) { mode # b $banmask }


Using $N it will set the vars N times, and try to re-ban N times also.

#94751 20/08/04 12:58 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
mode # b $banmask

Should be, +b, although +b/b both work on "common" servers software, since they are sent as they are typed its not always guarenteed to work depending on how the server parses. i.e.

->.server.here MODE #chan b mask
-> server.here MODE #chan +b mask

Eamonn.


Link Copied to Clipboard