This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

anti action /ame

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
f
fredvil
Voice
Posts: 21
Joined: Thu Dec 01, 2005 9:16 pm

anti action /ame

Post by fredvil »

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
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: anti action /ame

Post by user »

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 :P 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: Select all

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
Last edited by user on Sat Jan 06, 2007 5:31 pm, edited 5 times in total.
Have you ever read "The Manual"?
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

This will ban any user for using actions.
Included an option to exclude chanops from banning.

Code: Select all

# 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 ]
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

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: Select all

# 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" }  
  }
}
f
fredvil
Voice
Posts: 21
Joined: Thu Dec 01, 2005 9:16 pm

Post by fredvil »

hi user... got this error.. pls help thanks

Code: Select all

[11:00] Tcl error [ameban]: can't read "c": no such variable
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

try the edited version
Have you ever read "The Manual"?
f
fredvil
Voice
Posts: 21
Joined: Thu Dec 01, 2005 9:16 pm

Post by fredvil »

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
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

fredvil wrote:how to change the ban type to *!*@10.0.0.2 or *!*@host.domain.com

Code: Select all

newban *!*@[lindex [split $u @] 1] ${::botnet-nick} "ameban" 60
Have you ever read "The Manual"?
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hi, anyone can help me this script work only on one channel not global... thanks in advance :D
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Sydneybabe wrote:Hi, anyone can help me this script work only on one channel not global... thanks in advance :D
It bans if a user does multiple actions within the same channel or different channels.
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Dragonlord message:
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.
h
holycrap
Op
Posts: 152
Joined: Mon Jan 21, 2008 11:19 pm

Post by holycrap »

@ 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!

:D
Post Reply