PDA

View Full Version : Undupe works from command line but not through dzsbot .. help!


Superblue
06-12-2003, 08:40 AM
<userman> !gokuundupe tcf-ctgb.part29.rar

[14:33] <bot> Unduping...
[14:33] <bot> -----------------------
[14:33] <bot>
[14:33] <bot> -----------------------
[14:33] <bot> 0 dupes deleted.


C:\ioftpd\system>undupe.exe tcf-ctgb.part29.rar
Unduping...
-----------------------

Unduped: tcf-ctgb.part29.rar

-----------------------
1 dupes deleted.


my binary line in dzsbot.tcl is:
set binary(UNDUPE) "C:/ioFTPD/system/undupe.exe"

and it seems to be calling it.. but not unduping the file.. the dupe/undupe programs and the db is in the system directory.

Xcaliber
06-12-2003, 08:16 PM
I make as following and am using.

set binary(UNDUPE) "c:/ioFTPD/scripts/undupe.exe"


proc proc_undupe { nick uhost hand chan arg } {
global binary disable location
if { $disable(UNDUPE) == 0 } {
set result [exec $binary(UNDUPE) $arg]
set result [split $result \n]
set result [lreplace $result 0 1]
set result [lreplace $result end-1 end]
foreach line [split $result "\n"] {
if { [lindex $line 1] == "" } {
putserv "PRIVMSG $chan :\[ \002UNDUPE\002 \] $arg - Not Found DupeDB."
} else {
putserv "PRIVMSG $chan :\[ \002UNDUPE\002 \] [lindex $line 1]" }
}
}
}

Superblue
06-24-2003, 11:31 AM
The problem seems to be that the bot is looking for the db in the eggdrop directory instead of the system directory. It runs the command but it executes it out of the \sitebot directory..

Superblue
06-24-2003, 11:56 AM
Fixed it.. changed the following in proc_undupe..

used some cd commands in the process, see post below.. if you only pasted the part from this before I edited it, get the stuff from below instead!

dircd
06-24-2003, 06:17 PM
Nice the the cd ..\system did the trick :)

Superblue
06-24-2003, 08:06 PM
alright there is a problem with using the cd part.. at the end of the command you have to cd back to the sitebot directory or it loses track of all its msg files and stuff because it stays localized in the system directory.... here is the complete proc

(remember that the final cd command which is sitebot for me may be different for you)

it wraps funny but you get the idea..

################################################## ###############################
# POST UNDUPE #
################################################## ###############################
proc proc_undupe { nick uhost hand chan arg } {
global binary disable location
if { $disable(UNDUPE) == 0 } {
cd "../system"
set result [exec $binary(UNDUPE) $arg]
set result [split $result \n]
set result [lreplace $result 0 1]
set result [lreplace $result end-1 end]
foreach line [split $result "\n"] {
if { [lindex $line 1] == "" } {
putserv "PRIVMSG $chan :\[ \002UNDUPE\002 \] $arg - Not Found DupeDB."
} else {
putserv "PRIVMSG $chan :\[ \002UNDUPE\002 \] [lindex $line 1]" }
}
cd "../sitebot"}
}