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.

nick mode script

Old posts that have not been replied to for several years.
Locked
User avatar
[R]
Halfop
Posts: 98
Joined: Fri Apr 30, 2004 12:05 pm

nick mode script

Post by [R] »

Hello,

I need a script that sets mode +N when users change their nicks too fast and too often.
This mode should only set for 5 minutes...
Is that possible? This script stops "psyBNC-nick-change-bug"
Have u got an idea? :)

Big thx [R]
User avatar
Jil Larner
Voice
Posts: 14
Joined: Fri Aug 20, 2004 8:28 am
Location: France

Post by Jil Larner »

Hi,

If the IRCd is Unreal, there is the channel mode +f which can set +N mode to stop flood nick. But be careful, if i remember Anope Services pass through and your limit must be good, because in an active channel, nicks can change fast without really flood.
User avatar
[R]
Halfop
Posts: 98
Joined: Fri Apr 30, 2004 12:05 pm

Post by [R] »

thx thx have u got a script or an idea?
User avatar
Jil Larner
Voice
Posts: 14
Joined: Fri Aug 20, 2004 8:28 am
Location: France

Post by Jil Larner »

/mode #chan +f [10n#N5]:15
10 nick change in 15 seconds leads server to put +N for 5 minutes. Is-it good ?
User avatar
[R]
Halfop
Posts: 98
Joined: Fri Apr 30, 2004 12:05 pm

Post by [R] »

dont work in euirc.. i think
User avatar
Jil Larner
Voice
Posts: 14
Joined: Fri Aug 20, 2004 8:28 am
Location: France

Post by Jil Larner »

Ok, i have a tcl script for eggdrop which permit me to ban users who flood nick. But it is individual. n nick change by uhost.

Code: Select all

bind nick - * scanner:nick
# Set limit
set flood_nc_limit 9
 proc scanner:nick {nick uhost handle channel newnick} {
	global flood_nc_limit NickChangeCount NickChangeTime
	
	if {[info exists NickChangeTime($uhost)]} {
		# If last nick change later than 3 minuts, forgetting...
		if {[expr $NickChangeTime($uhost)+180] < [clock seconds]} {
			set NickChangeCount($uhost) 0 
		}
	}
	
	set NickChangeTime($uhost) [clock seconds]
	if {![info exists NickChangeCount($uhost)]} {
		set NickChangeCount($uhost) 1
	} else {
		# 1 nick change more
		incr NickChangeCount($uhost)
	}
	if {$NickChangeCount($uhost) >= $flood_nc_limit} {
		# Limit reached. Putting +N
		putserv "MODE $channel +N"
		timer 5 "putserv \"MODE $channel -N\""
	}
}
I prefer utimers because i find them more precise. But this sould work

If you prefer a general way, that should be :

Code: Select all

# Set limit
set flood_nc_limit 9
bind nick - * scanner:nick
 proc scanner:nick {nick uhost handle channel newnick} {
	global flood_nc_limit NickChangeCount NickChangeTime
	
	if {[info exists NickChangeTime]} {
		# If last nick change later than 3 minuts, reset count...
		if {[expr $NickChangeTime+180] < [clock seconds]} {
			set NickChangeCount 0 
		}
	}
	
	set NickChangeTime [clock seconds]
	if {![info exists NickChangeCount]} {
		set NickChangeCount 1
	} else {
		# 1 nick change more
		incr NickChangeCount
	}
	if {$NickChangeCount >= $flood_nc_limit} {
		# Limit reached. Putting +N
		putserv "MODE $channel +N"
		timer 5 "putserv \"MODE $channel -N\""
	}
}
But i didn't test this one.

[Edit: i added set limit]
User avatar
[R]
Halfop
Posts: 98
Joined: Fri Apr 30, 2004 12:05 pm

Post by [R] »

thx gerat work :D
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

<snip>
XplaiN but think of me as stupid
Locked