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.

check ip instead of nick

Help for those learning Tcl or writing their own scripts.
Post Reply
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

check ip instead of nick

Post by gamble27 »

Code: Select all

bind ctcr - VERSION version:reply 
bind join - * check:version 

proc check:version {nick uhost hand chan} { 
if {[isop $nick $chan] || [isvoice $nick $chan] || [matchattr $hand Pfov|Pfov $chan]} { 
return 0 
}

global cversion 
chattr proxychk +|+P $chan 
set cversion([string tolower $nick]) 1 
putserv "PRIVMSG $nick :\001Version\001" 
utimer 60 [list no:version:reply $nick $uhost $chan] 
} 

proc version:reply {nick uhost hand dest kw arg} { 
global cversion 
if {[info exists cversion([string tolower $nick])]} { 
unset cversion([string tolower $nick]) 
} 
} 


proc no:version:reply {nick uhost chan} { 
global cversion 
if {[info exists cversion([string tolower $nick])] && [onchan $nick $chan]} { 
putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]" 
putserv "KICK $chan $nick : Spam" 
unset cversion([string tolower $nick]) 
} 
}
this code is working fine,its kicking everyone that doesnt reply version however, the spammers are getting smarter they join a channel and change nick immediately,as a result when this code does [onchan $nick $chan]} this check,the nick which joined is no longer on channel,therefore the spammer escaped from kick, now what i want is instead of this code checks for nick that joined.. i want it to check the ip that joined so even if the nick is changed but if ip is in they will still get kicked im sure the change is here [onchan $nick $chan]} but im not sure how to do it,plz assist me, any help will b greatly appreciated.

in short instead of checking the nick which joined,we check for the ip(of the nick joined) before kicking.. thanks
g
game_over
Voice
Posts: 29
Joined: Thu Apr 26, 2007 7:22 am

Post by game_over »

Code: Select all

bind nick - * check:nick:bug
proc check:nick:bug {nick uhost handle chan newnick} {
 global cversion
 if {[utimerexists [list no:version:reply $nick $uhost $chan]]!=""} {
  set sd [utimers]; set begin [lsearch -regexp $sd "$nick"]
  utimer [lindex [lindex $sd $begin] 0] [list no:version:reply $newnick $uhost $chan]
 killutimer [lindex [lindex $sd $begin] end]
 }
}
I look other way. if someone join channel script add timer. Just use bind join to modify timer (kill older and set new with time left and new nick)
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Post by gamble27 »

the thing is not all spammers change to new nick some remain same nick,so i have to keep the core of the tcl and just change the checking part from nick to ip.
Post Reply