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.

quit message ban tcl

Old posts that have not been replied to for several years.
Locked
C
CafeiN

Post by CafeiN »

I need a tcl which bans the ip of a user whose quit message contains a specific word.
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

Code: Select all

# Set the words to ban for here.
set ban_words {
	"blah"
	"word word"
}

bind sign - * sign:ban
proc sign:ban {nick uhost hand chan text} {
	global ban_words
	foreach i $ban_words {
		if {[regexp $i $text]} { pushmode $chan +b [maskhost $uhost] }
	}
	flushmode $chan
}
C
CafeiN

Post by CafeiN »

thanks i will test this code.
C
CafeiN

Post by CafeiN »

(DeLiDaNa): [15:10] TCL error [sign:ban]: couldn't compile regular expression pattern: ?+* follows nothing

it gives this error message.

And can I use wildcards with the quit message words?
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

Try:

Code: Select all

# Set the words to ban for here.
set ban_words {
	"*blah*"
	"*word word*"
}

bind sign - * sign:ban
proc sign:ban {nick uhost hand chan text} {
	global ban_words
	foreach i $ban_words {
		if {[string match [string tolower $i] [string tolower $text]]} { pushmode $chan +b [maskhost $uhost] }
	}
	flushmode $chan
}

C
CafeiN

Post by CafeiN »

yeahh. this works. but I want it to ban user with this mask. *!*@host.domain

but it bans the user with *!ident@host.*

what to do with it?
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

Code: Select all

# Set the words to ban for here.
set ban_words {
	"*blah*"
	"*word word*"
}

bind sign - * sign:ban
proc sign:ban {nick uhost hand chan text} {
	global ban_words
	foreach i $ban_words {
		if {[string match [string tolower $i] [string tolower $text]]} { pushmode $chan +b *!*@[lindex [split $uhost @] 1] }
	}
	flushmode $chan
}
<font size=-1>[ This Message was edited by: Wcc on 2002-02-15 23:40 ]</font>
C
CafeiN

Post by CafeiN »

well done Wcc. thanks for the code. Now it works the way I want. I think you should post the tcl to this site's tcl scripts page. I have searched for a tcl like this but I haven't found any.
User avatar
Yourname
Master
Posts: 358
Joined: Mon Sep 24, 2001 8:00 pm
Location: Toronto

Post by Yourname »

LOL, Wcc is such a nice person to everyone.. but he isnt to me :sad:
Dormant egghead.
L
LifeAdeth

Post by LifeAdeth »

I and I would guess many others would enjoy a tcl that has the options to kick or ban with timers and the usual options. ect. ect. make it a full up on part notice tcl. would make many chan owners happy I think.
C
CafeiN

Post by CafeiN »

Is it possible to modify this tcl to set the bans sticky within the given time. And also set the ban in *!*@212.23.34.* format

<font size=-1>[ This Message was edited by: CafeiN on 2002-03-29 15:17 ]</font>
C
CafeiN

Post by CafeiN »

Ok. I have modified this code. Now it bans the user for given minutes and makes the ban sticky if you use dynamic bans.

Code: Select all

# Set the words to ban for here.
set ban_words {
	"inviter"
}

bind sign - * sign:ban
proc sign:ban {nick uhost hand chan text} {
	global ban_words
	foreach i $ban_words {
		if {[string match [string tolower $i] [string tolower $text]]} {newchanban $chan *!*@[lindex [split $uhost @] 1] QuitTCL inviter 1100 sticky}
	}
	flushmode $chan
}
but it still needs some work for me. I want it to ban the user with the *!*@212.23.34.* format. the last class must replaced with a * . I think *!*@[lindex [split $uhost @] 1] must be modified. If anyone knows how please write it here.
Thanks...
Locked