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.

Modif. Clones Detector Script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
I
ImPr3zA
Voice
Posts: 7
Joined: Tue Apr 10, 2007 12:41 pm

Modif. Clones Detector Script

Post by ImPr3zA »

I want to modify my Clones Detector Script.
This script kicks the TWO clones and ban clone's host.
How set the script to kick only one clone. (One get Kicked and the other one stay on the channel)

Ex:

Code: Select all

bob joins (a@a.com)
bob2 joins (a@a.com)
Egg bans (a@a.com)
Egg kicks bob2 
Script:

Code: Select all

# Set the next line as the kick msg you want to say
set clone_msg "Clones"
# Set the next line as the number of clones to scan for
set clone_max 2
# Set the next line as the channels you want to run in
set clone_chans "#MyChan"

proc join_clone {nick uhost hand chan} {
 global clone_msg clone_max clone_chans botnick
 if {(([lsearch -exact [string tolower $clone_chans] [string tolower $chan]] != -1) || ($clone_chans == "*")) && (![matchattr $hand m|m $chan]) && (![matchattr $hand b]) && ($nick != $botnick)} {
  set host [lindex [split $uhost @] 1]
  set count 0
  foreach i [chanlist $chan] {
   if {[string equal -nocase [lindex [split [getchanhost $i $chan] @] 1] $host]} {
    incr count
    lappend cnicks "$i"
   }
  }
  if {$count >= $clone_max} {
   putquick "MODE $chan +b *!*@$host"
   foreach cnick $cnicks {
    putquick "KICK $chan $cnick :$clone_msg"
   }
  }
 }
}

bind join - * join_clone
Thx
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Replace

Code: Select all

lappend cnicks "$i"
with

Code: Select all

set cnicks $i
and replace

Code: Select all

foreach cnick $cnicks {
    putquick "KICK $chan $cnick :$clone_msg"
}
with

Code: Select all

putquick "KICK $chan $cnicks :$clone_msg"
This way, the bot will only kick the last clone.
I
ImPr3zA
Voice
Posts: 7
Joined: Tue Apr 10, 2007 12:41 pm

Post by ImPr3zA »

Can I use a ban timer ?
and don't use this script on voice, op, half-op, co-own, own ??? v % @ & ~

Thx again
Post Reply