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.

Clones

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
DaRkOoO
Halfop
Posts: 67
Joined: Sat Sep 27, 2008 7:27 am

Clones

Post by DaRkOoO »

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.
N
Nimos
Halfop
Posts: 80
Joined: Sun Apr 20, 2008 9:58 am

Post by Nimos »

how do you define a "clone"?
D
DaRkOoO
Halfop
Posts: 67
Joined: Sat Sep 27, 2008 7:27 am

Post by DaRkOoO »

users with same Ip adresses..
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

This was made ages ago, not sure if it still works:

Code: Select all

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
D
DaRkOoO
Halfop
Posts: 67
Joined: Sat Sep 27, 2008 7:27 am

Post by DaRkOoO »

Works fine,thanks ;)
Post Reply