egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Modif. Clones Detector Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
ImPr3zA
Voice


Joined: 10 Apr 2007
Posts: 7

PostPosted: Tue Apr 10, 2007 12:47 pm    Post subject: Modif. Clones Detector Script Reply with quote

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:
bob joins (a@a.com)
bob2 joins (a@a.com)
Egg bans (a@a.com)
Egg kicks bob2


Script:
Code:
# 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
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Apr 10, 2007 7:03 pm    Post subject: Reply with quote

Replace
Code:
lappend cnicks "$i"

with
Code:
set cnicks $i

and replace
Code:
foreach cnick $cnicks {
    putquick "KICK $chan $cnick :$clone_msg"
}

with
Code:
putquick "KICK $chan $cnicks :$clone_msg"

This way, the bot will only kick the last clone.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
ImPr3zA
Voice


Joined: 10 Apr 2007
Posts: 7

PostPosted: Tue Apr 10, 2007 8:51 pm    Post subject: Reply with quote

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

Thx again
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber