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 

Clones

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


Joined: 27 Sep 2008
Posts: 67

PostPosted: Tue Jan 06, 2009 3:49 pm    Post subject: Clones Reply with quote

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
View user's profile Send private message
Nimos
Halfop


Joined: 20 Apr 2008
Posts: 80

PostPosted: Wed Jan 07, 2009 7:24 am    Post subject: Reply with quote

how do you define a "clone"?
Back to top
View user's profile Send private message
DaRkOoO
Halfop


Joined: 27 Sep 2008
Posts: 67

PostPosted: Wed Jan 07, 2009 7:45 am    Post subject: Reply with quote

users with same Ip adresses..
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Wed Jan 07, 2009 9:13 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
DaRkOoO
Halfop


Joined: 27 Sep 2008
Posts: 67

PostPosted: Wed Jan 07, 2009 10:10 am    Post subject: Reply with quote

Works fine,thanks Wink
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