I would still have a question about the script recognizes the clones with ident and ip . changing ident does not recognize the clone as you can change ?
set clonescan(channel) [list #mychannel1 #mychannel2 #mychannel3]; # put the channel name(s) here in lowercase.
set clonescan(relaychan) "#staff"
set clonescan(strip) 0; # set this to 1 to strip ~ from idents
bind join - * onjoin:clonescan
proc onjoin:clonescan {nick uhost hand chan} {
global clonescan
if {[lsearch -exact $clonescan(channel) [string tolower $chan]]} {
if {$clonescan(strip)} {
set uhost [string trimleft $uhost "~"]
}
set list [list]
foreach user [chanlist $chan] {
if {$clonescan(strip)} {
set host [string trimleft [getchanhost $user $chan] "~"];
} else {
set host [getchanhost $user $chan];
}
if {[string equal -nocase $uhost $host]} {
lappend list $user;
}
}
if {[llength $list] > 1} {
putserv "PRIVMSG $clonescan(relaychan) :«« $nick is a clone! - The nicks ( [join $list ", "] ) are the same person! - Mask/Host: $uhost »»"
}
}
}
This script detects clones in channels and writes the report to a default channel . The problem is : detect clones with ident and IP equal.
If the IP is the same but the ident is different it does not detect the clone .
Example ~BLaKFLaG@SimosNap-025E6I.49-151.net24.it -- ~J2OLpZRLf@SimosNap-025E6I.49-151.net24.it is not detected as a clone. I'm sorry for my english.
set clonescan(channel) [list #mychannel1 #mychannel2 #mychannel3]; # put the channel name(s) here in lowercase.
set clonescan(relaychan) "#staff"
set clonescan(strip) 0; # set this to 1 to strip ~ from idents
# set this to 0 to detect clones using username@host
# set this to 1 to detect clones using just the host
set clonescan(justhost) 1
bind join - * onjoin:clonescan
proc onjoin:clonescan {nick uhost hand chan} {
global clonescan
if {[lsearch -exact $clonescan(channel) [string tolower $chan]] > -1} {
if {$clonescan(justhost)} {
set uhost [lindex [split $uhost @] 1]
} elseif {$clonescan(strip)} {
set uhost [string trimleft $uhost "~"]
}
set list [list]
foreach user [chanlist $chan] {
set host [getchanhost $user $chan]
if {$clonescan(justhost)} {
set host [lindex [split $host @] 1]
} elseif {$clonescan(strip)} {
set host [string trimleft $host "~"]
}
if {[string equal -nocase $uhost $host]} {
lappend list $user
}
}
if {[llength $list] > 1} {
putserv "PRIVMSG $clonescan(relaychan) :«« $nick is a clone! - The nicks ( [join $list ", "] ) are the same person! - Mask/Host: $uhost »»"
}
}
}
Last edited by SpiKe^^ on Sun May 03, 2015 11:10 am, edited 1 time in total.
(set clonescan(strip) 0; #set this to 1 to strip ~ from idents - set clonescan(justhost) 1) with these settings correctly identifies
example -->SimosNap-example.ip00.fastwebnet.it-.
I'd like that when it enters the clone also wrote the ident last entered.
-->ident@SimosNap-example.ip00.fastwebnet.it
if {[llength $list] > 1} <- This should display the number of clones ? It seems not working
should add the code? [expr]
(Thanks for your patience)
###################################
## clonescan.tcl v1.1 (3May2015) ##
###################################
######## Begin Settings ########
# set the channel name(s) to monitor for on-join clones.
set clonescan(channel) "#mychannel1 #mychannel2 #mychannel3"
# set the channel name to relay on-join clone info to.
set clonescan(relaychan) "#staff"
# set this to 0 to not strip ~ from idents
# set this to 1 to strip ~ from idents
set clonescan(strip) 0
# set this to 0 to detect clones using username@host
# set this to 1 to detect clones using just the host
set clonescan(justhost) 1
# set the number of other clones to trigger on.
# 1 = the nick joining has 1 or more other clones in the channel.
# note: this will trigger every time someone rejoins
# before their ghost connection times out!
# 2 = the nick joining has 2 or more other clones in the channel.
# note: or set to any number greater than zero.
set clonescan(clones) 1
######### End Settings #########
set clonescan(channel) [split [strlwr $clonescan(channel)]]
if {![string is digit -strict $clonescan(clones)] || $clonescan(clones)<"1"} {
set clonescan(clones) 1
}
bind join - * onjoin:clonescan
proc onjoin:clonescan {nk uh hn ch} {
global clonescan
if {[lsearch -exact $clonescan(channel) [strlwr $ch]] > -1} {
if {$clonescan(strip)} {
set uh [string trimleft $uh "~"]
}
if {$clonescan(justhost)} {
set mask [lindex [split $uh @] 1]
} else { set mask $uh }
set list [list]
foreach user [chanlist $ch] {
set host [getchanhost $user $ch]
if {$clonescan(justhost)} {
set host [lindex [split $host @] 1]
} elseif {$clonescan(strip)} {
set host [string trimleft $host "~"]
}
if {[string equal -nocase $mask $host]} {
lappend list $user
}
}
if {[set num [llength $list]] >= $clonescan(clones)} {
set txt "«« \[$ch\]$nk $uh is a clone! - [number_to_number $num]"
set nks "( [join $list ", "] )"
if {$num == 1} {
set txt "$txt other nick $nks is the same person! »»"
} else { set txt "$txt other nicks $nks are the same person! »»" }
putmsg $clonescan(relaychan) $txt
}
}
}
putlog "«« clonescan.tcl v1.1 loaded. »»"