mIRC Homepage
Posted By: sparta splay - 10/10/04 03:38 PM
If i use splay, then i pause the curent song playing, how can i identify that a song is paused ? $insong return $true if a file is playing, same if its paused, any identifyer that return a value if the file is set on pause ?
Posted By: starbucks_mafia Re: splay - 10/10/04 03:47 PM
As of v6.16 you can use $insong.pause.
Posted By: sparta Re: splay - 10/10/04 04:23 PM
I got that to work.. now to another problem.. i have this line:
Code:
.splay $read(" $+ $mircdir/mp3list.txt $+ ",$did(playlist,1).sel)

and it works just fine. but if the mp3 have the name: '05 file.mp3' then i got an error that the file arent in the mp3 dir.. but it is, so i guess it have problems read the space in the mp3 name, if the mp3 is named '05_file.mp3' it works just fine.. :tongue: by the way, this is my own mp3's, nothing i DL'd from the net wink
Posted By: starbucks_mafia Re: splay - 10/10/04 04:37 PM
.splay [color:red]$+(",$read(mp3list.txt, t, $did(playlist,1).sel),")[/color]

The bit I've added is in red. You need quotes around the filename when used in commands but not for identifiers (although they won't cause any harm if you use them anyway), which is why I removed them from inside the call to $read().

Edit: Added t parameter. Good point tidy_trax wink
Posted By: tidy_trax Re: splay - 10/10/04 04:38 PM
Try this:

Code:
.splay [color:red]$shortfn([/color]$read(mp3list.txt,[color:red]t,[/color]$did(playlist,1).sel)[color:red])[/color]
Posted By: sparta Re: splay - 10/10/04 04:44 PM
none of the codes work.. :tongue:

------------- edit

maybe its cos i have it placed in $mircdir/files/mp3list.txt

but i changed that path in both codes, still no luck, it says
* /splay: no such file 'path' path to the file have space in it..
and i using mirc v:6.03 .. so i must have " $+ - $+ " mustent i ? :tongue:

here's the name of the file:
05 Outkast - Roses.mp3

02 - Scissor Sisters - Take Your Mama Out.mp3 <<-- that one works just fine tho.. so where can the problem be ? i placed them in the same path..

BAH, it was dubble spaces in the name.. where can i find that snipet ? somone that know? confused
Posted By: tidy_trax Re: splay - 10/10/04 04:50 PM
Maybe there are multiple spaces in the filename? Andy^ made a small snippet that lets you handle multiple spaces in the filename, but I can't remember where I saw it.

Edit: it's on this comment list, but there are 40+ pages, so it might take a while to find wink
Posted By: qwerty Re: splay - 10/10/04 05:31 PM
I was wondering, why is the t switch necessary here? The only reason I can think of is a file called "15" (no extension) or something similar, but I would think that mp3list.txt would only contain filenames ending in ".mp3". If anything, I would use the n switch, to catch cases like "$weird title %with weird chars.mp3".
Posted By: starbucks_mafia Re: splay - 10/10/04 05:42 PM
I think I'm going senile. When I made the edit I was confusing the n and t switches. Now that I think about it I'd use both.
Posted By: tidy_trax Re: splay - 10/10/04 05:53 PM
Heh, I misunderstood the help file, I thought it meant that if the first line contained a number it would not be treated as plain text, thanks.
Posted By: sparta Re: splay - 10/10/04 06:02 PM
I found it.. but have no clue on how to implant it to my code confused
Code:
alias -l fn {
if (* iswm $1) {
var %r = " $+ $replace($1-,$chr(32),?,\?,\:,??,*,?,$chr(32),*,*?,*,$chr(32),\:,\?)
if (" * iswm %r) return ? $+ $right(%r,-2)
return $right(%r,-1)
}
}
alias -l sfn return $shortfn($replace($1-,?,$chr(32)))

if i try implant it nothing will work.. any help would be great.. :tongue:
Posted By: tidy_trax Re: splay - 10/10/04 06:11 PM
/splay $sfn($read(mp3list.txt,nt,$did(playlist,1).sel))
Posted By: sparta Re: splay - 10/10/04 06:21 PM
nope, same result with that line, all mp3's work but not the one with two space's.. :tongue:
Posted By: tidy_trax Re: splay - 10/10/04 06:27 PM
Does the line have double spaces in the file? If not, then the way you are listing files is the problem, not the way you're playing them.

Edit: the /splay that I gave you was wrong, it should be:
Code:
splay $sfn([color:red]$fn([/color]$read(mp3list.txt,nt,$did(playlist,1).sel)[color:red])[/color])
Posted By: sparta Re: splay - 10/10/04 06:29 PM
hmm, found the problem, the file are in the txt file with single space, so thats where the problem start, not at play.. :tongue:

write " $+ $mircdirgxfiles/mp3list.txt $+ " $findfile(%mp3dir,*.mp3,%x)

and the same there, dont know where to put: $sfn

i tryed a fev places, but get totaly f*ed up output in the txt file.. :tongue:
Posted By: tidy_trax Re: splay - 10/10/04 06:37 PM
To list the mp3s, use:

Code:
.echo -q $findfile(%mp3dir,*.mp3,0,write gxfiles\mp3list.txt $fn($1-))


Then to play them:

Code:
splay $sfn($read(gxfiles\mp3list.txt,nt,$did(playlist,1).sel))
Posted By: sparta Re: splay - 10/10/04 06:55 PM
didnt work, it added ? to some of the files.. i guess i give up this one.. :tongue:
Posted By: tidy_trax Re: splay - 10/10/04 06:58 PM
The fn and sfn aliases are in the same file as the code that plays and lists the files right? They can only be called from inside that file unless you remove the "-l" from the alias declerations.
Posted By: sparta Re: splay - 10/10/04 07:11 PM
they are in the same file, i also tested by remove the -l switch.. so if its local or not didnt mather :tongue:
Posted By: tidy_trax Re: splay - 10/10/04 07:19 PM
I'm all out of ideas then, sorry.
Posted By: sparta Re: splay - 10/10/04 07:51 PM
do you know how to $calc the length of a file ? the path to the file is set in a %var ..

$calc($sound(%mp3file).length / 1000))

return: 210.176

and it should return: 3.30 .. sorry i ask so much, but the only way to learn wink

Posted By: tidy_trax Re: splay - 10/10/04 07:59 PM
Code:
[color:red]$gmt([/color]$calc($sound(%mp3file).length / 1000)[color:red],n.ss)[/color]
Posted By: sparta Re: splay - 10/10/04 08:04 PM
thnx!! i must ask, where have you lernt all this ? the mirc.hlp only cover like 2% of everything..
Posted By: tidy_trax Re: splay - 10/10/04 08:25 PM
I learnt a lot from mIRC.hlp, but I learnt the most by reading/asking questions on this forum.

mIRC.hlp has almost everything, it just doesn't show you how to use the scripts in useful/relevant examples.

For example, it tells you what $gmt does, but it doesn't tell you what it could be used to make.
Posted By: sparta Re: splay - 10/10/04 08:47 PM
size is one i dont understand..

$file(mirc.exe).size

return the size in bytes yes.. but if i do a $calc on that..

$calc($file(mirc.exe).size / 1000)

then i get allot of numbers.. wink but how should somone like me understand how to get the value set in as an example meg ? and thats why i say mirc.hlp only cover maybe 2% of everything.. cos no one could use the commands as they are explained, or atlest i cant. and many with me, it should include a working snippet or somthing.. cos u cant find it on the net.. :tongue: i have been looking for just that.. the $calc thingie
Posted By: tidy_trax Re: splay - 10/10/04 08:53 PM
mIRC.hlp does have most things you want, you just have to look for them, eg, in your example: $bytes() is what you're after: $bytes($file($mircexe)).suf
© mIRC Discussion Forums