|
Winter_Demon
|
Winter_Demon
|
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 } }
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
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.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
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 Eg: * Zyzzyx26 sets mode: +bb *!*@John.com *!*@Mary.net
|
|
|
|
Iori
|
Iori
|
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.  - 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.
|
|
|
|
Joined: Dec 2002
Posts: 787
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 787 |
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.
|
|
|
|
|