mIRC Homepage
Posted By: very_confused random mp3 - 30/06/03 05:11 PM
ok i got the following script from kingtomato but how can i shuffle all the songs to play one after the other

Code:
 on *:MP3END: { /splay %repeat }

menu channel {
  My MP3s
  .Song - $iif($insong, $nopath($insong.fname), Nothing at all!!! ) : /halt
  .Position - $mp3pos :/halt
  .-
  .Continuous Play: .set %repeat $insong.fname
  .Stop Continuous Play: .unset %repeat
  .Spam: /msg $chan 7 $me 9is playing7  $nopath($insong.fname)  9 with a duration of7  $mp3time using 11m42@77§ 11þ42|å¥Ë®r
  .Stop Playing: /splay stop
  .Pause Song: /splay pause
  .Resume Playing: /splay resume
  .-
  .$submenu($mp3list($$1)) 


}

alias mp3list {
  var %mp3dir = $shortfn(C:\my shared folder\)
  if ($$1 == begin) return -
  else if ($$1 == end) return -
  else if ($findfile(%mp3dir, *.mp3, $$1, 0)) return $nopath($ifmatch) : /splay -p $ifmatch 

}

alias mp3pos {
  var %barlength = 15
  if ($insong) {
    var %length = $sound($insong.fname).length, %pos = $insong.pos, %left = $int($calc((%pos / %length) * %barlength))
    var %pos = $remove($replace($duration($calc($insong.pos / 1000)), mins, m, min, m, secs, s, sec, s), $chr(32))
    var %len = $remove($replace($duration($calc($sound($insong.fname).length / 1000)), mins, m, min, m, secs, s, sec, s), $chr(32))
    var %time = ( $+ %pos $+ / $+ %len $+ )
  }
  else var %left = 0
  return [[ $+ $str($chr(124), %left) $+ $str(-, $calc(%barlength - %left)) $+ ]] %time
}


alias mp3time {
  var %barlength = 15
  if ($insong) {
    var %length = $sound($insong.fname).length, %pos = $insong.pos, %left = $int($calc((%pos / %length) * %barlength))
    var %pos = $remove($replace($duration($calc($insong.pos / 1000)), mins, m, min, m, secs, s, sec, s), $chr(32))
    var %len = $remove($replace($duration($calc($sound($insong.fname).length / 1000)), mins, m, min, m, secs, s, sec, s), $chr(32))
    var %time = ( $+ %len $+ )
  }
  else var %left = 0
  return %time
}
 

Posted By: pheonix Re: random mp3 - 30/06/03 05:15 PM
.Shuffle: $findfile(%mp3dir,*.mp3,$r(1,$findfile(%mp3dir,*.mp3,0)),/splay $1-)

on *:MP3END:{
$findfile(%mp3dir,*.mp3,$r(1,$findfile(%mp3dir,*.mp3,0)),/splay $1-)
}
Posted By: very_confused Re: random mp3 - 30/06/03 05:23 PM
thx
Posted By: pheonix Re: random mp3 - 01/07/03 08:15 AM
np smile
© mIRC Discussion Forums