{ SENDLONG Pirch Script, version 2.0 by MarkRH of ChatNet's #MIDI channel For use as an auto sender for sounds. Searches subdirectories and handles the sending of long filenames which contain spaces that foil the default Pirch SENDSND.PIL script. If you wish to send me email, you can send it to: headrick@ionet.net =================================================== REQUIRED EVENTS (in this order): ON NOTICE:*!TSEND*:*:/runscript [SENDLONG] $nick tsend *2 ON NOTICE:!DCCSEND*:*:/runscript [SENDLONG] $nick dccsend *2 ON TEXT:!Yournick*:*:/runscript [SENDLONG] $nick dccsend *2 ON NOTICE:!Yournick*:*:/runscript [SENDLONG] $nick dccsend *2 ------- You must use *2 so that long file names with spaces are handled correctly. =================================================== NOTE: Windows 3.X users will still be able to use this script. Also, due to a bug in Pirch 0.87's implementation of DCC TSEND, this script does do a version. If it's not running in version 0.90+ for Windows 95/NT, then it will do everything via normal DCC SEND. Also, I have left several writeln commands in the script that are commented out. You can uncomment these to see what's going on with the script in your server window. } $nick := $1; $method := $2; { either 'tsend' or 'dccsend' } $filename := *3; { writeln('SENDLONG Script output:'); } { First, determine the Pirch Version } { writeln('Version string: ', $version); } index := strpos('0.9', $version); if (index = 0) then pirch := 87 else pirch := 90; { At this point, we need to isolate the actual filename by parsing the string from the beginning } $filename := strlower($filename); { writeln('filename at start = ',$filename); } len := strlen($filename); index := strpos('.mid', $filename); if (index = 0) then index := strpos('.rmi', $filename); if (index = 0) then index := strpos('.wav', $filename); if (index <> (len - 3)) then begin index := index + 4; { writeln('Index = ', index); } strdel($filename, index, len); { writeln('filename after = ', $filename); } end { The filename has been isolated, now search for its location in the sound path and DCC it to the user } $fullname := whereis($filename,$soundpath); if ($fullname <> '') then begin if (($method = 'tsend') and (pirch = 90)) then begin { The Tsend method was request and the scipt is running in version 0.90+ of Pirch, so we are safe } command('/dcc tsend ',$nick,' ',$fullname); writeln('Using the Tsend method'); end else command('/dcc send ',$nick,' ',$fullname); end else begin writeln($filename, ' requested by ', $nick, ' not found'); command('/notice ', $nick, ' sorry, but ', $filename, ' does not seem to exist.'); end