| View previous topic :: View next topic |
| Author |
Message |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Tue Jan 06, 2009 3:49 pm Post subject: Clones |
|
|
Hi ppl.
Can someone write script that will scan chann for clones?
It should react on "!clone".When someone write that on channel,bot should scan clones and say results in that channel..
Regards,
Darko. |
|
| Back to top |
|
 |
Nimos Halfop
Joined: 20 Apr 2008 Posts: 80
|
Posted: Wed Jan 07, 2009 7:24 am Post subject: |
|
|
| how do you define a "clone"? |
|
| Back to top |
|
 |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Wed Jan 07, 2009 7:45 am Post subject: |
|
|
| users with same Ip adresses.. |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Wed Jan 07, 2009 9:13 am Post subject: |
|
|
This was made ages ago, not sure if it still works:
| Code: | namespace eval clonescan {
variable copyright "[lindex [split [info script] /] end] - v1.0.0.0 - r0t3n"
variable clones
array set clones {}
variable trigger "!"
bind pub m|o "${trigger}clone" [namespace current]::commands
}
proc clonescan::commands {nickname hostname handle channel text} {
putquick "PRIVMSG $channel :Starting clonescan for $channel..."
set start [clock clicks]
foreach user [chanlist $channel] {
if {[clonescan::checknick $user]} { continue }
foreach user1 [chanlist $channel] {
if {[clonescan::checknick $user1]} { continue }
set host [lindex [split [getchanhost $user $channel] @] 1]
set host1 [lindex [split [getchanhost $user1 $channel] @] 1]
if {![string equal -nocase $user1 $user]} {
if {[string equal -nocase $host $host1]} {
if {[info exists clonescan::clones($channel:$host)]} {
set list $clonescan::clones($channel:$host)
set add ""
if {[lsearch -exact "$list" $user] == "-1"} {
if {$add == ""} {
set add "$user"
} else {
set add "$add $user"
}
}
if {([lsearch -exact "$list" $user1] == "-1") && ([lsearch -exact "$add" $user1] == "-1")} {
if {$add == ""} {
set add "$user1"
} else {
set add "$add $user1"
}
}
if {$add != ""} {
set clonescan::clones($channel:$host) "$list $add"
}
} else {
set clonescan::clones($channel:$host) "$user $user1"
}
}
}
}
}
set end [clock clicks]
set count "0"
foreach clone [array names clonescan::clones $channel:*] {
if {$clone == ""} { return }
set host [lindex [split $clone :] 1]
set nicklist [join "[lsort -unique $clonescan::clones($channel:$host)]" ", "]
set i [expr {[clonescan::string2llength $nicklist] - 1}]
putserv "PRIVMSG $channel :\($host\) Nicklist: $nicklist - Clones: $i"
incr count $i
}
foreach variable [array names clonescan::clones $channel:*] {
unset clonescan::clones($variable)
}
putserv "PRIVMSG $channel :Clones: $count ([set p [format %.1f [expr ($count.0 * 100.0) / [set c [llength [chanlist $channel]]].0]]]%) Realusers: [expr ($c - $count)] ([expr (100.0 - $p)]%) - Took: [expr ($end-$start)/1000.0]ms."
}
proc clonescan::checknick {nickname} {
global botnick
if {[string equal -nocase $botnick $nickname] || $nickname == "Q" || $nickname == "S"} {
return 1
} else {
return 0
}
}
proc clonescan::string2llength {str} {
set i "0"
foreach x $str {
incr i 1
}
return "$i"
}
putlog "$clonescan::copyright - loaded!" |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Wed Jan 07, 2009 10:10 am Post subject: |
|
|
Works fine,thanks  |
|
| Back to top |
|
 |
|