mIRC Homepage
Posted By: CyborAccess dcc send script - 18/09/05 07:57 AM
hi how do u make the script that sends a specific file when people says send a specific file command??
example:
if he says /sendfile hi.jpg
and the script sends the hi.jpg
and if he says /sendfile blah.exe
and it sends the blah.exe
please reply thanks confused grin
Posted By: RusselB Re: dcc send script - 18/09/05 09:13 AM
Code:
on *:text:!send*:*:{
if (!$2) {
.msg $nick No file specified
}
else {
var %a = 1
while %a <= $numtok($2-,32) {
if ($exists($gettok($2-,%a,32)) {
set %file $addtok(%file,$gettok($2-,%a,32),32)
}
inc %a
}
dcc send -c $nick %file
}
  


Code allows for multiple files separated with spaces, and checks to see if the file exists. Files must be in the main mIRC directory. Long filenames are not supported.

If you need long filename support and/or support for files to be in one or more locations, let me know and I'll see what I can come up with, but it will be more complex.
Posted By: CyborAccess Re: dcc send script - 18/09/05 09:52 PM
thanks....i remember people teach me one be4 that was WAYYYY shorter...so do you know how to make it shorter and make it can send any type of format files? (exe,mrc.jpg.etc)
thanks
Posted By: RusselB Re: dcc send script - 18/09/05 10:22 PM
It can be made a lot shorter, but it wouldn't have the controls that I put in to that one.
I mean, you could use something as simple as
Code:
on *:text:!send*:*:{ dcc send -c $nick $$2-)  


But that won't give a response if there's no file supplied or if the file supplied doesn't exist.

In both of the codes that I've given, the full filename, including the extension, must be supplied by the person using the !send command
Posted By: DaveC Re: dcc send script - 18/09/05 10:39 PM
RusselB's is correct but leaves you open to abuse you would be allowing open read access to your system (well almost open)

I suggest lines like these

on *:text:!send hi.jpg:*:{ dcc send -c $nick hi.jpg )
on *:text:!send blah.exe:*:{ dcc send -c $nick "c:\folder name\blah.exe" }
;etc etc you can even do....
on *:text:!send picture:*:{ dcc send -c $nick "c:\folder name\mypicture.jpg" }
;where your trigger need not be the same as the file you send

This well limit what files you allow and what trigger you allow them on
Posted By: CyborAccess Re: dcc send script - 18/09/05 11:01 PM
ok i want the no file access response too but cant it be like short too?
Posted By: MikeChat Re: dcc send script - 18/09/05 11:33 PM
provided your files are all just in the main mIRC folder you could do something like this
Code:
on *:TEXT:!send *:*:{ $iif($isfile($$2),dcc send -c $nick $2,notice $nick   $2 No Such File.) }
Posted By: DaveC Re: dcc send script - 19/09/05 12:46 AM
on *:text:!send hi.jpg:*:{ dcc send -c $nick hi.jpg )
on *:text:!send blah.exe:*:{ dcc send -c $nick "c:\folder name\blah.exe" }
on *:text:!send picture:*:{ dcc send -c $nick "c:\folder name\mypicture.jpg" }
on *:text:!send *:*:{ notice $nick No such file }
on *:text:!send:*:{ notice $nick Usage !send filename }
© mIRC Discussion Forums