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.

question?

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pektek
Halfop
Posts: 51
Joined: Sat Jul 01, 2023 4:51 pm

question?

Post by pektek »

hello all i have this working code with me however its versioning every ip but i jus want it to version certain ips like for example *!*@125.* *!*@118.* , i tried to play around with it but with no success,help will be appreciated.. Code is listed below :

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 90 [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]) 
} 
}
putlog "Version Kicker"
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: question?

Post by CrazyCat »

Add some string match in your exiting condition:

Code: Select all

proc check:version {nick uhost hand chan} { 
   if {[isop $nick $chan] || [isvoice $nick $chan] || [matchattr $hand Pfov|Pfov $chan]
      || [string match "*@125.*" $uhost] || [string match "*@118.*" $uhost] } { 
      return 0 
   }
}
If you don't want to exclude too much hostmask, you can easily manage it

P.S.: do you know you can say "thank you" when a post/poster helps you. I won't help you anymore until you learn that being polite is also a rule in forums.
Post Reply