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.

Darn clonescan not working correctly:)

Help for those learning Tcl or writing their own scripts.
Post Reply
s
sky6419
Voice
Posts: 23
Joined: Fri Jan 17, 2014 5:31 am

Darn clonescan not working correctly:)

Post by sky6419 »

I would still have a question about the script recognizes the clones with ident and ip . changing ident does not recognize the clone as you can change ?

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 »»"
        }
    }
}
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Explain more, and give examples plz.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
sky6419
Voice
Posts: 23
Joined: Fri Jan 17, 2014 5:31 am

clonescan

Post by sky6419 »

This script detects clones in channels and writes the report to a default channel . The problem is : detect clones with ident and IP equal.
If the IP is the same but the ident is different it does not detect the clone .
Example ~BLaKFLaG@SimosNap-025E6I.49-151.net24.it -- ~J2OLpZRLf@SimosNap-025E6I.49-151.net24.it is not detected as a clone. I'm sorry for my english.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

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 

# set this to 0 to detect clones using username@host
# set this to 1 to detect clones using just the host
set clonescan(justhost) 1

bind join - * onjoin:clonescan 

proc onjoin:clonescan {nick uhost hand chan} { 
    global clonescan 
    if {[lsearch -exact $clonescan(channel) [string tolower $chan]] > -1} { 

        if {$clonescan(justhost)} { 
            set uhost [lindex [split $uhost @] 1]

        } elseif {$clonescan(strip)} { 
            set uhost [string trimleft $uhost "~"] 
        } 

        set list [list] 

        foreach user [chanlist $chan] { 

            set host [getchanhost $user $chan]

            if {$clonescan(justhost)} { 
                set host [lindex [split $host @] 1]

            } elseif {$clonescan(strip)} { 
                set host [string trimleft $host "~"]
            } 


            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 »»" 
        } 
    } 
}

Last edited by SpiKe^^ on Sun May 03, 2015 11:10 am, edited 1 time in total.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
sky6419
Voice
Posts: 23
Joined: Fri Jan 17, 2014 5:31 am

clonescan

Post by sky6419 »

The script works but the report does not write the ident last clone.
Mask/Host: SimosNap-025E6I.49-151.net24.it
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Dowhat¿

Explain what it is doing and what you think it should be doing plz.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
sky6419
Voice
Posts: 23
Joined: Fri Jan 17, 2014 5:31 am

Post by sky6419 »

(set clonescan(strip) 0; #set this to 1 to strip ~ from idents - set clonescan(justhost) 1) with these settings correctly identifies
example -->SimosNap-example.ip00.fastwebnet.it-.
I'd like that when it enters the clone also wrote the ident last entered.
-->ident@SimosNap-example.ip00.fastwebnet.it
if {[llength $list] > 1} <- This should display the number of clones ? It seems not working
should add the code? [expr]
(Thanks for your patience)
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

clonescan.tcl v1.1 (3May2015)

Post by SpiKe^^ »

Try this and see...

Code: Select all

###################################
## clonescan.tcl v1.1 (3May2015) ##
###################################

########  Begin Settings  ########

# set the channel name(s) to monitor for on-join clones.
set clonescan(channel) "#mychannel1 #mychannel2 #mychannel3"

# set the channel name to relay on-join clone info to.
set clonescan(relaychan) "#staff" 

# set this to 0 to not strip ~ from idents
# set this to 1 to strip ~ from idents
set clonescan(strip) 0

# set this to 0 to detect clones using username@host
# set this to 1 to detect clones using just the host
set clonescan(justhost) 1

# set the number of other clones to trigger on.
#  1 = the nick joining has 1 or more other clones in the channel.
#      note: this will trigger every time someone rejoins
#            before their ghost connection times out!
#  2 = the nick joining has 2 or more other clones in the channel.
#      note: or set to any number greater than zero.
set clonescan(clones) 1

#########  End Settings  #########

set clonescan(channel) [split [strlwr $clonescan(channel)]]
if {![string is digit -strict $clonescan(clones)] || $clonescan(clones)<"1"} {
  set clonescan(clones) 1
}

bind join - * onjoin:clonescan 

proc onjoin:clonescan {nk uh hn ch} { 
  global clonescan 
  if {[lsearch -exact $clonescan(channel) [strlwr $ch]] > -1} { 

    if {$clonescan(strip)} {
      set uh [string trimleft $uh "~"] 
    } 

    if {$clonescan(justhost)} { 
      set mask [lindex [split $uh @] 1]
    } else {  set mask $uh  }

    set list [list] 
    foreach user [chanlist $ch] { 

      set host [getchanhost $user $ch]

      if {$clonescan(justhost)} { 
        set host [lindex [split $host @] 1]
      } elseif {$clonescan(strip)} { 
        set host [string trimleft $host "~"]
      } 

      if {[string equal -nocase $mask $host]} { 
        lappend list $user
      } 
    } 

    if {[set num [llength $list]] >= $clonescan(clones)} { 
      set txt "«« \[$ch\]$nk $uh is a clone! - [number_to_number $num]"
      set nks "( [join $list ", "] )"

      if {$num == 1} {
        set txt "$txt other nick $nks is the same person! »»"
      } else { set txt "$txt other nicks $nks are the same person! »»" }

      putmsg $clonescan(relaychan) $txt
    } 
  } 
}

putlog "«« clonescan.tcl v1.1 loaded. »»"

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
sky6419
Voice
Posts: 23
Joined: Fri Jan 17, 2014 5:31 am

Post by sky6419 »

what to say? simply beautiful! Perfect ! thanks!
SpiKe^^.
Post Reply