TCLDROP
Would you like to react to this message? Create an account in a few clicks or log in to continue.
TCLDROP

Eggdrop And TCL Help, Support And Chat
 
HomeHome  PublicationsPublications  FAQFAQ  SearchSearch  MemberlistMemberlist  Latest imagesLatest images  UsergroupsUsergroups  RegisterRegister  Log in  CalendarCalendar  WebsiteWebsite  ChatRoomChatRoom  

 

 Tested Working CloneScanner (opitional kickban option

Go down 
AuthorMessage
ComputerTech
Owner
Owner
ComputerTech


Posts : 99
Points : 268
Reputation : 0
Join date : 2020-04-30

Tested Working CloneScanner (opitional kickban option Empty
PostSubject: Tested Working CloneScanner (opitional kickban option   Tested Working CloneScanner (opitional kickban option Empty24/5/2020, 14:47

Non kickban version

Code:
namespace eval ::CloneScan {

bind pub o|o !clonescan ::CloneScan::clonescan

proc areClones { user other chan } {
    if {$user == $other} {
        # same nicks
        return 0
    }
    if {[getchanhost $user $chan] == [getchanhost $other $chan]} {
        # same uhost, clones detected!
        return 1
    }
    return 0
}
proc listClones { user chan } {
    set clones {}
    foreach other [chanlist $chan] {
        if {[areClones $user $other $chan]} {
            lappend clones $other
        }
    }
    if {[llength $clones]} {
        lappend clones $user
    }
    return $clones # those are all fuckin clones of each other!
}

proc clonescan {nick host hand chan arg} {
    set userlist [chanlist $chan]
    set cloneslist {}
    foreach user $userlist {
        if {[lsearch -exact $cloneslist $user] != -1} {
            continue
        }
        set clones [listClones $user $chan]
        # if clones found, add then to clones list!
        foreach clone $clones {
            lappend cloneslist $clone
        }
    }
    set realusers {}
    foreach user $userlist {
        if {[lsearch -exact $cloneslist $user] == -1} {
            lappend realusers $user
        }
    }
    set numreal [llength $realusers]
    set numclones [llength $cloneslist]
    putserv "PRIVMSG $chan :CloneScan: There are $numreal real users on $chan ($numclones clones found)."
    putserv "PRIVMSG $chan :CloneScan: The clones are: [join $cloneslist]"
}

} ;#end namspace CloneScan

Kickban version
Code:


    namespace eval ::CloneScan {
   
    bind pub o|o !clonescan ::CloneScan::clonescan
   
    proc areClones { user other chan } {
        if {$user == $other} {
            # same nicks
            return 0
        }
        if {[getchanhost $user $chan] == [getchanhost $other $chan]} {
            # same uhost, clones detected!
            return 1
        }
        return 0
    }
   
    # get a list of clones of one user in channel
    proc listClones { user chan } {
        set clones {}
        foreach other [chanlist $chan] {
            if {[areClones $user $other $chan]} {
                lappend clones $other
            }
        }
        # if clones found, add user to the list too!
        if {[llength $clones]} {
            lappend clones $user
        }
        return $clones ;# those are all fuckin clones of each other!
    }
   
    proc clonescan {nick host hand chan arg} {
        set userlist [chanlist $chan]
        set cloneslist {}
        set banlist {}
        foreach user $userlist {
            if {[lsearch -exact $cloneslist $user] != -1} {
                continue
            }
            set clones [listClones $user $chan]
            foreach clone $clones {
                lappend cloneslist $clone
            }
            lappend banlist [lindex $clones 0]
        }
        foreach nik $banlist {
            set uhost [getchanhost $nik $chan]
            set mask "*!$uhost"
            newchanban $chan $mask ComputerTech clones
        }
        foreach nik $cloneslist {
            putkick $chan $nik
        }
        set realusers {}
        foreach user $userlist {
            if {[lsearch -exact $cloneslist $user] == -1} {
                lappend realusers $user
            }
        }
        set numreal [llength $realusers]
        set numclones [llength $cloneslist]
        putserv "PRIVMSG $chan :CloneScan: There are $numreal real users on $chan ($numclones clones found)."
        putserv "PRIVMSG $chan :CloneScan: The clones are: [join $cloneslist]"
    }
   
    } ;#end namspace CloneScan

Back to top Go down
http://www.computer-tech1.webnode.co.uk
 
Tested Working CloneScanner (opitional kickban option
Back to top 
Page 1 of 1
 Similar topics
-
» BlackShadows BlackTools's Clonescanner module
» Bot PM kickban
» Search Kickban clone script
» Fully Tested Clone Script
» Suggestions for A Working Weather Script

Permissions in this forum:You cannot reply to topics in this forum
TCLDROP :: Other :: Code-
Jump to: