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.

ignore banned users

Old posts that have not been replied to for several years.
r
reallove
Voice
Posts: 14
Joined: Fri Aug 13, 2004 4:57 pm

ignore banned users

Post by reallove »

Hello,
I asked for this script several weeks ago,but now it is a very stringent matter...
Is it possible that whenever someone will message my eggdrop, this will automatically verify the banlist in the channel #channel, and if the inquirer has a match in the banlist to be automatically ignored ?

Cheers, reallove
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

That is fairly easy todo:

You can use this on "bind msgm"

Code: Select all

foreach chanban [chanbans $chan] {
 if {([string match -nocase *$chanban* $uhost])} { #do stuff
And if a ban matches that user's host
You can use "newignore" to ignore that persons host.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

awyeah wrote:[string match -nocase *$chanban* $uhost]
This has been discussed before. 'string match' doesn't match the way most ircds do and the mask is matched against nick!user@host, so a ban on a nick would never match the way you do it (even if you're lucky and there's no brackets/backslashes screwing up the actual matching.)

oh..and btw: 'msgm' is not triggered if the message is matched by a 'msg' bind iirc.
Have you ever read "The Manual"?
r
reallove
Voice
Posts: 14
Joined: Fri Aug 13, 2004 4:57 pm

Post by reallove »

well,I need this on an Undernet channel.And the banlist is 99% with adresses like this: *!*@numeric.IP or *!*@hostname . Well,is it possible to create a script like this ? And no,I don't know anything about tcl scripting,so if someone can help me,write the whole code :)

Thanks.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

so u wana ignore all the users on ur ban list right

they allready sad how

Code: Select all

foreach x [banlist $chan] {
  newigore ...
}
u could match it but as i recal ignores are global .. and not channel based ..
newignore <hostmask> <creator> <comment> [lifetime]
so no point realy..

and using banlist [channel] will only return bans for that channel so an other reason no point matching it either ..
Last edited by Ofloo on Wed Oct 27, 2004 3:05 pm, edited 1 time in total.
XplaiN but think of me as stupid
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Why not mirror the banlist from the channel in question instead of checking the entire banlist every time your bot recieves a message?
This script should add/remove ignores based on the banlist in #channel (change the variable if your channel's called something else)

Code: Select all

set b2i_chan "#channel"

bind raw - 368 b2i:368
bind mode - "$b2i_chan ?b" b2i:mode
proc b2i:368 {f k a} {
	scan $a %*s%s c
	if {![string eq -noc $c $::b2i_chan]} return
	# add new ignores if there's new bans
	foreach {m . .} [join [chanbans $c]] {
		if {![isignore $m]} {newignore $m b2i b2i}
	}
	# remove ignores placed by this script that are not in the banlist
	foreach {m r . . h} [join [ignorelist]] {
		if {$r=="b2i"&&$h=="b2i"&&![ischanban $m $c]} {killignore $m}
	}
}
proc b2i:mode {n u h c m b} {
	if {$m=="+b"} {# add ignore
		if {![isignore $b]} {newignore $b b2i b2i}
	} else {# remove if ignored by this script
		if {[isignore $b]} {
			foreach {m r . . h} [join [ignorelist]] {
				if {$b==$m&&$r=="b2i"&&$h=="b2i"} {killignore $b; break}
			}
		}
	}
}
When loading the script for the first time you can force the bot to update the ignore list by doing ".dump MODE #channel +b" on your partyline.
(edit: changed a variable name (twice :P))
Last edited by user on Wed Oct 27, 2004 5:25 pm, edited 2 times in total.
Have you ever read "The Manual"?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

user wrote:foreach {m r . . h} [join [ignorelist]] {
what do the dots stand for ?
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

ok i didn't know u could set a variable into a dot
brain:~# tclsh
% set . 1
1
% puts ${.}
1
%
XplaiN but think of me as stupid
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Ofloo wrote:
user wrote:foreach {m r . . h} [join [ignorelist]] {
what do the dots stand for ?
they're just variable names like the rest of that list, but i don't use them, so i gave them a strange name like that :P
Have you ever read "The Manual"?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hehe ic..
XplaiN but think of me as stupid
r
reallove
Voice
Posts: 14
Joined: Fri Aug 13, 2004 4:57 pm

Post by reallove »

ok,thanks,seems it's working.
But what's this,on the .ignore list?

Code: Select all

Currently ignoring:
  [  1] +b (expires at 22:25)
        b2i: b2i
        Started 22:10
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

reallove wrote:ok,thanks,seems it's working.
But what's this,on the .ignore list?

Code: Select all

Currently ignoring:
  [  1] +b (expires at 22:25)
        b2i: b2i
        Started 22:10
it was due to a bug which is fixed (i edited the post)
load the new script and do .dump MODE #channel +b again :)
You might also want to make the ignores permanent. (To avoid having ignores removed before the bans are gone) If you want this, change "{newignore $m b2i b2i}" to "{newignore $m b2i b2i 0}" and "{newignore $b b2i b2i}" to "{newignore $b b2i b2i 0}"

(I thought making them non-permanent by default would be a good idea as you might not like the script and if it created alot of ignores, having them expire some time would save you some work removing ignores by hand)
Have you ever read "The Manual"?
r
reallove
Voice
Posts: 14
Joined: Fri Aug 13, 2004 4:57 pm

Post by reallove »

mmm .. now it's a great job :) thank you !
I have only one last question : what does " .dump MODE #channel +b " make ? I .help dump,visited the URL,but didn't understand a lot.Should I type this command everytime the bot rehashes? Or if I restart it ?
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

'.dump' sends stuff directly to the server. Doing "MODE #somechan +b" is the way to fetch the banlist of a channel. You should never need to do that again as the bot will take care of it when joining your channel.
Have you ever read "The Manual"?
r
reallove
Voice
Posts: 14
Joined: Fri Aug 13, 2004 4:57 pm

Post by reallove »

thanks for the script and for the explanations :)
Locked