botlending forum  

Go Back   botlending forum > Eggdrop & TCL > Tcl scripting

Tcl scripting Tcl scripting related questions

Reply
 
LinkBack Thread Tools Display Modes
Old 05-12-2006, 08:35   #1 (permalink)
Junior Member
 
strugurel's Avatar
 
Join Date: Oct 2005
Location: Sibiu
Age: 20
Posts: 6
Rep Power: 0
strugurel is an unknown quantity at this point
Send a message via Yahoo to strugurel
Talking bad version

Code:
## Punish the people who have one of the following words in the ctcp-version reply.
set bv_versions {"showdown" "microsoft chat"} 

## Ask ctcp-version if user joins one of these channels.
# Note: Set this to "" to enable punishing on all channels.
set bv_chans "#lamest #botcentral"

## [0/1] If user has a lame IRC-client/script then punish him/her only on $bv_chans?
# Note: If this is set to 0 then the bot punish user on all channels where the bot and the user are.
set bv_onlynvchans 1

## What is the reason for the punishment?
set bv_reason "Dont`t use gay scripts or Gay irc clients"

## [0/1] GLine the user?
set bv_gline 1

## Ban for how long time (min)?
set bv_bantime 1440

## What users can use the nvcheck command?
set bv_chkflag "nm"

## Don't ask ctcp-version from Masters, Owners, Bots, or Ops ##
set bv_globflags "m n o b"

## Don't ask ctcp-version from Masters, Owners, or Ops ##
set bv_chanflags "m n o"

###### DONT`T FLIPPIN` EDIT ANYTHING BELOW HERE ######

### Misc Things ###

set bv_ver "0.69"

### Bindings ###

bind join - * join:bv_askver
bind ctcr - VERSION ctcr:bv_ctcp
bind notc - * notc:bv_notice
bind dcc $bv_chkflag nvcheck dcc:nvcheck

### Main Procs ###

proc join:bv_askver {nick uhost hand chan} {
global botnick bv_chans bv_globflags bv_chanflags
	if {[string tolower $nick] != [string tolower $botnick]} {
		foreach globflag $bv_globflags { if {[matchattr $hand $globflag]} { return 1 } }
		foreach chanflag $bv_chanflags { if {[matchattr $hand |$chanflag $chan]} { return 1 } }
		if {($bv_chans == "") || ([lsearch -exact [split [string tolower $bv_chans]] [string tolower $chan]] != -1)} {
			putserv "PRIVMSG $nick :\001VERSION\001"
		}
	}
}

proc ctcr:bv_ctcp {nick uhost hand dest key arg} {
global botnick bv_versions bv_globflags bv_chanflags
	if {[string tolower $nick] != [string tolower $botnick]} {
		foreach version $bv_versions {
			if {[string match "*[string tolower $version]*" [string tolower $arg]]} { 
				bv_punish $nick $uhost 
			}
		}
	}
}

proc notc:bv_notice {nick uhost hand text {dest ""}} {
global botnick bv_versions bv_globflags bv_chanflags
if {$dest == ""} { set dest $botnick }
	if {([string tolower $nick] != [string tolower $botnick]) && ([string match "*version*" [lindex [string tolower $text] 0]])} {
		foreach version $bv_versions {
			if {[string match "*[string tolower $version]*" [lrange [string tolower $text] 1 end]]} { 
				bv_punish $nick $uhost 
			}
		}
	}
}

proc dcc:nvcheck {hand idx arg} {
set target [lindex [split $arg] 0]
	putcmdlog "#$hand# nvcheck $arg"
	if {$target == ""} {
		putidx $idx "Usage: .nvcheck <nick|channel>"
	} else {
		putidx $idx "Asking ctcp-version from $target..."
		putserv "PRIVMSG $target :\001VERSION\001"
	}
}

### Other Procs ###

proc bv_punish {nick uhost} {
global botnick bv_chans bv_onlynvchans bv_reason bv_gline bv_bantime
set hostmask "*[string range $uhost [string first "@" $uhost] end]"
set dowhat ""
	if {[string tolower $nick] != [string tolower $botnick]} {
		foreach chan [channels] {
			if {($bv_onlynvchans) && ([lsearch -exact [split [string tolower $bv_chans]] [string tolower $chan]] == -1)} { continue }
			if {($bv_gline) && ([botisop $chan]) && ([onchan $nick $chan])} { 
				if {![string match "*GLINING*" $dowhat]} { lappend dowhat "glining" }
				putserv "GLINE $hostmask $bv_bantime :$bv_reason"
				putserv "KILL $nick :$bv_reason"
			}
		}
		if {$dowhat != ""} {
			set dowhat "-- [join $dowhat " & "]"
		}
		putlog "BADVERSION: $nick ($uhost) is using lame IRC-client/script $dowhat"
	}
}

### End ###
Este pus sa dea Glined...eu as vrea sa dea ban
__________________
Tu incerci sa inveti ceea ce eu imi doresc sa uit...
strugurel is offline   Reply With Quote
Old 05-12-2006, 08:55   #2 (permalink)
lsn
Member
 
lsn's Avatar
 
Join Date: Jun 2004
Location: In the NeXuS
Posts: 160
Rep Power: 38
lsn will become famous soon enough
Default

Code:
putserv "GLINE $hostmask $bv_bantime :$bv_reason"
putserv "KILL $nick :$bv_reason"
modifici cu
Code:
newban $hostmask $::botnick "$bv_reason" 30m -sticky
Da ban global, pentru ban pe canal specificat mai trebuie modificate unele
__________________
RESTRICTED AREA

Last edited by lsn; 30-03-2007 at 22:21.
lsn is offline   Reply With Quote
Reply

Bookmarks

« .vr ban | !link »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cum modific version UltraS99 a&a light script 5 16-12-2005 12:26


All times are GMT +3. The time now is 07:14.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.