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.

on join check

Old posts that have not been replied to for several years.
Locked
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

on join check

Post by dotslasher »

i got a script ---> www.staticbox.com/checkrejoin.tcl but i would like it to do the following: keep track of people and their nicks and if they were kicked before (if so how many times)

it has to do the following:

A user joins the channel and gets kicked, he then rejoins under a different nick a few secs/mins later, the bot should wallchops it to the channel with the following "Meyba (~u3783436@194.red-217-217-67.user.auna.net) rejoined #ut 35 seconds ago Old Nick was: Dullahan, was kicked # of times" , kinda what i have now, but it doesnt display if the user was kicked. and i would like a fix for the elapsed time display.

i hope i have been clear about this, sorry for my crappy english :p

the script can be found www.staticbox.com/checkrejoin.tcl
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

what's the purpose of this? statistics only?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Not Found

The requested URL /checkrejoin.tcl was not found on this server.
---------------------------------------------------------------------------
Apache/2.0.48 (Fedora) Server at www.staticbox.com Port 80
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

sorry about the link i cleaned up my website and moved all the stuff i didnt use to /old, link works now.

and in reply to demond:

its to keep track of the people who are known troublemakers, that way the channel staff knows if the person that joined is a problem case and that they should watch him closely or not.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

but why would you need to ban troublemakers by nick?

unless you have large amount of users with the same username@host (webchat?), you should always ban by *!*username@maskedhost, or *!*@host, or *!*@maskedhost (for severe abusers) - and never by nick!*@*

and even if you have a webchat, it should be possible to configure it to generate unique usernames (most webchats encode user's IP as hex in the username)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

...just to clarify - so they can't return immediately to the channel, evading the nick ban with a new nick
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

i never said anything about nickbans, it should just check the nick (---> look at its host) and it has to return if the person was already kicked/banned before and how many times, and if possible the time/date he got kicked last time.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

im a bit tired, but a small advise... if your script shall count kicks, it strongly recommened to contain a proc bound to "bind kick" ^^. I don't really know what a bind to part is usefull for anyway in this case :D.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

I'm not sure if [getchanhost] will work on a kicked nick inside [bind kick] proc (it should, but if not, you need to [bind mode] for "+b"), but anyway, here's the stats collecting part:

Code: Select all

bind kick - * foo
proc foo {n u h c t r} {
  set m [maskhost $t![getchanhost $t $c]]
  if [info exists ::kicks($m)] {
    set c [lindex [set ::kicks($m)] 0]; incr c
    set ::kicks($m) "$c [unixtime]"
  } else {
    set ::kicks($m) "1 [unixtime]"
  } 
}
...and stats reporting part:

Code: Select all

foreach {m k} [array get ::kicks] {
  set c [lindex $k 0]; set t [ctime [lindex $k 1]]
  putlog "hostmask: $m, kick count: $c, last: $t"
}
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

tnx for the help it worked like a charm :)

Code: Select all

 -Beholder@#UT- @ fartghffghd (*!*aloha@*.kabel.telenet.be) rejoined #darth kick count: 1, lastkicked: Thu Dec 23 06:23:39 2004, Last Nick was: fart
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

it works fine like i said, but how would i make it only putlog the mask of the person that joined and is a known offender in. atm it putlogs every known hostmask.
[21:13:56] [Beholder]: [15:13] hostmask: *!*temIdle@*.hr.cox.net, kick count: 3, last: Fri Dec 24 00:00:15 2004
[21:13:58] [Beholder]: [15:13] hostmask: *!*u4162677@213.85.115.*, kick count: 3, last: Fri Dec 24 13:59:10 2004
[21:13:58] [Beholder]: [15:13] hostmask: *!*u5569916@*.bellsouth.net, kick count: 1, last: Fri Dec 24 02:18:54 2004
[21:13:58] [Beholder]: [15:13] hostmask: *!*u8691832@*.kotinet.com, kick count: 5, last: Thu Dec 23 13:50:26 2004
[21:13:58] [Beholder]: [15:13] hostmask: *!*u0738794@*.pc.metropolis-inter.com, kick count: 2, last: Fri Dec 24 11:51:05 2004
^^it does the above when some1 rejoins and is known by the bot for being kicked before. ---> just the hostmask of the rejoiner would do.


and would there be a way to clear the hostmasks out of the bot's "memory"?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

how do you know who is a known offender? by his/her hostmask's kick count? if so, this will show only hostmasks with kick count greater than 3:

Code: Select all

foreach {m k} [array get ::kicks] { 
  set c [lindex $k 0]; set t [ctime [lindex $k 1]] 
  if {$c > 3} {putlog "hostmask: $m, kick count: $c, last: $t"}
} 
you can clear the hostmask/stats array by simply unsetting it:

Code: Select all

unset ::kicks
Locked