mIRC Home    About    Download    Register    News    Help

Print Thread
faster $findfile? #2035 16/12/02 12:40 PM
Joined: Dec 2002
Posts: 12
I
Insane Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Dec 2002
Posts: 12
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?

Re: faster $findfile? #2036 16/12/02 12:48 PM
Joined: Dec 2002
Posts: 164
M
Merlin Offline
Vogon poet
Offline
Vogon poet
M
Joined: Dec 2002
Posts: 164
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)




DALnet: #HelpDesk, #mIRC, #MISHScript - Undernet: #mIRC, #mIRC-Scripts
Re: faster $findfile? #2037 16/12/02 12:53 PM
Joined: Dec 2002
Posts: 12
I
Insane Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Dec 2002
Posts: 12
* /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.

Re: faster $findfile? #2038 16/12/02 01:14 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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) }


Re: faster $findfile? #2039 16/12/02 07:53 PM
Joined: Dec 2002
Posts: 20
C
Cassius Offline
Ameglian cow
Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 20
why the //!.echo ???

just unclear why the ! is there.

cool


"Illegitimati non Carborundum" -> "Don't let the bastards grind you down."
Re: faster $findfile? #2040 16/12/02 07:59 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
that bypasses any existing /echo alias, if any.

Re: faster $findfile? #2041 16/12/02 11:40 PM
Joined: Dec 2002
Posts: 111
F
Frog Offline
Vogon poet
Offline
Vogon poet
F
Joined: Dec 2002
Posts: 111
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.


Experience The Void.. Are You Ready?
Re: faster $findfile? #2042 17/12/02 01:29 PM
Joined: Dec 2002
Posts: 12
I
Insane Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Dec 2002
Posts: 12
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 :-)

Re: faster $findfile? #2043 17/12/02 01:46 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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