mIRC Homepage
Posted By: Jaillynian troubleshooting mp3 script - 03/11/12 04:14 PM
I have an mp3 script I've had for a long time.. it's gone through a lot of edits throughout the time since.. well it used to have more to it than it does now (I lost the original version long ago...)

I have a minor issue with the script since I have it set to a specific folder for my music.. which has subfolders.. and sometimes my script opens up on the 'last used folder' instead of the main folder, where I want it to open.

===


alias selectsong {
%File = $dir="Select a Media File" %Music
if (%file == $null) { halt }
else run %File
}


==

That is the part specifically giving me issues.
Posted By: Deega Re: troubleshooting mp3 script - 07/11/12 05:02 PM
Try using this
Code:
alias selectsong {
  var %dir = C:\Music\*.mp3
  run $$sfile(%dir,Select a file,Play)
}

Obviously, change C:\Music\*.mp3 to your own music folder
Posted By: Jaillynian Re: troubleshooting mp3 script - 09/11/12 03:13 AM
thanks. I didn't use what you posted 100%, but the $$file string fixed it!
Posted By: Jaillynian Re: troubleshooting mp3 script - 17/12/12 03:32 PM
I called for celebration too soon. It seems to still be forgetting where the music folder is set.
Code:
alias selectsong {
  set %musdir %Music
  %File = $$sfile(%musdir,Select File,OK)
  if (%file == $null) { halt } 
  else { run %File | messagera | unset %File }
}

---

trying "var" did nothing for some reason.. so I tried to use set

now, the variable does set to my music folder, which is specified in %Music

but when I open my script it goes to where I last picked a folder (such as a subfolder)

I'm really puzzled why it's ignoring the music directory specified. If I unload and reload the script, it fixes the issue.. but only temporarily.

Edit: I Also tried making it where it unsets %file in case the old %file info was messing things up. seems to not be the case. I don't have any other script dealing with folders, really.. so I'm not sure why it's 'soft saving' a folder.

Edit 2: To clarify, %Music is C:\Users\jsd\Music\*.mp3
Posted By: Jaillynian Re: troubleshooting mp3 script - 31/12/12 07:23 PM
Ah well. Time to scrap it I guess!
Posted By: Riamus2 Re: troubleshooting mp3 script - 31/12/12 09:10 PM
What happens if you echo %Music from that alias? Just to make sure it's really what you think it is. My guess is that you're setting %Music somewhere to something else. By echoing the variable, you can see if it's something other than what you expect. If so, you need to look at a different part of the script because you're not setting %Music in this alias.
Posted By: Jaillynian Re: troubleshooting mp3 script - 31/12/12 10:32 PM
It came back with the music folder I set when I //echo it.

and no, I'm not setting %music in that snippet there. I have a dialog box set for that, but that shouldn't be conflicting with calling up %Music at all.

the dialog box sets %music and the %musdir was an attempt to make it go 'oh right %music is set to so and so.

so far that's a fail. smirk it just forgets what I have set and it goes to the folder I last chose a song from (A subfolder, to be specific). it stops opening the proper folder entirely.

if I unload and reload the script, that fixes the issue.. but it shouldn't be doing that in the first place.
© mIRC Discussion Forums