View Single Post
Old 30th July 2005, 07:00   #285
Thunder Pussy
Feed me a stray dog
(Major Dude)
 
Join Date: Oct 2004
Posts: 1,122
Hi, still using ActiveWinamp to make some great playlists. I need a hand with this one that a friend help me with. What do I need to do to this script to make it insert the tracks after the currently playing file rather than enqueue them?

dim i,j,Dict1,keys,tracks,num,idxs
Set Dict1 = CreateObject("Scripting.dictionary")
Dict1.CompareMode = BinaryCompare
x = playlist.getselection()
mlq = medialibrary.runqueryarray("type = 0 AND lastplay isempty AND genre = """ + x(1).genre + """")
i = 0
for each track in mlq
Dict1(track.artist)=Dict1(track.artist) + ":" + CStr(i)
i = i + 1
next
Randomize
itms = Dict1.Items
num = 100
do while (tracks<num)
Rand = Int( (Dict1.Count-1) * Rnd)
idxs = Split(itms(Rand), ":", -1, 1)
Rand2 = CInt(idxs(Int(ubound(idxs)+1 * Rnd)))
mlq(Rand2).enqueue
tracks=tracks+1
Loop
quit


Thanks for helping,
M


p.s. Will version 2 include support for year? I hope so.
Thunder Pussy is offline   Reply With Quote