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.

Only Version Certain Ips.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Only Version Certain Ips.

Post by gamble27 »

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" 
Thank you For Assisting.
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

You can try this if you have problems leave a reply and i will take a closer look at the code

Code: Select all

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

set temp(hosts) {
	"125."
	"133."
}

proc check:version {nick uhost hand chan} {
	global temp

	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
	foreach n [split $temp(hosts)] {
		if {[string match -nocase "$n*" [lindex [split [getchanhost $nick $chan] @] 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
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

set ctcpList [list "*!*@125.*" "*!*@118.*"]

bind join - * version:join
bind ctcp - VERSION version:reply

proc version:join {nick uhost hand chan} {
	global versionCheck
	if {[isbotnick $nick]} return
	if {[matchattr $hand Pfov|Pfov $chan]} return
	if {[lsearch -glob $::ctcpList "$nick!$uhost"]!=-1]} {
		if {[lsearch [array names versionCheck] $nick] != -1} return
		puthelp "PRIVMSG $nick :\001Version\001"
		array set versionCheck { $nick 1 }
		utimer 90 [list version:punish $nick $uhost $chan]
	}
}

proc version:reply {nick uhost hand dest key text} {
	global versionCheck
	if {![isbotnick $dest]} return
	if {[lsearch [array names versionCheck] $nick] != -1} return
	array unset versionCheck $nick
}

proc version:punish {nick uhost chan} {
	global versionCheck
	if {[lsearch [array names versionCheck] $nick] != -1} return
	if {[onchan $nick $chan]} {
		putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]" 
		putserv "KICK $chan $nick :Spam!"
	}
	array unset versionCheck $nick
}
Haven't tested so let me know if you get any errors.
Once the game is over, the king and the pawn go back in the same box.
Post Reply