And here the another version for rating that work.
$if($or(%skip%,$greater($mod($cwb_rand(),100),$if(%rating%,$mul(%rating%,20),50))),1,0)
1 star = 20% to pick the track.
If there is SKIP tag present, it will always skip that track.
The bold number is the probability rate in % for track that don't have rating. Change to 0 will make it skip all track that don't have rating.
your script doesn't work. nor do mine, which i made editing yours.
$ifgreater(
$mod($cwb_rand(),100),
$if(%RATING%,
$ifequal(%RATING%,0,50,
$ifequal(%RATING%,9,0,
$mul(%RATING%,20)
)
),
50),
1,0)
or
$ifgreater($mod($cwb_rand(),100),$if(%RATING%,$ifequal(%RATING%,0,50,$ifequal(%RATING%,9,0,$mul(%RATING%,20))),50),1,0)
i use rating from 0 to 6, plus a rating of 9 for double tracks or not-song-tracks, wich is related to a special mark. i don't use the %skip% tag. i want tracks rated 0 to be treated as unmarked, and the tracks rated 9 to be skipped.
something doesn't work in this script.. can you spot any error?
EDIT
i think that the result of $mod($cwb_rand(),100), is too low. which is the interval in wich cwb_rand generates the numbers?
EDIT2
it seems that $cwb_rand() and $rand don't work. i've installed cwb_hooks