| View previous topic :: View next topic |
| Author |
Message |
gamble27 Halfop
Joined: 05 Aug 2008 Posts: 71
|
Posted: Fri May 28, 2010 6:30 am Post subject: check ip instead of nick |
|
|
| Code: |
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 |
|
| Back to top |
|
 |
game_over Voice
Joined: 26 Apr 2007 Posts: 29
|
Posted: Sat May 29, 2010 5:46 pm Post subject: |
|
|
| Code: | 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) |
|
| Back to top |
|
 |
gamble27 Halfop
Joined: 05 Aug 2008 Posts: 71
|
Posted: Sun May 30, 2010 1:50 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
|