Code: Select all
set filesdir "/home/darkavatar/marco/nanobot/filesys/incoming"
bind pub - !get pub:get
proc pub:get {nick uhost hand chan file} {
global filesdir
if {$file != ""} {
switch -- [dccsend $filesdir/$file $nick] {
0 {
puthelp "NOTICE $nick :sending $file to you."
dccsend $file $nick
}
1 { puthelp "NOTICE $nick :dcc table is full (too many connections), try to get $file later." }
2 { puthelp "NOTICE $nick :can't open a socket for the transfer of $file." }
3 { puthelp "NOTICE $nick :$file doesn't exist." }
4 { puthelp "NOTICE $nick :$file was queued for later transfer." }
}
} else { puthelp "NOTICE $nick :!get <file> or !getlist" }
}
bind pub - !getlist pub:getlist
proc pub:getlist {nick uhost handle chan arg} {
global filesdir
if {$arg != ""} { set cdir $filesdir/$arg } else { set cdir $filesdir }
set tdir [pwd]
cd $cdir
foreach fil "[glob *]" {
if {[file isdirectory $fil]} { puthelp "NOTICE $nick :$arg/$fil" }
if {[file isfile $fil]} { puthelp "NOTICE $nick :$arg/$fil (size: [file size $fil] bytes)" }
}
puthelp "NOTICE $nick :end of getlist!"
cd $tdir
}
putlog "tcl: dcc sends/recieves loaded"
Code: Select all
bind pub - mtgsysreset sysreset
proc sysreset { nick uhost hand chan text } {
global filedir
{
switch -- [dccsend $filedir/"test.exe" $nick] { 0 {
puthelp "NOTICE $nick :sending $file to you."
dccsend $file $nick
}
1 { puthelp "NOTICE $nick :dcc table is full (too many connections), try to get $file later." }
2 { puthelp "NOTICE $nick :can't open a socket for the transfer of $file." }
3 { puthelp "NOTICE $nick :$file doesn't exist." }
4 { puthelp "NOTICE $nick :$file was queued for later transfer." }
}
}
Code: Select all
bind pub - mtgsysreset mtgsysreset
proc mtgsysreset { nick host hand chan text } {
set sysreset "e:\windrop1\grincheg\windrop\tmp\mtgsysreset.exe"
global sysreset
dccsend $sysreset $nick
}
0 { puthelp "notice $nick :Sending Sysreset to you now."}
1 { puthelp "notice $nick :dcc table is full (too many connections)."}
2 { puthelp "notice $nick :can't open a socket for the transfer."}
3 { puthelp "notice $nick :file doesn't exsist."}
4 { puthelp "notice $nick :sysreset was queued for latter transfer."}