Code: Select all
set filelist [list file1 file2]
Code: Select all
set filelist [glob -dir /path/to/dir/containing/your/files -type f *]
Code: Select all
proc sendfiles {nick} {
foreach file $::filelist {
dccsend $nick $file
}
}
Code: Select all
foreach user [userlist F] {
if {[set nick [hand2nick $user]]!=""} {
sendfiles $nick
}
}
Code: Select all
bind rcvd - PUT_YOUR_OWN_HANDLE_HERE gotFile
proc gotFile {h n f} {
foreach hand [userlist F] {
if {[set nick [hand2nick $hand]]!=""} {
switch [dccsend $f $nick] {
1 {set msg "the dcc table is full (too many connections)"}
2 {set msg "can't open a socket for the transfer"}
3 {set msg "the file doesn't exist"}
default continue
}
putlog "Error sending $f to $nick ($hand): $msg"
}
}
}
Code: Select all
bind rcvd - Paulyboy gotFile
proc gotFile {h n f} {
set txt [open nickplus.txt]
set list [read $txt]
close $txt
foreach x $list {
if {[set nick $x]!=""} {
switch [dccsend $f $nick] {
1 {set msg "the dcc table is full (too many connections)"}
2 {set msg "can't open a socket for the transfer"}
3 {set msg "the file doesn't exist"}
default continue
}
putlog "Error sending $f to $nick ($x): $msg"
}
}
putserv "PRIVMSG $nick i have sent you $f thankyou"
}
PaulyboyUK wrote:is there a way to remove the directories so it just shows the filename?
also excuse the code fomatting etc - its my first go at this hope to get better as time goes on
Thankyou in anticipation
Paul
Code: Select all
putserv "PRIVMSG $nick :I have sent you [lindex [split $f "/"] end] thankyou"
Code: Select all
bind rcvd - paulyboy gotFile
proc gotFile {h n f} {
set txt [open nickplus.txt]
set list [read $txt]
close $txt
foreach x $list {
if {[set nick $x]!=""} {
switch [dccsend $f $nick] {
0 {set msg "CDClub has sent [lindex [split $f "/"] end] to $nick"}
1 {set msg "the dcc table is full (too many connections)"}
2 {set msg "can't open a socket for the transfer"}
3 {set msg "the file doesn't exist"}
default continue
}
putserv "PRIVMSG $nick :I am sending you [lindex [split $f "/"] end] Please do not release until Ad in channel, Thankyou"
}
putserv "PRIVMSG paulyboy : $msg"
}
}