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.

What does this code do?

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pektek
Halfop
Posts: 51
Joined: Sat Jul 01, 2023 4:51 pm

What does this code do?

Post by pektek »

what can be done with it ?

Code: Select all

bind mode - "#% +b" runban
bind mode - "#% -b" stopban

proc runban {nick uhost handle chan mode target} {
	if {[string match -nocase m:*!*@* $target]} {
		set ::btimer($chan) [list [timer 20 [list rmban $chan]]]
	}
}

proc stopban {nick uhost handle chan mode target} {
	if {[string match -nocase m:*!*@* $target]} {
		rmban $chan
	}
}

proc rmban {chan} {
	if { [array exists ::btimer] && [info exists ::btimer($chan)] } {
		if { [lsearch -index 2 [timers] $::btimer($chan)] != -1} {
			killtimer $::btimer($chan)
		}
		unset ::btimer($chan)
	}
	if { [ischanban m:*!*@* $chan] } {
		pushmode $chan -b m:*!*@*
	}
}
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: What does this code do?

Post by CrazyCat »

This code is to auto-remove an extended ban which is not clearly understood by eggdrop to auto-remove it after 20 minutes.
Depending on the ircd used, the ~m ban is not the same :)
Post Reply