The while loop is to wait a tiny amount of time before checking if $insong.pos is the same as %pos, if it's the same, the song is paused, otherwise it's playing, without the while loop, it will just return "pause" regardless of whether the song is paused or not.
Edit:
Try both of the following:
alias songstatus {
if !$insong { return stopped }
var %i = 1, %pos = $insong.pos
;while %i <= 100 { inc %i }
return $iif(%pos == $insong.pos,paused,playing)
}
The above returns "paused" when a song is playing.
alias songstatus {
if !$insong { return stopped }
var %i = 1, %pos = $insong.pos
while %i <= 100 { inc %i }
return $iif(%pos == $insong.pos,paused,playing)
}
The above returns "playing" when a song is playing.
Last edited by tidy_trax; 24/06/04 03:09 PM.