alias contplay {
if !$1 {
[color:green]; If the command was simply "contplay" or "contplay 0", the above is $true, and we set the directory[/color]
var %a = $rand(1,4)
if %a == 1 { set %p3dir c:\documents and settings\desktop\skynyrd tunes\ }
if %a == 2 { set %p3dir c:\documents and settings\desktop\motown\ }
if %a == 3 { set %p3dir c:\documents and settings\desktop\tunes\ }
if %a == 4 { set %p3dir c:\documents and settings\desktop\alternative\ } }
}
[color:green]; else we have jumped to here
; $r(N,N) is a shortened version of $rand(N,N)
; next line is the same except the /run -np 'filename' is moved into the $findfile()[/color]
var %b = $findfile(%p3dir,*.mp3,$r(1,$findfile(%p3dir,*.mp3,0)),run -np $1-)
[color:green]; next line is the same except using $+() instead of bulk "$+" ;s and "$chr()" 's[/color]
msg $active $+(1[,$r(1,7),Continuous-Play1] [,$base($r(1,7),10,10,2),$nopath(%b),1])
[color:green]; next we will set the timer to repeat
; adding the iteration; eg contplay 1, 2, 3,.., 9, 0
; $calc(($1 +1) % 10) = $null/0 add 1 and then % (modulo) 10, to result in
; 1 2 3 4 5 6 7 8 9 and finally, 9 + 1 % 10 = 0 again, so the dir will be reset[/color]
.timersong 1 $calc($sound(%b).length / 1000) contplay $calc(($1 + 1) % 10)
}