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 

Darn clonescan not working correctly:)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
sky6419
Voice


Joined: 17 Jan 2014
Posts: 20

PostPosted: Fri May 01, 2015 3:44 pm    Post subject: Darn clonescan not working correctly:) Reply with quote

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:
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 »»"
        }
    }
}
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Fri May 01, 2015 9:39 pm    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
sky6419
Voice


Joined: 17 Jan 2014
Posts: 20

PostPosted: Sat May 02, 2015 7:08 am    Post subject: clonescan Reply with quote

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.
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat May 02, 2015 11:52 am    Post subject: Reply with quote

Code:

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


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.


Last edited by SpiKe^^ on Sun May 03, 2015 11:10 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
sky6419
Voice


Joined: 17 Jan 2014
Posts: 20

PostPosted: Sat May 02, 2015 5:52 pm    Post subject: clonescan Reply with quote

The script works but the report does not write the ident last clone.
Mask/Host: SimosNap-025E6I.49-151.net24.it
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat May 02, 2015 6:30 pm    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
sky6419
Voice


Joined: 17 Jan 2014
Posts: 20

PostPosted: Sun May 03, 2015 7:21 am    Post subject: Reply with quote

(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)
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sun May 03, 2015 1:06 pm    Post subject: clonescan.tcl v1.1 (3May2015) Reply with quote

Try this and see...
Code:

###################################
## 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
.
Back to top
View user's profile Send private message Visit poster's website
sky6419
Voice


Joined: 17 Jan 2014
Posts: 20

PostPosted: Sun May 03, 2015 3:18 pm    Post subject: Reply with quote

what to say? simply beautiful! Perfect ! thanks!
SpiKe^^.
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 -> Scripting Help 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