mIRC Home    About    Download    Register    News    Help

Print Thread
#61850 26/11/03 03:48 AM
A
alkahol1k
alkahol1k
A
hi i have this alias in my remotes and i was wondering if it can be made any better?

The way it is right now it seems a bit slow when I load my mp3s. Can anyone help ? I'll paste my script below :

alias mpeg.load {
%mpeg.l.total = $findfile(%mpeg.dir,*.mp3,0) | %mpeg.l.num = 0 | %mpeg.l.size = 0
:load
inc %mpeg.l.num 1 | if (%mpeg.l.num > %mpeg.l.total) { goto end }
else {
%mpeg.l.size = $calc($lof($findfile(%mpeg.dir,*.mp3,1)) + %mpeg.l.size)
goto load
}
:end
unset %mpeg.l.*
did -ra mpeg 4 dir: $+ $lower(%mpeg.dir)
set %mpeg.f.tot $findfile(%mpeg.dir,*.mp3,0)
unset %mpeg.f.inc
:grrr
inc %mpeg.f.inc
set %mpeg.f.file $findfile(%mpeg.dir,*.mp3,%mpeg.f.inc)
if (%mpeg.f.inc > %mpeg.f.tot) { goto done }
else {
set %mpeg.f.path $nofile(%mpeg.f.file)
did -a mpeg 1 $lower($remove($nopath(%mpeg.f.file),.mp3))
goto grrr
}
:done {
did -ra mpeg 10 tot: $+ $findfile(%mpeg.dir,*.mp3,0)
unset %mpeg.f.*
}
}

#61851 26/11/03 03:54 AM
A
alkahol1k
alkahol1k
A
someone on my server gave me this:

alias mpeg.load { var %i = $findfile(%mpeg.dir,*.mp3,0,did -a mpeg 1 $remove($lower($nopath($1-)),.mp3)) }

seems to work quite well smile

#61852 26/11/03 04:20 AM
Joined: Dec 2002
Posts: 1,893
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,893
The less times you call $findfile, the faster your script will be. Note that %i holds the total number of mp3s in that folder, allowing you to use /did -ra mpeg 10 tot: %i


Link Copied to Clipboard