|
Joined: Aug 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 43 |
to kick some one who swears i got
on *:text:badword:#:{ kick # $nick Please Do Not Swear In Here, Or be banned }
how do i get the bot to ban them if they say badword again
thanks
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
on *:text:badword:#:{
inc -u3600 $+(%,$chan,$address)
if ($+(%,$chan,$address)) { ban $chan $nick [color:red]3[/color] }
kick # $nick Please Do Not Swear In Here, Or be banned
} This should do it. It stores a variable with the person's address for 1 hour (3600 seconds). If they swear again within 1 hour, a ban is placed. You can change the ban mask for anyone you want, although I particularly recommed mask #3. You can also add a -uN between "ban" and "$chan" - that will remove the ban after N seconds. Eg: ban -u300 $chan $nick 3 - bans the person for 300 secs (=5 minutes) Zyzzyx
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
if ($+(%,$chan,$address)) { ban $chan $nick 3 }Unfortunately that will always be true, as it results in a string, not the value of the variable. //if ($+(%,$null)) echo -a The condition equates to $+(",$v1,") You need to evaluate the result of the $+() to check if it has a value or not. - if $eval($+(%,$chan,$address),2) { ban $chan $nick 3 }
if $($+(%,$chan,$address),2) { ban $chan $nick 3 }
BTW. Maybe useful to make it multi-connection aware by adding $cid to the variable. on @*:text:badword:#:{
inc -u3600 $+(%,$cid,#,$site)
if $($+(%,$cid,#,$site),2) { ban -ku900 # $nick 3 Please don't swear }
else kick # $nick Please don't swear.
}
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Very true, I forgot to evaluate the variable ty
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 43 |
««Ë®®öR»» Unknown command: ELSE
using mirc 6.03 for this.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
on *:text:badword:#:{
inc -u3600 $+(%,$chan,$address)
if [color:red]($eval[/color]($+(%,$chan,$address)[color:red],2)[/color]) { ban $chan $nick 3 }
kick # $nick Please Do Not Swear In Here, Or be banned
} This should work, now evaluating the variable, as Iori pointed out
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 43 |
kicks the user but does not set a ban the second time. or third
just keeps letting user back in
i had to add an end bracket as well to get the script to kick
Last edited by Crosz; 29/08/04 03:14 AM.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
on @*:text:badword:#: {
inc -u3600 $+(%,$chan,$address)
if ($eval($+(%,$chan,$address),2) > 1) { ban $chan $nick 3 }
kick # $nick Please Do Not Swear In Here, Or be banned
} The code was missing something, which was added now. The above works fine here, so it should work there as well Zyzzyx.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2004
Posts: 43
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2004
Posts: 43 |
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
[10:22:06] * Joins: Zyzzyx26 [10:22:37] <Zyzzyx26> badword [10:22:37] * Zyzzyx26 was kicked by Zyzzyx27 (Please Do Not Swear In Here, Or be banned) [10:22:42] * Joins: Zyzzyx26 [10:23:10] <Zyzzyx26> badword [10:23:10] * Zyzzyx27 sets mode: +b *!*Zyzzyx26@*.users.undernet.org [10:23:11] * Zyzzyx26 was kicked by Zyzzyx27 (Please Do Not Swear In Here, Or be banned)I just used the exact same script that I posted (the corrected one) and I got it to work, as you can see above. Try pasting the script in a new remote file: open Notepad, paste the code and save it as Filename.txt. Now go to mIRC and press Alt + R, this will open the remote editor. Click on File > Load and select the .txt you just created. I can't see anything else that might affect the script... perhaps your variable file is full? Good luck, Zyzzyx
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
|