Public feed
#599091
/song {
set %chan $1
if ($1 == $null) set %chan #
if ($dll(WinAmpI.dll, IsRunning, 0) == false) {
msg %chan WinAmp isn't running!
halt
}
set %color1 15
set %color2 14
inc %count
set %state $dll(WinAmpI.dll, GetPlayState, 0)
set %song $dll(WinAmpI.dll, GetSong, 0)
set %poslen $dll(WinAmpI.dll, GetSongPosition, 0) $+ 12/ $+ $dll(WinAmpI.dll, GetSongLength, 0)
if ($dll(WinAmpI.dll, GetSongLength, 0) == unknown) {
set %track $dll(WinAmpI.dll, GetSongPosition, 0) $+ / $+ Unlimited (Radio)
tokenize 58 $dll(WinAmpI.dll, GetSongPosition, 0) | if ($3) { set %track $asctime($calc($2 * 60 + $3),hh:nn:ss) $+ / $+ Unlimited (Radio) }
}
elseif ($dll(WinAmpI.dll, GetSongLength, 0) !== unknown) {
set %track $dll(WinAmpI.dll, GetSongPosition, 0) $+ / $+ $dll(WinAmpI.dll, GetSongLength,0)
set %position $dll(WinAmpI.dll, GetSongPosition, 0)
tokenize 58 $dll(WinAmpI.dll, GetSongPosition, 0) | if ($3) { set %position $asctime($calc($2 * 60 + $3),hh:nn:ss) }
tokenize 58 $dll(WinAmpI.dll, GetSongLength, 0) | if ($3) { set %endtime $asctime($calc($2 * 60 + $3),hh:nn:ss) }
if (%endtime) { set %track %position $+ / $+ %endtime }
unset %position
unset %endtime
}
set %track $dll(WinAmpI.dll, GetSongNumber,0) $+ 12/ $+ $dll(WinAmpI.dll, GetSongCount,0)
set %bitrate $dll(WinAmpI.dll, GetBitRate, 0) $+ kbps
if (c isincs $gettok($chan(#).mode,1,32)) {
msg %chan «WinAmp: %state $+ » «Song: %song $+ » «Position/Length: %poslen $+ » «Track: %poslen $+ » «BitRate: %bitrate $+ »
halt
}
msg %chan 2Now Playing12: [ $+ %track $+ 12]2 %song 12(2 $+ %poslen $+ 12) (2Used12:2 %count $+ 12)
}