View Single Post
Old 11-25-2012, 09:22 AM  
PlaN3t
Member
 
Join Date: Mar 2005
Posts: 43
Default

anyway, with a friend we have fixed the dzsbot.tcl because the command "dupe -f" don't work and we have added the spam for "dupe / dupe -f" in private o chan spam mode.

if someone is interested, here the changes:

1) modify the dzsbot.conf and add this line:


"set nx(private_spam) 0" (0 chan spam, 1 private spam)


we have added this line here (under line 150):

#### SETTINGS

#how many should we show?
set nx(new_limit) 5
set nx(nuke_limit) 5
set nx(unnuke_limit) 5
set nx(onliners_limit) 3
set nx(dupe_limit) 10
set nx(pres_limit) 5
set nx(private_spam) 0 <----






2) in dzsbot.tcl replace lines from 1709 to 1757 with this code, naturally original dzsbot.tcl ( http://www.pastebin.ca/2255124 ):





proc dupe {nick uhost handle chan args} {global nx announce

set pattern [join $args]
set temp [FixString $pattern]

if {$nx(private_spam) == 1} {
set target $nick
} else {
set target $chan
}

if {$pattern == "" || ($pattern == "-f")} {
sndone $target "USAGE dirs: !dupe <pattern> Wildcard=*"
sndone $target "USAGE file: !dupe -f <pattern> Wildcard=*"
return
}
if {[string first "?" $pattern] != -1 || [string first "*" $pattern] != -1 } {
if {!$nx(undupe_wild)} {
sndone $target "wildcards are not allowed"
return
}
if {[regexp -all -- {[[:alnum:]]} $pattern] < $nx(undupeChars)} {
sndone $target "you must specify at least $nx(undupeChars) alphanumeric chars with wildcards"
return
}
}

if {[lindex $pattern 0] == "-f"} {
set colName "FileName"
set tableName "DupeFiles"
set pathName "FilePath"
set pattern [lrange $pattern 1 end]
} else {
set colName "DirName"
set tableName "DupeDirs"
set pathName "DirPath"
}

set pattern [FixString $pattern]

sndone $target $announce(DUPE)

set query "SELECT * FROM $tableName WHERE $colName LIKE '$pattern' ESCAPE '\\' ORDER BY TimeStamp DESC limit $nx(dupe_limit)"
set count 0
if {[DbOpenFile "${tableName}.db"]} {
db eval $query values {
incr count
set age [expr {[clock seconds] - $values(TimeStamp)}]
set date [clock format $values(TimeStamp) -format "%Y-%m-%d"]
set section [getsectionname $values($pathName)]
sndone $target [string map[list %nr $count %date $date %u_name $values(UserName) %g_name $values(GroupName) %age [duration $age] %section $values($pathName) %dupename $values($colName)] $announce(DUPE_BODY)]
}

db close
}

if {!$count} {sndone $target $announce(DUPE_NONE)}
}



sorry for the english, anyway:


ENJOY

Last edited by PlaN3t; 11-25-2012 at 09:33 AM.
PlaN3t is offline   Reply With Quote