mIRC Home    About    Download    Register    News    Help

Print Thread
dcc send script #130477 18/09/05 07:57 AM
Joined: Dec 2004
Posts: 80
C
CyborAccess Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
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


practice makes perfect... smile
Re: dcc send script #130478 18/09/05 09:13 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: dcc send script #130479 18/09/05 09:52 PM
Joined: Dec 2004
Posts: 80
C
CyborAccess Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
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

Last edited by CyborAccess; 18/09/05 09:57 PM.
Re: dcc send script #130480 18/09/05 10:22 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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

Re: dcc send script #130481 18/09/05 10:39 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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

Re: dcc send script #130482 18/09/05 11:01 PM
Joined: Dec 2004
Posts: 80
C
CyborAccess Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
ok i want the no file access response too but cant it be like short too?


practice makes perfect... smile
Re: dcc send script #130483 18/09/05 11:33 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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.) }

Re: dcc send script #130484 19/09/05 12:46 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 }