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.
CoMMy
Halfop
Posts: 99 Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus
Post
by CoMMy » Mon May 03, 2004 8:58 am
Can anyone help with this ?
It bans every person it joins unless its a member of course.
What i want it to do is see if the person's host matches one of another person in the chan and ban both..
Here is the code.
Code: Select all
bind join - * joiner
proc joiner {nick host handle chan} {
global botnick ban_type
if {[ischanset $chan noclones]} {
if {![matchattr $handle &o $chan] || ![matchattr $handle o]} {
foreach user [chanlist $chan] {
set what "$user![getchanhost $user $chan]"
if {[string match -nocase "*$host*" "$what"]} {
newchanban $chan [hostmasktype $nickshost $ban_type] $botnick "Clones In $chan" "15" sticky
putquick "KICK $chan $user Clones Are Not Allowed" -next }}}
putquick "KICK $chan $nick Clones Are Not Allowed" -next }
Thanks
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Mon May 03, 2004 10:48 am
CoMMy wrote: Code: Select all
bind join - * joiner
proc joiner {nick host handle chan} {
global botnick ban_type
if {[ischanset $chan noclones]} {
if {![matchattr $handle &o $chan] || ![matchattr $handle o]} {
foreach user [chanlist $chan] {
set what "$user![getchanhost $user $chan]"
if {[string match -nocase "*$host*" "$what"]} {
newchanban $chan [hostmasktype $nickshost $ban_type] $botnick "Clones In $chan" "15" sticky
putquick "KICK $chan $user Clones Are Not Allowed" -next
}
}
}
putquick "KICK $chan $nick Clones Are Not Allowed" -next
}
You're missing a } there...and you seem to be kicking anyone joining the +noclones channel...a bit weird
Try something like this:
Code: Select all
bind join - * joiner
proc joiner {n u h c} {
if {![ischanset $c noclones]||[matchattr $h o|o $c]} return
foreach x [chanlist $c] {
if {[string equal -nocase $n $x]} continue
if {[string equal -nocase $u [getchanhost $x $c]]} {
# same user@host... kick $x and $n then return or break
}
}
}
Have you ever read "The Manual"?
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon May 03, 2004 12:03 pm
user wrote:
if {![ischanset $c noclones]||[matchattr $h o|o $c]} return
and you haven't missed some } and { too?
Ps: Use the default "channel get" instead of the "ischanset" proc.
Once the game is over, the king and the pawn go back in the same box.
CoMMy
Halfop
Posts: 99 Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus
Post
by CoMMy » Mon May 03, 2004 2:08 pm
I'll try your advice user and check to see if it works.
Basically my proc kick+banned everyone who joined that chan regarding if the host matched !!!!
Anyway. I'll try it
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Mon May 03, 2004 5:05 pm
caesar wrote: user wrote:
if {![ischanset $c noclones]||[matchattr $h o|o $c]} return
and you haven't missed some } and { too?
Ps: Use the default "channel get" instead of the "ischanset" proc.
There are no missing {}'s.
(strings with no whitespace/special chars don't need escaping/quoting) Calling a proc instead of using the recently added "channel get" makes sense if you want your script to work on older eggdrop models AND i stole that part from his example, so I assume he's got a proc doing the right thing.
Have you ever read "The Manual"?
CoMMy
Halfop
Posts: 99 Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus
Post
by CoMMy » Tue May 04, 2004 5:35 am
Well this is the ischanset proc
Code: Select all
proc ischanset {chan setting} {
set setting "+[string tolower $setting]"
foreach item [string tolower [channel info $chan]] {
if {$item == $setting} { return 1 }}
return 0 }
This uses the old method of getting a channel flag. Can you update the proc to use "channel get" please? I need to change this because i have a lot of procs using ischanset.
Thanks
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue May 04, 2004 10:07 am
@ CoMMy : replace your "ischanset" with "channel get" and voila!
also, next time don't be lazy and consult the tcl-commands.doc file.
@ user : Thanks for sharing that info
Once the game is over, the king and the pawn go back in the same box.