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 

check ip instead of nick

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


Joined: 05 Aug 2008
Posts: 71

PostPosted: Fri May 28, 2010 6:30 am    Post subject: check ip instead of nick Reply with quote

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
View user's profile Send private message
game_over
Voice


Joined: 26 Apr 2007
Posts: 29

PostPosted: Sat May 29, 2010 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Sun May 30, 2010 1:50 am    Post subject: Reply with quote

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
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