|
pheonix
|
pheonix
|
alias getmp3 {
var %mp3.dir C:\Documents and Settings\MAT\My Documents\mats folder\My Music\
$findfile(%mp3.dir,$+(*,$1,*,.mp3),0,echo -a $nopath($1-))
}
i type: /getmp3 tidy it returns: tidy boys - bits and pieces.mp3 tidy boys - chainsaw.mp3 tidy boys - cant top it.mp3 tidy boys - colours.mp3 tidy boys - devotion.mp3 tidy boys vs tidy girls - blow ya load.mp3 tidy boys - dance 2 the house.mp3 - * /7: not connected to server (line 7, script.ini) line 7 = $findfile line (this last line does not allow me to make a while loop for such a situation which is what i need it for)
|
|
|
|
codemastr
|
codemastr
|
Thats because $findfile returns a value. You have to store the value somewhere, or do something with it.
alias getmp3 { var %mp3.dir C:\Documents and Settings\MAT\My Documents\mats folder\My Music\ .echo -q $findfile(%mp3.dir,$+(*,$1,*,.mp3),0,echo -a $nopath($1-)) }
|
|
|
|
pheonix
|
pheonix
|
i know that but i dont see why it returns 7 at all....
|
|
|
|
codemastr
|
codemastr
|
Because it returns the number of files matched. lets do some counting, shall we?
tidy boys - bits and pieces.mp3 -1 tidy boys - chainsaw.mp3 - 2 tidy boys - cant top it.mp3 - 3 tidy boys - colours.mp3 - 4 tidy boys - devotion.mp3 - 5 tidy boys vs tidy girls - blow ya load.mp3 - 6 tidy boys - dance 2 the house.mp3 - 7
7, 7 matched files. I don't see why that is so hard to grasp.
|
|
|
|
pheonix
|
pheonix
|
i also noticed that but shouldnt it have a switch or something........
|
|
|
|
Joined: Dec 2002
Posts: 3,015
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,015 |
alias getmp3 {
var %mp3.dir C:\Documents and Settings\MAT\My Documents\mats folder\My Music\
.echo -q $findfile(%mp3.dir,$+(*,$1,*,.mp3),0,echo -a $nopath($1-))
}
|
|
|
|
pheonix
|
pheonix
|
now it echos a 7 on the last line anyway....
|
|
|
|
Joined: Dec 2002
Posts: 3,015
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,015 |
If it echo's a 7 then you either have an echo alias or have copied it wrong, probably by accidentally removing the . in the .echo command. Many scripts use the exact same way of doing things, which is why it was mentioned in this Feature Suggestion. Edit: I also just noticed that codemastr posted the exact same script..
|
|
|
|
pheonix
|
pheonix
|
i copied and pasted codemastr's which echo's 7 at the end. wont .echo -q make it wait till after the findfile command then echo the number of matches
|
|
|
|
Joined: Dec 2002
Posts: 2,884
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,884 |
alias getmp3 {
var %mp3.dir = C:\Documents and Settings\MAT\My Documents\mats folder\My Music\
.!echo -q $findfile(%mp3.dir,$+(*,$1,*,.mp3),0,echo -a $nopath($1-))
} There is no way in hell that that alias will echo the number of matches. The -q switch means that the /echo will be silent (won't echo) if there's a . prefixed before it. The ! is there to make sure it uses the built-in /echo and not any aliases for /echo you might have. If that echoes the number of matches then you're either doing something very wrong or your computer has issues.
|
|
|
|
pheonix
|
pheonix
|
just like i said, i pasted it exactly......
|
|
|
|
Joined: Dec 2002
Posts: 2,884
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,884 |
If you pasted my exact code, fixed the newlines (sometimes when you paste it will be put all on one line), and you're still getting the number of matches then there's something very wrong. It's possible you've got another alias by the same name, so use the search feature to check that isn't the case. Otherwise... all I can recommend is that you reinstall mIRC. There's nothing else I can do to help.
|
|
|
|
pheonix
|
pheonix
|
if you noticed my posts in scripts n popups you would notice i quit mirc, so therefore ive only just reinstalled and this is my only file loaded.
|
|
|
|
Joined: Dec 2002
Posts: 3,015
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,015 |
Then apparantly it works for everyone but you, since the same method is used for hundreds of scripts (many very popular ones).
Remove the alias and type //echo -a $isalias(getmp3), perhaps you have an old version of the alias still loaded?
|
|
|
|
pheonix
|
pheonix
|
nope i have 1 file loaded, with 2 aliases, the other is to loop through using /getmp3 so i can use it like /listmp3 a t f which would do: /getmp3 a,/getmp3 t,/getmp3 f. fixed it now.
Last edited by pheonix; 04/08/03 04:32 PM.
|
|
|
|
|