PDA

View Full Version : ioNinja + Nxtools for dupe fuction


PlaN3t
11-15-2012, 11:40 AM
Hello,
just an info:

until a few months ago, I used the old version of ioFTPD (5.8.5r) on Win7 32bit with nxtools, phpsio and Alcobot.

Now, I want know if is possibile have the result for dupe command in mainchan and not private
and if is possible have the same spam of Alcobot, based under the command site search of nxtools, for have the correct position of the releases.

just an example:

<20:18:58> Obama: .dupe gaudino wanna dance
<20:18:59> |Berlusconi|: Dupe:
<20:19:00> |Berlusconi|: [01] - /MP3/0911/ - Alex_Gaudino_Feat._Taboo_-_I_Dont_Wanna_Dance********
<20:19:01> |Berlusconi|: [02] - /MP3/0903/ - Alex_Gaudino_Feat._Taboo-I_Dont_Wanna_Dance-***********
<20:19:03> |Berlusconi|: [03] - /MP3/0626/ - Alex_Gaudino_Ft._Taboo_-_I_Dont_Wanna_Dance-*********

thanks in advance ;)

o_dog
11-16-2012, 11:18 AM
PlaN3t: As for msging chan change the $nick to $chan in the tcl i guess, never heard of anyone liking that much spam in channels so don't think i implemented it. As far as alcobot i have no idea what you mean so can't answer.

PlaN3t
11-16-2012, 11:35 AM
in Nxtools, the commands dupe and search are different.
your script is based under the dupe command, I want know if is possible to set the search command, because it is more precise to give the location of the release.

Henkie2
11-17-2012, 10:20 AM
On irc you can do !site search if you enable this function on dZSbot.conf (dunno if alcobot use this as well)

PlaN3t
11-18-2012, 11:50 AM
mmh where is this function in dzsbot (anyway dont like this function for the spam) ?
yes, alcobot use this function.

o_dog
11-19-2012, 06:49 PM
you need to load the sitecommands plugin, might have to load some invite thing too. check plugins directory
There is no search function implemented in nxtools per such, so it's not possible.

PlaN3t
11-25-2012, 09:22 AM
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 ;)

PlaN3t
11-25-2012, 09:30 AM
another thing:
for change the type of spam for dupe command, I have changed the variable in the theme from "%date %b{%dupename}" to "%section %b{%dupename}"
if someone use PZS-NG-Classic.zst , others dont know..

;)