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.
Old posts that have not been replied to for several years.
-
mm
- Halfop
- Posts: 78
- Joined: Thu Jul 01, 2004 10:24 pm
Post
by mm »
could you please?
thanks
MM
-
De Kus
- Revered One
- Posts: 1361
- Joined: Sun Dec 15, 2002 11:41 am
- Location: Germany
Post
by De Kus »
without any warranty
Code: Select all
bind filt - ".+ban *" banfilter
proc banfilter {idx text} {
set text [split $text]
set chan [lindex $text [set ci [lsearch -glob [lrange $text 0 4] #*]]]
set reason [lreplace $text $ci $ci]
set dur [lindex $reason [set di [lsearch -glob [lrange $reason 0 3] \%*]]]
set reason [lreplace $reason $di $di]
if { [set reason [lrange $reason 2 end]] == "" } {
set reason "requested"
}
set reason "kicked by [idx2hand $idx] ([ctime [unixtime]]: $reason)"
return [join [list .+ban $chan $dur $reason]]
}
I am sure I hid some typos or stupid logical errors, but maybe you find them yourself

.
One note:
I assumed lreplace behaves like that:
tcl: evaluate (.tcl): lreplace {1 2} -1 -1
Tcl: 1 2
Last edited by
De Kus on Wed May 04, 2005 3:39 am, edited 1 time in total.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under
The MIT License
Love hurts, love strengthens...
-
mm
- Halfop
- Posts: 78
- Joined: Thu Jul 01, 2004 10:24 pm
Post
by mm »
Thanks De Kus.
[04:10] Tcl error [banfilter]: invalid command name "replace"
thanks
MM