Code: Select all
set clonescan(channel) "#mychannel"
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 [string tolower $clonescan(channel)] [string tolower $chan]] == -1} { return }
set list ""
foreach user [chanlist $chan] {
if {$user != "" && [string equal -nocase [expr {$clonescan(strip) == 1 ? "[string map {~ ""} $uhost]" : "$uhost"}] [expr {$clonescan(strip) == 1 ? "[string map {~ ""} [getchanhost $user $chan]]" : "[getchanhost $user $chan]"}]} {
if {[lsearch -exact [string tolower $list] [string tolower $user]] == -1} {
lappend list "$user"
}
}
}
if {[llength $list] > 0} {
putserv "PRIVMSG $clonescan(relaychan) :«« $nick is a clone! - The nicks ( [join $list " "] ) are the same person! - Mask/Host: [expr {$clonescan(strip) == 1 ? "[string map {~ ""} $uhost]" : "$uhost"}] »»"
}
}
Code: Select all
[19:34:41] <BOTNICK> [11:34] Tcl error in file 'eggdrop.conf':
[19:34:41] <BOTNICK> [11:34] can't read "list": no such variable
[19:34:41] <BOTNICK> while executing
[19:34:41] <BOTNICK> "llength $list"
[19:34:41] <BOTNICK> (file "scripts/clone.tcl" line 1)
[19:34:41] <BOTNICK> (file "gatherbot.txt" line 1)
[19:34:41] <BOTNICK> [11:34] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
-
Code: Select all
[13:46] Tcl error [onjoin:clonescan]: missing close-bracket
Code: Select all
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 »»"
}
}
}
Code: Select all
$clonescan($strip)
Code: Select all
$clonescan(strip)