mIRC Homepage
Posted By: Insane faster $findfile? - 16/12/02 12:40 PM
alias mp3f {
var %t = $findfile(D:\,*.mp3,0)
while (%t > 0) {
write D:\found.txt $findfile(D:\,*.mp3,%t)
dec %t
}
echo -st Finished!
}

With this script i want to make a list of all mp3s on D:\ partition, but...well, here comes my question, because $findfile here is incredibly slow and making list with it would take ages, any1 knows faster way?
Posted By: Merlin Re: faster $findfile? - 16/12/02 12:48 PM
Three possible solutions:

  • Replace line 4 of your script by: $findfile(D:\,*.mp3,%t,write -a d:\found.txt)
  • You can use a DLL - you may search here
  • you can start a second mIRC and start the script there (prevents freezing of your actual mIRC)


Posted By: Insane Re: faster $findfile? - 16/12/02 12:53 PM
* /d:\mp3z\upload\toto: not connected to server (line 4, script18.ini)

that's what happens when i replace the fourth line wink
ok i'll search for dlls, but i was just wondering if mirc has faster method, thanks for the reply.
Posted By: Online Re: faster $findfile? - 16/12/02 01:14 PM
Multiple /write is slow... just put everything within a hidden @window and use /savebuf to save it to a file...
Code:
/window -h @z
//!.echo -q $findfile(d:\,*,0,@z)
/savebuf @z d:\found.txt
/window -c @z

The above code should work perfectly. but, since merlin mentioned a way to avoid freezing of your mIRC, you can use qwerty's perfect solution for that:
Code:
var %a = files $+ $ticks
.comopen %a WScript.Shell
if !$comerr { .comclose %a $com(%a,Run,3,bstr,command /c dir d:\ /a /s /b > d:\found.txt,uint,0,bool,true) }

Posted By: Cassius Re: faster $findfile? - 16/12/02 07:53 PM
why the //!.echo ???

just unclear why the ! is there.

cool
Posted By: Online Re: faster $findfile? - 16/12/02 07:59 PM
that bypasses any existing /echo alias, if any.
Posted By: Frog Re: faster $findfile? - 16/12/02 11:40 PM
Quote:
you can start a second mIRC and start the script there (prevents freezing of your actual mIRC)


You could use DDE for that. Send the commands to the 2nd mIRC, have it send the results to you, then close the 2nd mIRC if need be.

But, it sounds like Qwerty's COM solution to this would work *a lot* better.
Posted By: Insane Re: faster $findfile? - 17/12/02 01:29 PM
Well..thank you all for help, preety fast method is using com objects, but i don't get it,in the end i use /run cmd.exe dir params here > file.txt , that feets my needs, thanks once again :-)
Posted By: Online Re: faster $findfile? - 17/12/02 01:46 PM
yeah, the com script also makes use if the dir command, but there's a little difference though.

as you might have been noticed, the com object waits for the dir command to return, while /run doesn't. anyway, both ways work. choose your preferred
© mIRC Discussion Forums