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.

tcl to find dup hosts

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
T
Tipi
Voice
Posts: 9
Joined: Wed Dec 14, 2005 12:13 pm

tcl to find dup hosts

Post by Tipi »

Is anyone aware of a tcl that will find dup hosts that are entered under mutiple handles?
C
CtrlAltDel
Halfop
Posts: 49
Joined: Wed Jun 02, 2004 7:58 am

Post by CtrlAltDel »

Do you mean Clone detection scripts?

Here I go again with yet another of those "bogus" links ...
T
Tipi
Voice
Posts: 9
Joined: Wed Dec 14, 2005 12:13 pm

Post by Tipi »

no, I run a few large channels, some of the botmasters have not been as good checking before they add to the bot userlist as they should be.

we have numerous duplicate handles, where the user's main nick and his alt nick have both been added as handles in the userlist, with the same hostmask

I'm looking for an easy way to find those duplicate entry's
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

foreach u [userlist] {
   foreach h [getuser $u hosts] {lappend ul [list $h $u]}
}
foreach {h u} [eval concat [lsort -index 0 $ul]] {lappend ua($h) $u}
foreach {h u} [array get ua] {
   if {[llength $u] > 1} {putlog "$h: [join $u]"}
}
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
T
Tipi
Voice
Posts: 9
Joined: Wed Dec 14, 2005 12:13 pm

Post by Tipi »

thank you, you have saved me HOURS of work!
.
.pt
Halfop
Posts: 71
Joined: Wed Nov 16, 2005 10:14 am

Post by .pt »

it gives me this error

•18:04:50• <bot> [12:03] can't read "ul": no such variable
•18:04:50• <bot> while executing
•18:04:50• <bot> "lsort -index 0 $ul"
•18:04:50• <bot> invoked from within
•18:04:50• <bot> "eval concat [lsort -index 0 $ul]"
•18:04:50• <bot> invoked from within
•18:04:50• <bot> "foreach {h u} [eval concat [lsort -index 0 $ul]] {lappend ua($h) $u}"
•18:04:50• <bot> (file "scripts/duplicatehost.tcl" line 6)
•18:04:50• <bot> invoked from within
•18:04:50• <bot> "source scripts/duplicatehost.tcl"
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Umm.. That should only happen theoreticaly when the bot dosen't have any users in it's userlist. The folowing code should work fine.

Code: Select all

foreach u [userlist] {
  foreach h [getuser $u hosts] {
    lappend ul [list $h $u]
  }
}

if {[info exists ul]} {
  foreach {h u} [eval concat [lsort -index 0 $ul]] {
    lappend ua($h) $u
  }
  foreach {h u} [array get ua] {
    if {[llength $u] > 1} {
      putlog "$h: [join $u]"
    }
  }
}
Once the game is over, the king and the pawn go back in the same box.
.
.pt
Halfop
Posts: 71
Joined: Wed Nov 16, 2005 10:14 am

Post by .pt »

i forgot to ask something can the code remove the hosts automaticaly?
.
.pt
Halfop
Posts: 71
Joined: Wed Nov 16, 2005 10:14 am

Post by .pt »

what is suppost the script do when find a new user because i dont see anything made by the script, sorry for the trouble
Post Reply