|
Joined: Dec 2002
Posts: 12
Pikka bird
|
OP
Pikka bird
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?
|
|
|
|
Joined: Dec 2002
Posts: 164
Vogon poet
|
Vogon poet
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
|
|
|
|
Joined: Dec 2002
Posts: 12
Pikka bird
|
OP
Pikka bird
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  ok i'll search for dlls, but i was just wondering if mirc has faster method, thanks for the reply.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
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... /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: 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) }
|
|
|
|
Joined: Dec 2002
Posts: 20
Ameglian cow
|
Ameglian cow
Joined: Dec 2002
Posts: 20 |
why the //!.echo ??? just unclear why the ! is there.
"Illegitimati non Carborundum" -> "Don't let the bastards grind you down."
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
that bypasses any existing /echo alias, if any.
|
|
|
|
Joined: Dec 2002
Posts: 111
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 111 |
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?
|
|
|
|
Joined: Dec 2002
Posts: 12
Pikka bird
|
OP
Pikka bird
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 :-)
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
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
|
|
|
|
|