|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
This is the method im using from my Dj Studio script i made I recently started to sort my actual folders instead of everything being togheter so now when I do happen to click on lets say Mp3 which has lick Rock,Trance etc... has folders inside it doesnt let me execute the mp3's this is my method of use
%dj.path = $$sdir(C:\,Select Mp3 dir) | noop $findfile($qt(%dj.path),*.mp3,0,did -a $dname 1 $nopath($1-)) then
.splay -p $+(%dj.path,$did(1).seltext)
I store the path then use $findfile to loop through the mp3 dir, which works on single dir access but not to a few dirs. I want no path in the list, i know if I would allow a path anything could be executed. To anyone that helps thanks ahead.
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Jul 2006
Posts: 4,222
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,222 |
This is because you using only the first path (%dj.path) and miss the real path when you put it in the list ($nopath) You have to change your method, one possibility could be to use a hidden list in the dialog and add the real filename : %dj.path = $$sdir(C:\,Select Mp3 dir) | noop $findfile($qt(%dj.path),*.mp3,0,did -a $dname 1 $nopath($1-) [ $chr(124) ] did -a $dname ID_Hidden_list $nofile($1-)) And then use : .splay -p $+($did(ID_Hidden_list,$did(1).seltext),$did(1).seltext)
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
The only thing that I'm able to think of, atm, is that the full path to the mp3 that you're trying to play doesn't match the path in your %dj.path variable. This would be the case if you had something like: %dj.path = C:\Music\Rock Full path & file "C:\Music\Rock\Billy Joel\Glass Houses\Track 2.mp3" Your file name that's added to the dialog will show as Track 2.mp3 So when you try to play it, mIRC tries to play C:\Music\Rock\Track 2.mp3 mIRC is still missing part of the path information. I can think of two ways around this. 1) Use %dj.path = $$sdir(C:\,Select Mp3 dir) | noop $findfile($qt(%dj.path),*.mp3,0,0,did -a $dname 1 $nopath($1-)) Not my recommendation, as this will only perform the $findfile for that specific directory, and not any sub-directories that may be present. Meaning that you'd have to re-run the code for each sub-directory, and only having the information for 1 directory level at a time. 2) Add another list box to your dialog, the same size and location as your list ID 1, but have it hidden, and store the full path and title in the 2nd list, then when selecting an item in ID 1, auto-select that same line in the 2nd list, and use that for your /splay command This is the one I recommend, as it will allow you to use multiple sub-directories off of your main mp3 directory, without having to run the code for the specific directory each time.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
|
|
|
|
Joined: Jul 2006
Posts: 4,222
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,222 |
Thanks  . starbucks_mafia, i've seen your post, but i think use an hash table here isn't needed
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
starbucks_mafia, i've seen your post, but i think use an hash table here isn't needed I don't see a post by starbucks_mafia or anyone in regards to using a hash table for this topic...although, I do agree it's not needed...actually, I think it would be a waste for this.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
I just got back, ill try what you said wims, and RUsselB the second theory is better just like wims posted
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Yes, I thought you would agree with that. I just wanted to try to make sure that you had all of the possibilities accounted for. If you're going to go with the code that wims posted, please note that there is a small error in .splay -p $+($did(ID_Hidden_list,$did(1).seltext),$did(1).seltext) It should be .splay -p $+($did(ID_Hidden_list,$did(1).sel),$did(1).seltext) otherwise you're going to get an incorrect response, since $did is going to be looking for a number in that location, not a string, so the string returned will be evaluated as 0
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
spotted it in a few seconds, when I had original did the string, as for dialog stuff I play in it all the time I know all the functions etc..
I remember back in the day when i didnt even know how to start making the "GUI" part of a dialog lol.
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
|