mIRC Home    About    Download    Register    News    Help

Print Thread
#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?

#2036 16/12/02 12:48 PM
Joined: Dec 2002
Posts: 164
M
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
#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.

#2038 16/12/02 01:14 PM
Joined: Dec 2002
Posts: 1,922
O
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) }


#2039 16/12/02 07:53 PM
Joined: Dec 2002
Posts: 20
C
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."
#2040 16/12/02 07:59 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
that bypasses any existing /echo alias, if any.

#2041 16/12/02 11:40 PM
Joined: Dec 2002
Posts: 111
F
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?
#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 :-)

#2043 17/12/02 01:46 PM
Joined: Dec 2002
Posts: 1,922
O
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


Link Copied to Clipboard