This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

anyone who can help me with this.

Old posts that have not been replied to for several years.
Locked
F
FoRc

anyone who can help me with this.

Post by FoRc »

# Where is your file directory?
set get_dir "/home/forc/files"

# Which files/directories should I not search for/in?
set get_nfile "incoming readme.txt"

# Which channels shall the commands work on?
set get_chans "#warez"

###############################################################
## Do not edit below here unless you know what you are doing ##
###############################################################

bind pub - !get GET:pub_get
bind pub +v|+v !send GET:pub_send2

proc filesearch {file dir} {
set file [string tolower $file]
return [searchdat $file $dir]
}

proc searchdat {file dir} {
if {[string range $dir end end] != "/"} {
append dir "/"
}
set r ""
set l [glob -nocomplain $dir*]
foreach f $l {
if {[file isdirectory $f]} {
set r [concat $r [searchdat $file $f]]
} elseif {[file isfile $f]} {
if {[string tolower [file tail $f]] == $file} {
lappend r $f
}
}
}
return $r
}

proc chncheck {chan check} {
foreach c $check {
if {$chan == $c} {
return 1
}
}
return 0
}

proc GET:pub_get {nick host hand chan text} {
global get_dir get_chans get_nfile
if {[chncheck $chan $get_chans]} {
set file [lindex $text 0]
if {![string match "*[string tolower $file]*" "[string tolower [lrange $get_nfile 0 end]]"]} {
set results [filesearch $file $get_dir]
} {
puthelp "NOTICE $nick :Could not send you $file, because the file has been disabled."
return 1
}
if {[llength $results] == 0} {
puthelp "NOTICE $nick :Didn't find any results for $file"
} {
set sent [dccsend [lindex $results 0] $nick]
if {$sent == 0} {
puthelp "NOTICE $nick :Sending You the fileserver script $file did you type /dccallow +bootdisk also? if not do that"
} elseif {$sent == 1} {
puthelp "NOTICE $nick :DCC Tables are full. Try back in a few minutes."
} elseif {$sent == 2} {
puthelp "NOTICE $nick :For some strange reason the file does not exist."
} elseif {$sent == 4} {
puthelp "NOTICE $nick :Your file was queued for a later transfer."
} else {
puthelp "NOTICE $nick :An undefined error occurred during the transfer."
}
}
}
return 1
}

proc GET:pub_send2 {nick host hand chan text} {
global get_dir get_chans get_nfile
if {[chncheck $chan $get_chans]} {
set g2nick [lindex $text 0]
set file [lindex $text 1]
if {![string match "*[string tolower $file]*" "[string tolower [lrange $get_nfile 0 end]]"]} {
set results [filesearch $file $get_dir]
} {
puthelp "NOTICE $nick :Could not send you $file, because the file has been disabled."
return 1
}
if {[llength $results] == 0} {
puthelp "NOTICE $nick :Didn't find any results for $file"
} else {
set sent [dccsend [lindex $results 0] $g2nick]
puthelp "NOTICE $g2nick :$nick requested for me to send you $file"
if {$sent == 0} {
puthelp "NOTICE $nick :Sending $g2nick $file"
puthelp "NOTICE $g2nick :Sending you $file"
} elseif {$sent == 1} {
puthelp "NOTICE $g2nick :DCC Tables are full. You cannot receive the file."
puthelp "NOTICE $nick :DCC Tables are full. Could not send $g2nick $file"
} elseif {$sent == 2} {
puthelp "NOTICE $g2nick :For some strange reason the file does not exist."
putserv "NOTICE $nick :The file does not exist."
} elseif {$sent == 3} {
puthelp "NOTICE $nick :Had trouble connecting to $g2nick"
} elseif {$sent == 4} {
puthelp "NOTICE $g2nick :Your file was queued for a later transfer."
puthelp "NOTICE $nick :$file was queued and will be transfered later."
} else {
puthelp "PRIVMSG $nick :An undefined error occurred during the transfer."
}
}
}
return 1
}


###################################

okey there is the script that o downloaded, its damn good and it works, but i want to add something and i don't know a damn about how to script, can someone tell me how to make the script say in a channel like "File succefull sent to $nick" after the user have downloaded the file from my eggdrop..

thank ya all..
d
darko``
Op
Posts: 121
Joined: Sun Sep 08, 2002 5:33 pm
Location: Malta

Post by darko`` »

All you need to know is in file called doc/tcl-commands.doc. Look for bind types.
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
Locked