rendered paste bodyon *:load:{
echo -a [·] [Plux MP3 Script v1.23] has been loaded.
echo -a [·] $dll(pluxmp3.dll,version,_)
echo -a [·] Press [F4] to display MP3 currently playing in Winamp
}
menu channel,query {
-
Display MP3:saymp3
Show NFO:shownfo
}
menu nicklist {
-
Send MP3:var %songfile " $+ $dll(pluxmp3.dll,filename,_) $+ " | dcc send $$1 %songfile
}
menu query {
-
Send MP3:var %songfile " $+ $dll(pluxmp3.dll,filename,_) $+ " | dcc send $$1 %songfile
}
alias f4 saymp3
alias shownfo {
if ($findfile($nofile($dll(pluxmp3.dll,filename,_)),*.nfo,1,1)) {
run $findfile($nofile($dll(pluxmp3.dll,filename,_)),*.nfo,1,1)
}
else {
if ( $input(No NFO file was found in this directory,o,OMFG!!1 Error!!!!!!1) ) { }
}
}
alias cue2ms {
return $calc($gettok($1,1,58)*60000+$gettok($1,2,58)*1000)
}
alias readcue {
var %songpos $1
var %songfile $dll(pluxmp3.dll,filename,_)
var %songfile $shortfn(%songfile)
var %cuefile $left(%songfile,- $+ $len($gettok(%songfile,-1,46))) $+ cue
var %pos 0
var %artist 0
var %title 0
var %prevtitle 0
var %prevartist 0
if $fopen(cue) { .fclose cue }
var %i = $findfile($nofile(%songfile),*.cue,0,1)
if (!$exists(%cuefile)) {
var %cuefile = $findfile($nofile(%songfile),$left($nopath(%songfile),3) $+ *.cue,1,1)
if (!$exists(%cuefile)) {
return $nopath($dll(pluxmp3.dll,filename,_))
}
}
if (!$exists(%cuefile)) { return $nopath($dll(pluxmp3.dll,filename,_)) }
.fopen cue %cuefile
var %track 0
var %titlecount 0
var %artistcount 0
if ($fopen(cue).err) { return $nopath($dll(pluxmp3.dll,filename,_)) }
while (!$fopen(cue).eof && !$fopen(cue).err) {
var %cueline $fread(cue)
if (INDEX = $gettok(%cueline,1,32)) {
var %pos = $cue2ms($gettok(%cueline,-1,32))
if (%pos >= %songpos) {
.fclose cue
var %track = $calc( %track - 2)
return %track $+ . %prevartist - %prevtitle
}
}
elseif ( TITLE = $gettok(%cueline,1,32)) {
inc %titlecount
if (%titlecount == %artistcount) { inc %track }
var %prevtitle %title
var %title = $remove(%cueline,TITLE,")
}
elseif ( PERFORMER isin $gettok(%cueline,1,32)) {
inc %artistcount
if (%titlecount == %artistcount) { inc %track }
var %prevartist %artist
var %artist = $remove(%cueline,PERFORMER,")
}
}
.fclose cue
dec %track
return %track $+ . %artist - %title
}
alias saymp3 {
var %songfile $dll(pluxmp3.dll,filename,_)
; filename and path of the song (ex: c:\dir\song.mp3)
var %songlength $dll(pluxmp3.dll,length,_)
; length of the song (ex: 05:23)
var %song $dll(pluxmp3.dll,title,_)
; title of the song (ex: Artist - Title)
var %songbitrate $dll(pluxmp3.dll,bitrate,_)
; bitrate of the song (ex: 192)
var %songtype $gettok(%songfile,-1,46)
; filetype of the song (ex: mp3)
var %pos $dll(pluxmp3.dll,position,_)
; position of the song in ms
if (%songlength != -1) {
if ($left(%songfile,7) == http://) {
/say [stream]·[ $+ $right(%songfile,$calc($len(%songfile)-7)) $+ ]·[ $+ %song $+ ]·[ $+ %songbitrate $+ kbps]
}
elseif (%songtype == sid || %songtype == xm || %songtype == mod || %songtype == dat || %songtype == cda) {
/say 4[ n1k0 $+ %songtype $+ ]·4[ $+ %song $+ 4]·4[ $+ %songlength $+ ]·[ $+ %songbitrate $+ kbps $+ ] ]
}
else {
if ($exists($findfile($nofile(%songfile),*.cue,1,1))) {
var %song = $readcue(%pos)
}
else {
var %song = $left($nopath(%songfile),$calc($len($nopath(%songfile))-$len(%songtype)-1))
}
if (cd? iswm $gettok(%songfile,-2,92)) {
/say 4[ $+ %songtype $+ ]·[ $+ $gettok(%songfile,-3,92) $+ ]·[ $+ %song $+ ]·[ $+ %songlength $+ ]·[ $+ %songbitrate $+ kbps]
}
else {
/say [ $+ %songtype $+ ]·[ $+ $gettok(%songfile,-2,92) $+ ]·[ $+ %song $+ ]·[ $+ %songlength $+ ]·[ $+ %songbitrate $+ kbps]
}
}
}
else {
echo -a [·] Winamp Not Found
}
}