The script displayes files like so:
/www0/salvia/tech/fserv/testi.gif (512 Bytes)
/www0/salvia/tech/fserv/iroffer_win32bin_1.2b16.tgz (256 Kb)
/www0/salvia/tech/fserv/SSH Secure File Transfer Client.lnk (1 Kb)
Total files: 5
__________________________________________________
a person types !list in the channel and it makes list.txt and sends it to them
I dont want it to display the directory and I want each file to be on it's own line in the text file.
and I want people to be able to /ctcp <Botnick> get <filename>
not /msg <Botnick> get <path><filename>
___________________________________________________________
### FServ v0.5
### by Progeny <progeny@azzurra.org>
### AzzurraNet - #EggHelp (TCL & Eggdrop)
## Settings:
set fhome "/www0/salvia/tech/fserv"
set maxsend 3
set maxget 5
## Temp settings:
set csend 0
set cget 0
#### FILESYS MODULE ####
loadmodule filesys
set files-path $fhome
set incoming-path $fhome
set upload-to-pwd 0
set filedb-path ""
set max-file-users $maxsend
set max-filesize 0
#### TRANSFER MODULE ####
loadmodule transfer
set max-dloads $maxsend
set dcc-block 0
set copy-to-tmp 1
set xfer-timeout 60
bind msg - get getfile
bind msg - help fhelp
bind pub - !list flist
proc getfile {nick uhost hand argv} {
global fhome
foreach chan [channels] {
if [onchan $nick $chan] {
putserv "NOTICE @$chan :Beginning DCC Send to $nick ($argv)"
}
}
dccsend $argv $nick
}
proc flist {nick uhost hand chan argv} {
global fhome
set nfiles 0
set lfile [open list.txt w]
foreach files [glob -nocomplain -- $fhome/*] {
set fsize [file size $files]
set unit Bytes
if {$fsize > 1024} {
set unit Kb
set fsize [expr $fsize / 1024]
}
if {$fsize > 1024} {
set unit Mb
set fsize [expr $fsize / 1024]
}
if {$fsize > 1024} {
set unit Gb
set fsize [expr $fsize / 1024]
}
incr nfiles
puts $lfile "$files ($fsize $unit)"
}
puts $lfile "Total files: $nfiles"
close $lfile
unset nfiles
dccsend list.txt $nick
}
proc fhelp {nick uhost hand argv} {
global ver
puthelp "PRIVMSG $nick :*** FServ $ver Help"
puthelp "PRIVMSG $nick :* Channel commands:"
puthelp "PRIVMSG $nick : - !list (Send to you via DCC the list of shared files)"
puthelp "PRIVMSG $nick :* Query commands:"
puthelp "PRIVMSG $nick : - get <path of file> (Send to you the file that you have requested) "
puthelp "PRIVMSG $nick : Example: get /home/user/fserv/cd1.iso"
puthelp "PRIVMSG $nick :*** End of Help ***"
}
putlog "TCL Loaded: FServ $ver by Progeny"