| View previous topic :: View next topic |
| Author |
Message |
fredvil Voice
Joined: 01 Dec 2005 Posts: 21
|
Posted: Fri Jan 05, 2007 9:42 am Post subject: anti action /ame |
|
|
does anyone here know a script that will ban user that uses action /ame.
example if bot and nick are on 2 channels and when the nick uses /ame the bot will ban him/her.
thanks a lot |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri Jan 05, 2007 10:30 am Post subject: Re: anti action /ame |
|
|
| fredvil wrote: | does anyone here know a script that will ban user that uses action /ame.
example if bot and nick are on 2 channels and when the nick uses /ame the bot will ban him/her.
thanks a lot |
/ame is not a irc command, but a client "feature" sending multiple ctcp ACTIONs, so there's no way to detect the difference between /ame and multiple /me's The best you can do is guess...here's a script that will ban any user doing the same action two times in a row within 5 seconds.
| Code: | bind ctcp - ACTION ameban
proc ameban {n u h t a b} {
if {[validchan $t]&&![matchattr $h nmof|mnof $t]} {
global ameban
set id $n!$u
if {[info exists ameban($id)]} {
if {$ameban($id)==$b} {
newban [lindex [split $u @] 1] ${::botnet-nick} "ameban" 60
return
} {
killtimer $ameban($id,timer)
}
}
set ameban($id) $b
set ameban($id,timer) [utimer 5 "unset [list ameban($id)]; unset [list ameban($id,timer)]"]
}
} |
(not tested)
EDIT2: variable name _________________ Have you ever read "The Manual"?
Last edited by user on Sat Jan 06, 2007 5:31 pm; edited 5 times in total |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Fri Jan 05, 2007 11:19 am Post subject: |
|
|
This will ban any user for using actions.
Included an option to exclude chanops from banning.
| Code: | # actban variable is setting ban time
# use 0 to make perm
set actban 10
bind ctcp - ACTION ban:act
proc ban:act { nick uhost hand dest key text } {
#uncomment next line to exclude chanops
#if [!isop $nick] return
newban *!$uhost $::botnick action_ban $::actban
}
|
[ edited to correct global ] |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Fri Jan 05, 2007 1:08 pm Post subject: |
|
|
the following will give the user a global ban, and kick the person from all channels the bot is on with that nick
(tested)
| Code: |
# actban variable is setting ban time in minutes
# use 0 to make perm
set actban 10
bind ctcp - ACTION ban:act
proc ban:act { nick uhost hand dest key text } {
#uncomment next line to exclude chanops
#if [!isop $nick] return
newban *!$uhost $::botnick action_ban $::actban
foreach chan [channels] {
if [onchan $nick $chan] { putquick "KICK $chan $nick" }
}
}
|
|
|
| Back to top |
|
 |
fredvil Voice
Joined: 01 Dec 2005 Posts: 21
|
Posted: Fri Jan 05, 2007 11:00 pm Post subject: |
|
|
hi user... got this error.. pls help thanks
| Code: | | [11:00] Tcl error [ameban]: can't read "c": no such variable |
|
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri Jan 05, 2007 11:43 pm Post subject: |
|
|
try the edited version _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
fredvil Voice
Joined: 01 Dec 2005 Posts: 21
|
Posted: Sat Jan 06, 2007 2:44 am Post subject: |
|
|
you got it user... u the man.. thanks a lot...
one more thing user... how to change the ban type to *!*@10.0.0.2 or *!*@host.domain.com |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Sat Jan 06, 2007 9:09 am Post subject: |
|
|
| fredvil wrote: | | how to change the ban type to *!*@10.0.0.2 or *!*@host.domain.com |
| Code: | | newban *!*@[lindex [split $u @] 1] ${::botnet-nick} "ameban" 60 |
_________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
Sydneybabe Op
Joined: 27 Apr 2007 Posts: 106 Location: Philippines
|
Posted: Sat Jun 28, 2008 12:54 am Post subject: |
|
|
Hi, anyone can help me this script work only on one channel not global... thanks in advance  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Jun 28, 2008 8:50 am Post subject: |
|
|
| Sydneybabe wrote: | Hi, anyone can help me this script work only on one channel not global... thanks in advance  |
It bans if a user does multiple actions within the same channel or different channels. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Sydneybabe Op
Joined: 27 Apr 2007 Posts: 106 Location: Philippines
|
Posted: Sun Jun 29, 2008 1:06 am Post subject: |
|
|
Dragonlord message: | Quote: | | the following will give the user a global ban, and kick the person from all channels the bot is on with that nick |
i mean only work with one channel not all channels where the bot is on. |
|
| Back to top |
|
 |
holycrap Op
Joined: 21 Jan 2008 Posts: 152
|
Posted: Fri Dec 19, 2008 2:53 pm Post subject: |
|
|
@ DragnLord
So, how would you do this? Notice the user with first offense "don't use /ame" and ban them the second time with a message "you have been warned."
Thanks!
 |
|
| Back to top |
|
 |
|