tunez
Posted by Sky
Tuesday, November 14, 2006
Description: mp3 player for mIRC
;-credits to colby for tons of ideas, and some help. and to rick for beta testing.
;-should support all formats splay does, if you have a problem playing something its probably the file.
;-read this
;-what this bitch can do
;-rand/continuous play, you can also do selective cont play, /bk -p seether would play all songs with seether in them, in succesion, then return to either rand/cont play.
;-queue system, you can queue as many songs as you like, it will play them in succesion, at the end of the queue it will return to rand/cont play.
;-you can use this as an alias, or use the popups, note all the features arent in the popups, bk -n,-s are not.
;-the difference between list/refresh in popups is, that refresh will re-write the file, so if your using selective continuous play it will reset and youll be back to all your mp3's, list refreshes the window.
;-playlist stuff explanation.(lots of ppl find this compicated though i dont you might)
;-i added a playlist system, you can create, edit, load, and remove playlists.
;-this function is ALL POPUPS in @windows, however, once you load a playlist you can use the alias like normal, it halts refreshing when a playlist is loaded.
;-/bk -ul unloads the active playlist.
;-drag/drop is almost like storing info to clipboard, you drag a file, it removes it, then you drop it whereever you want, this is GREAT for editing your playlists.
;-you MUST "edit a playlist" before you can add to it or edit it.
;-lyrics shit
;-i added a feature that lets you get lyrics for songs from www.lyricsstyle.com
;-you can either type "artist - song" in the @lyrics window, or you can do auto-get
;-auto-get automatically searches for lyrics every time you play a song, either by filename or id3 tag.
;-you can also save lyrics to text files in the lyrics folder in your $scriptdir, auto-save will save lyrics every time you get them.
;-note...im not sure what version of mirc you need to use this script, but it must support filter.
alias -l gettunez { if (%tunez.d) { if (!%tunez.plist_a) { dll $tdir(listfiles.dll) setoutput <fname> | dll $tdir(listfiles.dll) listfiles %tunez.d > mp3|wav|wma|mid|midi > $scriptdirtunez_.txt } } }
alias -l tmp_tunez { write -c $tdir(tunez_tmp.txt) | filter -ff $tdir(tunez_.txt) $tdir(tunez_tmp.txt) $+(*,$1-,*) | write -c $tdir(tunez_.txt) | filter -ff $tdir(tunez_tmp.txt) $tdir(tunez_.txt) $+(*,$1-,*) | .remove $tdir(tunez_tmp.txt) }
alias -l last_ { %tunez.l = $readn }
alias -l play_ { if (%tunez.d = $null) bk -d | .timercurupt 1 1 curupt | splay stop | splay $findfile(%tunez.d,$read($tdir(tunez_.txt),$iif($1,$1,$r(1,$lines($tdir(tunez_.txt))))),1) | last_ | add_ | if (%tunez.randc = on) { set %tunez.c $r(0,15) } | ly_aget | tunez_m | high_c }
alias -l load_win { $iif(!$window(@tunez),window -zpldk +sbfnx @tunez 250 250 250 250) | filter -fwc $tdir(tunez_.txt) @tunez | if (%tunez.que) { var %x 1 | while (%x <= $numtok(%tunez.que,44)) { cline 4 @tunez $gettok(%tunez.que,%x,44) | inc %x } } | high_c }
alias -l cont_on { set %tunez.cont on | set %tunez.rand off }
alias -l rand_on { set %tunez.rand on | set %tunez.cont off }
alias -l repeat_on { $iif(%tunez.rpt = on,set %tunez.rpt off,set %tunez.rpt on) }
alias -l tunez_m { $iif(%tunez.m = on,scon -a msg #skapegoat.net tunez $+ $t_c(%tunez.c,$chr(44)) $t_tag $m_stuff,echo -a * tunez $+ $t_c(%tunez.c,$chr(44)) $t_tag $m_stuff) }
alias -l in_tune { return $iif($insong,$iif($prop = path,$insong.fname,$nopath($insong.fname)),$iif($inwave,$iif($prop = path,$inwave.fname,$nopath($inwave.fname)),$iif($inmidi,$iif($prop = path,$inmidi.fname,$nopath($inmidi.fname)))))) }
alias -l high_c { $iif($window(@tunez),sline @tunez %tunez.l) }
alias -l rvrt { if ($window(@tunez)) { cline $color(listbox text) @tunez $1 } }
alias -l curupt { if ((!$insong) && (!$inmidi) && (!$inwave) && (%tunez.d != $null)) { echo -a * file corrupted, or simply won't play, skipping. | if ($lines($tdir(tunez_.txt)) < 2) gettunez | if (%tunez.que) { set %tunez.que $deltok(%tunez.que,1,44) | bk -nq | return } | elseif (%tunez.cont = on) { bk -n | return } | elseif (%tunez.rand = on) { bk -r | return } | return } }
alias -l m_stuff { %x = %tunez.c | return $t_c(%x,$chr(40)) $+ $chr(35) $+ $len_(%tunez.l) $+ $t_c(%x,/) $+ $len_($lines($tdir(tunez_.txt))) $+ $t_c(%x,$chr(41)) $+ $&
$t_c(%x,..) $+ play $+ $t_c(%x,') $+ d $+ $t_c(%x,$chr(40)) $+ %tunez.times $+ $t_c(%x,$chr(41)) $+ time $+ $iif(%tunez.times > 1,s) $+ $&
$iif(%tunez.que,$t_c(%x,$chr(44)) que $+ $t_c(%x,$chr(40)) $+ $numtok(%tunez.que,44) $+ $t_c(%x,$chr(41))) $+ $iif(%tunez.plist_a,$t_c(%x,$chr(44)) $remove(%tunez.cplist,.plist) p $+ $t_c(%x,') $+ list) $+ $&
$iif($sound($in_tune(.).path).genre,$iif(%tunez.que || %tunez.plist_a,$t_c(%x,..) $chr(36) $+ $chr(43),$t_c(%x,$chr(44))) $lower($sound($in_tune(.).path).genre) $+ $&
$t_c(%x,.),$iif(%tunez.que || %tunez.plist_a,.. $chr(36) $+ $chr(43),$t_c(%x,$chr(44))) other $+ $t_c(%x,.))
}
alias tdir { return $+(",$scriptdir,$1-,") }
alias -l t_tag { return $iif(%tunez.id3 = on,$iif($sound($in_tune(.).path).artist && $sound($in_tune(.).path).title,$repo($lower($sound($in_tune(.).path).artist - $sound($in_tune(.).path).title $+ $iif($sound($in_tune(.).path).album,$t_c(%tunez.c,..) $+ album $+ $t_c(%tunez.c,$chr(40)) $+ $sound($in_tune(.).path).album $+ $t_c(%tunez.c,$chr(41))))),$repo($lower($remove($in_tune,.mp3,.wma,.wav,.midi,.mid)))),$repo($lower($remove($in_tune,.mp3,.wma,.wav,.midi,.mid)))) }
alias -l repo { return $replace($1-,-,$t_c(%tunez.c,-),.,$t_c(%tunez.c,.),:,$t_c(%tunez.c,:),_,$chr(32),$chr(44),$t_c(%tunez.c,$chr(44)),$chr(41),$t_c(%tunez.c,$chr(41)),$chr(40),$t_c(%tunez.c,$chr(40))) }
;-credit to colby for len_ alias
alias -l len_ { var %1 = $1 | if ($len(%1) > 3) { %1 = $+($left(%1,-3),$t_c(%tunez.c,$chr(44)),$right(%1,3)) } | return %1 }
alias -l chkque { if (%tunez.que != $null) { var %x 1,%b | while (%x <= $numtok(%tunez.que,44)) { %b = $+(%b,$chr(32),%x,.,$chr(32),$read($tdir(tunez_.txt),$gettok(%tunez.que,%x,44)),$chr(32),$iif(%x < $numtok(%tunez.que,44),$crlf)) | inc %x } | .echo -q $input($remove(%b,.mp3),o,que) } | else .echo -q $input(no files que'd at this time.,o,que) }
alias -l t_cdlog { if ($input( white = 0 $crlf black = 1 $crlf blue = 2 $crlf green = 3 $crlf light red = 4 $crlf brown = 5 $crlf purple = 6 $crlf orange = 7 $crlf yellow = 8 $crlf light green = 9 $crlf cyan = 10 $crlf light cyan = 11 $crlf light blue = 12 $crlf pink = 13 $crlf grey = 14 $crlf light grey = 15 $crlf please enter a number from 0 - 15.,e,color?)) { set %tunez.c $ifmatch } }
alias -l t_c { return $+($chr(3),$1,$2,$chr(3),$chr(15)) }
alias -l add_ {
if (!$exists($tdir(played.txt))) { write -c $tdir(played.txt) }
if (!$read($tdir(played.txt),w,$+(*,$in_tune,*))) { write $tdir(played.txt) $+($nopath($in_tune),=,1) | set %tunez.times 1 }
elseif ($read($tdir(played.txt),w,$+(*,$in_tune,*))) { write -l [ $+ [ $readn ] ] $tdir(played.txt) $+($nopath($in_tune),=,$calc(1 + $gettok($read($tdir(played.txt),$readn),2,61))) | set %tunez.times $gettok($read($tdir(played.txt),$readn),2,61) }
}
alias bk {
;-for commandline use /bk -dsl[rf]mcpr[rp]n[ul][pl]q[nq]x
;-sets directory
if ($1 = -d) { %tunez.d = $sdir(c:,choose .mp3 directory) | %x = $ticks | gettunez | .echo -q $input($lines($tdir(tunez_.txt)) files found in $round($calc($calc($ticks - %x) / 1000),2) seconds.,o,$chr(32)) | load_win | window -a @tunez }
;-searches for matchtext specified
if ($1 = -s) { if $2- { gettunez | tmp_tunez $2- | load_win } | else echo -a * specify a search parameter. }
;-lists current a_xupdateio files
if ($1 = -l) { load_win | window -a @tunez }
;-gets any new files you've added to the directory
if ($1 = -rf) { gettunez | load_win | window -a @tunez }
;-sets automessage on/off
if ($1 = -m) { $iif(%tunez.m = on,%tunez.m = off,%tunez.m = on) | echo -a * $iif(%tunez.m = on,automessage enabled,echo enabled) }
;-sets continuous play on/off
if ($1 = -c) { if $2 { gettunez | cont_on | play_ $2 } | elseif !$2 { gettunez | cont_on } }
;-searches for matchtext specified, and plays results
if ($1 = -p) { if (!%tunez.plist_a) { if $2- { gettunez | cont_on | tmp_tunez $2- | play_ 1 } | else .echo -q $input(please specify a search parameter,oh,error) } }
;-turns rand on, plays random song
if ($1 = -r) { gettunez | rand_on | play_ }
;-turns repeat on/off
if ($1 = -rp) { repeat_on | echo -a * $iif(%tunez.rpt = on,repeat enabled,repeat disabled) }
;-plays next song in list
if ($1 = -n) { if ($calc(%tunez.l + 1) > $lines($tdir(tunez_.txt))) { play_ 1 | return } | else play_ $calc(%tunez.l + 1) }
;-unloads playlist, if one is loaded.
if ($1 = -ul) { if (%tunez.plist_a) { plist_da | gettunez | load_win | .echo -q $input($gettok(%tunez.cplist,1,46) playlist unloaded,o,info) } | else .echo -q $input(no playlist loaded,ow,info) }
;-loads a playlist by name if it exists.
if ($1 = -pl) { if ($2 && $exists($tdir($2- $+ $iif(.plist !isin $2-,.plist)))) { load_plist $2- $+ $iif(.plist !isin $2-,.plist) | plist_a } | else { .echo -q $input(the playlist titled $+(",$2-,") could not be found $+ $chr(44) please try again.,ow,info) } }
;-adds a file to que, you MUST specify a number, no text.
if ($1 = -q) { if ($2 isnum) { if (!$istok(%tunez.que,$2,44) && ($2 <= $lines($tdir(tunez_.txt)))) { set %tunez.que $+($iif($chr(44) isin %tunez.que,$+(%tunez.que,$chr(44)),%tunez.que),$2,$chr(44)) } } }
;-plays next que'd file, if no files are qued plays next file in list
if ($1 = -nq) { if (%tunez.que != $null) { :flow | if ($gettok(%tunez.que,1,44) <= $lines($tdir(tunez_.txt))) { play_ $gettok(%tunez.que,1,44) | rvrt $gettok(%tunez.que,1,44) | set %tunez.que $deltok(%tunez.que,1,44) | if (!$numtok(%tunez.que,44)) { unset %tunez.que } } | else { set %tunez.que $deltok(%tunez.que,1,44) | goto flow } } | else { if ($calc(%tunez.l + 1) > $lines($tdir(tunez_.txt))) { play_ 1 | return } | else play_ $calc(%tunez.l + 1) } }
;-stops currently playing song
if ($1 = -x) { splay stop | set %tunez.l 1 | high_c }
}
on *:mp3end: {
if (%tunez.rpt = on) { play_ %tunez.l | return }
elseif (%tunez.que != $null) { :flaw | if ($gettok(%tunez.que,1,44) <= $lines($tdir(tunez_.txt))) { play_ $gettok(%tunez.que,1,44) | if ($window(@tunez)) { rvrt $gettok(%tunez.que,1,44) } | set %tunez.que $deltok(%tunez.que,1,44) | if (!$numtok(%tunez.que,44)) { unset %tunez.que } | return } | else { set %tunez.que $deltok(%tunez.que,1,44) | goto flaw } }
elseif (%tunez.rand = on) { play_ | return }
elseif (%tunez.cont = on) { if (%tunez.l != $lines($tdir(tunez_.txt))) { play_ $calc(%tunez.l + 1) } | else bk -r | return }
return
}
menu channel {
tunez:load_win | window -a @tunez
}
menu @tunez {
dclick:{ play_ $sline(@tunez,1).ln }
tunez
.act/opt
..$iif(%tunez.rand = on,$style(1)) rand:bk -r
..$iif(%tunez.cont = on,$style(1)) cont:bk -c
..$iif(%tunez.cont = on,$style(1)) cont/artist:bk -p $input(artist/matchtext,e,artist/matchtext) | window -c @tunez | load_win
..$iif(%tunez.rpt = on,$style(1)) repeat:bk -rp
..stop:bk -x
..-
..$iif(%tunez.m = on,$style(1)) automessage:bk -m
..$iif(%tunez.id3 = on,$style(1)) check id3:$iif(%tunez.id3 = on,%tunez.id3 = off,%tunez.id3 = on)
..change color:t_cdlog
..$iif(%tunez.randc = on,$style(1)) rand color:$iif(%tunez.randc = on,%tunez.randc = off,%tunez.randc = on)
..-
..relist:window -c @tunez | load_win
..get new:gettunez | load_win | window -a @tunez
..directory:bk -d
.-
.que
..que/selekt:{ bk -q $sline(@tunez,1).ln | cline 4 @tunez $sline(@tunez,1).ln }
..next que:{ if (%tunez.que) { play_ $gettok(%tunez.que,1,44) | rvrt $gettok(%tunez.que,1,44) | set %tunez.que $deltok(%tunez.que,1,44) | if (!$numtok(%tunez.que,44)) { unset %tunez.que } } | else { play_ $calc(%tunez.l +1) } }
..unque/selekt:{ if ($istok(%tunez.que,$sline(@tunez,1).ln,44)) { set %tunez.que $remtok(%tunez.que,$sline(@tunez,1).ln,44) | rvrt $sline(@tunez,1).ln } | if (!$numtok(%tunez.que,44)) { unset %tunez.que } }
..-
..check que:chkque
..clear que:unset %tunez.que
.-
.playlists
..$iif($window(@editor),add select'd,$style(2) unloaded):add_tplist
..view playlists:load_p.win
..new playlist:new_list
..$iif(%tunez.plist_a,unload $+(",%tunez.cplist,"),$style(2) unloaded):plist_da | bk -l
.-
.lyrics
..lyrics window:ly_win
..lyrics for $+(",$sline(@tunez,1),"):chk_line @tunez | ly_setlink $sline(@tunez,1) | ly_win | ly_start | ly_sopen
..-
..$iif(%lyric.aget = on,$style(1)) autoget lyrics:$iif(%lyric.aget = on,%lyric.aget = off,%lyric.aget = on)
..$iif(%lyric.asave = on,$style(1)) autosave lyrics:$iif(%lyric.asave = on,%lyric.asave = off,%lyric.asave = on)
..-
..$iif(%lyric.debug = on,$style(1)) lyric debug:{ if (%lyric.debug = off) { %lyric.debug = on } | else { %lyric.debug = off } }
}
;-playlist stuff.
alias -l getlists { write -c $tdir(plist_.txt) | .echo -q $findfile($scriptdir,*.plist,0,write $+(",$nofile($1-),plist_.txt,") $nopath($1-)) }
;alias -l getlsts { dll $tdir(listfiles.dll) setoutput <fname> | dll $tdir(listfiles.dll) listfiles $tdir > plist > $scriptdirplist_.txt }
alias -l load_p.win { getlists | $iif(!$window(@playlists),window -zpldk +sbfnx @playlists 200 200 140 250) | filter -fwc $tdir(plist_.txt) @playlists | window -a @playlists }
alias -l load_pe.win { $iif(!$window(@editor),window -zpldk +sbfnx @editor 250 250 250 250) | renwin @editor @editor $+(",$1-,") | filter -fwc $tdir($1-) @editor | window -a @editor }
alias -l del_list { chk_line @playlists | if ($input(are you sure you want to delete $nopath($1- $+ ?),yvw,confirmation) = $yes) { remove $1- | load_p.win } }
alias -l clr_list { chk_line @playlists | if ($input(are you sure you want to clear $+(",%tunez.cplist,") of all files,yvw,confirmation) = $yes) { write -c $tdir(%tunez.cplist) | clear @editor } }
alias -l rem_list { chk_line @playlists | write -dl $+ $sline(@playlists).ln $tdir($sline(@playlists,1)) }
alias -l new_list { if ($input(name?,eqv,new playlist,$+(Playlist,$r(1,0999)))) { write -c $tdir($ifmatch $+ .plist) | load_p.win } }
alias -l drag_ { chk_line @editor | set %tunez.drop $sline(@editor,1) | write -dl $+ $sline(@editor,1).ln $tdir(%tunez.cplist) | load_pe.win %tunez.cplist }
alias -l drop_ { chk_line @editor | write -il $+ $calc($sline(@editor,1).ln + 1) $tdir(%tunez.cplist) %tunez.drop | load_pe.win %tunez.cplist | unset %tunez.drop }
alias -l load_plist { if ($input(load $+(",$1-,") to main window?,yv,confirmation) = $yes) { write -c $tdir(tunez_.txt) | filter -ff $tdir($1-) $tdir(tunez_.txt) * | load_win | window -c @editor | window -a @tunez } }
alias -l add_tplist { chk_line @tunez | if ($input(add selected to $+(",%tunez.cplist,",?),yv,confirmation) = $yes) { if ($sline(@tunez,0) = 1) { write $tdir(%tunez.cplist) $sline(@tunez,1) } | else { add_loop } | load_pe.win %tunez.cplist } }
alias -l add_loop { var %x 1 | while (%x <= $sline(@tunez,0)) { write $tdir(%tunez.cplist) $sline(@tunez,%x) | inc %x } }
alias -l open_list { chk_line @playlists | load_pe.win $1- | set %tunez.cplist $1- }
alias -l plist_a { set %tunez.plist_a on }
alias -l plist_da { if (%tunez.plist_a) { unset %tunez.plist_a | gettunez | load_win | .echo -q $input($gettok(%tunez.cplist,1,46) playlist unloaded,o,info) } | else .echo -q $input(no playlist loaded,ow,info) }
alias -l chk_line { $iif(!$sline($1,1),halt) }
alias -l del_a_plist { if ($input(do you want to delete ALL of your playlists?,yv,confimation) = $yes) { if ($input(ARE YOU FUCKING POSITIVE?,yvw,confimation) = $yes) { var %x 1 | while (%x <= $lines($tdir(plist_.txt))) { remove $tdir($read($tdir(plist_.txt),%x)) | inc %x } | write -c $tdir(plist_.txt) | load_p.win | .echo -q $input(all playlists removed i hope you wanted that..,o) } } }
alias -l rem_edt { chk_line @editor | if ($input(do you want to remove $sline(@editor,1) $+ ?,yvw,confirmation) = $yes) { write -dl $+ $sline(@editor,1).ln $tdir(%tunez.cplist) | load_pe.win %tunez.cplist } }
menu @playlists {
playlists
.new playlist:new_list
.edit $+(",$sline(@playlists,1),"):open_list $sline(@playlists,1)
.load playlist:if ($lines($tdir($sline(@playlists,1))) > 1) { load_plist $sline(@playlists,1) | plist_a | return } | else { .echo -q $input(there is little or no content in the playlist you selected $+ $chr(44) please add more using the @editor to load this playlist.,ow,info) }
.-
.rename playlist:chk_line @playlists | set %tmpvar $tdir($input(new name $+ $chr(44) please incl_xupdatee the file extension .plist in the name?,e,input request,$sline(@playlists,1)))) | if (.plist isin %tmpvar) { rename $tdir($sline(@playlists,1)) %tmpvar } | else { .echo -q $input(please incl_xupdatee the file extension .plist in the name!!,ow) | return } | load_p.win | unset %tmpvar
.clear playlist:clr_list @playlists
.remove playlist:del_list $tdir($sline(@playlists,1))
.remove all playlists:del_a_plist
}
menu @editor {
editor
.$iif(!%tunez.drop,drag,drop) $iif(!%tunez.drop,$+(",$sline(@editor,1),"),$+(",%tunez.drop,")):$iif(!%tunez.drop,drag_,drop_)
.remove selected:rem_edt
.-
.load playlist:if ($lines($tdir(%tunez.cplist)) > 1) { load_plist %tunez.cplist | plist_a | return } | else { .echo -q $input(there is little or no content in the playlist you selected $+ $chr(44) please add more using the @editor to load this playlist.,ow,info) }
.clear playlist:clr_list @editor
}
;-lyrics search.
on *:sockopen:lyric: {
if ($sockerr) { .echo @lyrics socket error, please wait trying again.. | ly_sopen }
sockwrite -n $sockname GET $+(/,$lower(%lyric.link)) HTTP/1.1
sockwrite -n $sockname Host: $+(lyricsdownload.com,$crlf,$crlf)
}
on *:sockread:lyric: {
sockread %lyric
if ($sockerr) { .echo @lyrics socket error, please wait trying again.. | .timerlyric off | ly_sopen | return }
if (%lyric = <TITLE></TITLE> || %lyric = HTTP/1.1 404 Not Found) { .timerlyric off | .echo @lyrics sorry, but the song you requested was not found..please make sure your spelling is exact & that you do it in this format, [^B]artist - song[^B]. | sockclose lyric }
if (*<a href="*-lyrics.html">more * Lyrics</a>* iswm %lyric) { %lyric.sig = off }
if (*</a> </center><br>* iswm %lyric) { %lyric.sig = on | return }
if (%lyric.sig = on) { if (* $+ $cr $+ * iswm %lyric) { var %i 1,%y $numtok(%lyric,13) | while (%i <= %y) { .signal -n lyric $gettok(%lyric,%i,13) | inc %i } } | else { .signal -n lyric %lyric } }
if (%lyric.debug = on) { if (!$window(@lyricdebug)) { window -ek @lyricdebug } | if (%lyric) { .echo @lyricdebug . %lyric } }
}
on *:signal:lyric: {
if ($numtok($1-,32) > 1) {
if (!%lyric.start) { set -u3 %lyric.start o | .echo @lyrics lyrics found in [^B] $+ $calc($calc($ticks - %lyric.ticks) / 1000) $+ [^B]secs.. | if (%lyric.asave = on) { ly_autosave | .timerautos 1 1 .echo @lyrics [^B]autosave activated![^B] } }
.aline @lyrics $chr(15) $+ $nohtml($1-)
if ($timer(lyric)) { .timerlyric off }
}
}
on *:input:@lyrics: {
if ($left($1,1) != /) {
clear | if ($chr(45) !isin $1-) { .echo @lyrics please seperate artist from song with a "-", also known as a hyphen..please be exact in your search. | return }
ly_setlink $1- | ly_start
}
}
menu @lyrics {
.lyrics
..$iif(%lyric.aget = on,$style(1)) autoget lyrics:$iif(%lyric.aget = on,%lyric.aget = off,%lyric.aget = on)
..$iif(%lyric.asave = on,$style(1)) autosave lyrics:$iif(%lyric.asave = on,%lyric.asave = off,%lyric.asave = on)
..-
..save lyrics:if ($input(save buffer?,vy) = $yes) { ly_savebuf }
..view saved lyrics:if (!$finddir($tdir,lyrics,1)) { mkdir $tdir $+ lyrics } | run $tdir $+ lyrics
..-
..$iif(%lyric.debug = on,$style(1)) lyric debug:{ if (%lyric.debug = off) { %lyric.debug = on } | else { %lyric.debug = off } }
}
alias -l ly_start { if (!$window(@lyrics)) { .window -Czkeda +sbfnx @lyrics 400 400 400 400 | .echo @lyrics search for lyrics like this, [^B]artist - title[^B]..the hyphen is required to seperate the two. } | %lyric.sig = off | %lyric.ticks = $ticks | clear @lyrics | renwin @lyrics @lyrics $+(",$remove(%lyric.tit,.mp3),") | .echo @lyrics searching lyrics database for.. artist:[^B] $gettok(%lyric.tit,1,45) [^B]song:[^B] $gettok($gettok(%lyric.tit,2-,45),1,46) $+ [^B] $+ $chr(44) please wait.. | ly_sopen }
alias -l ly_aget { if (%lyric.aget = on) { ly_setlink $iif(%tunez.id3 = on,$iif($sound($in_tune(.).path).artist && $sound($in_tune(.).path).title,$sound($in_tune(.).path).artist - $sound($in_tune(.).path).title,$read($tdir(tunez_.txt),%tunez.l)),$read($tdir(tunez_.txt),%tunez.l)) | ly_start } }
alias -l ly_setlink { set %lyric.tit $1- | var %x 1,%l | while (%x <= $numtok($remove($1-,$chr(45)),32)) { %l = %l $+ $gettok($remove($1-,$chr(45)),%x,32) $+ $chr(45) | inc %x } | set %lyric.link $ly_strip(%l) $+ lyrics.html }
alias -l ly_strip { return $remove($1-,_,$chr(32),.mp3,.wav,.mid,.midi,.wma,',.,$chr(44),$chr(63),:,;) }
alias -l ly_selekt { if ($1-) { set %lyric.link $iif($left($1,1) isnum,09,$left($1,1)) $+ / $+ $ly_strip($gettok($1-,1,45)) $+ / $+ $ly_strip($gettok($1-,2-,45)) $+ .html } }
alias -l ly_savebuf { if (!$finddir($tdir,lyrics,1)) { mkdir $tdir(lyrics) } | write -c $tdir($+(lyrics/,$replace($remove($window(@lyrics).title,"),$chr(32),_),.txt)) | savebuf 0 @lyrics $tdir($+(lyrics/,$replace($remove($window(@lyrics).title,"),$chr(32),_),.txt)) | .echo @lyrics [^B]lyrics saved successfully![^B] }
alias -l ly_autosave { .timersave 1 2 ly_savebuf }
alias -l ly_timechk { .timerlyric off }
alias -l nohtml {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
alias -l ly_shitfree { return $remove($1-,<br />,",$chr(9),$cr,<br>) }
alias -l ly_win { if (!$window(@lyrics)) { .window -Czkedap +sbfnx @lyrics 400 400 400 400 | .echo @lyrics search for lyrics like this, [^B]artist - title[^B]..the hyphen is required to seperate the two. } | else { window -a @lyrics } }
alias -l ly_sopen { sockclose lyric | sockopen lyric lyricsdownload.com 80 | ly_timechk }
on *:load:{ set %tunez.l 1 | bk -d }
on *:unload:{ del_a_plist | unset %tunez.* | .remove $tdir(tunez_.txt) }
on *:exit:{ dll -u $tdir(listfiles.dll) | set %tunez.l 1 }
;-the fucking end.
;-credits to colby for tons of ideas, and some help. and to rick for beta testing.
;-should support all formats splay does, if you have a problem playing something its probably the file.
;-read this
;-what this bitch can do
;-rand/continuous play, you can also do selective cont play, /bk -p seether would play all songs with seether in them, in succesion, then return to either rand/cont play.
;-queue system, you can queue as many songs as you like, it will play them in succesion, at the end of the queue it will return to rand/cont play.
;-you can use this as an alias, or use the popups, note all the features arent in the popups, bk -n,-s are not.
;-the difference between list/refresh in popups is, that refresh will re-write the file, so if your using selective continuous play it will reset and youll be back to all your mp3's, list refreshes the window.
;-playlist stuff explanation.(lots of ppl find this compicated though i dont you might)
;-i added a playlist system, you can create, edit, load, and remove playlists.
;-this function is ALL POPUPS in @windows, however, once you load a playlist you can use the alias like normal, it halts refreshing when a playlist is loaded.
;-/bk -ul unloads the active playlist.
;-drag/drop is almost like storing info to clipboard, you drag a file, it removes it, then you drop it whereever you want, this is GREAT for editing your playlists.
;-you MUST "edit a playlist" before you can add to it or edit it.
;-lyrics shit
;-i added a feature that lets you get lyrics for songs from www.lyricsstyle.com
;-you can either type "artist - song" in the @lyrics window, or you can do auto-get
;-auto-get automatically searches for lyrics every time you play a song, either by filename or id3 tag.
;-you can also save lyrics to text files in the lyrics folder in your $scriptdir, auto-save will save lyrics every time you get them.
;-note...im not sure what version of mirc you need to use this script, but it must support filter.
alias -l gettunez { if (%tunez.d) { if (!%tunez.plist_a) { dll $tdir(listfiles.dll) setoutput <fname> | dll $tdir(listfiles.dll) listfiles %tunez.d > mp3|wav|wma|mid|midi > $scriptdirtunez_.txt } } }
alias -l tmp_tunez { write -c $tdir(tunez_tmp.txt) | filter -ff $tdir(tunez_.txt) $tdir(tunez_tmp.txt) $+(*,$1-,*) | write -c $tdir(tunez_.txt) | filter -ff $tdir(tunez_tmp.txt) $tdir(tunez_.txt) $+(*,$1-,*) | .remove $tdir(tunez_tmp.txt) }
alias -l last_ { %tunez.l = $readn }
alias -l play_ { if (%tunez.d = $null) bk -d | .timercurupt 1 1 curupt | splay stop | splay $findfile(%tunez.d,$read($tdir(tunez_.txt),$iif($1,$1,$r(1,$lines($tdir(tunez_.txt))))),1) | last_ | add_ | if (%tunez.randc = on) { set %tunez.c $r(0,15) } | ly_aget | tunez_m | high_c }
alias -l load_win { $iif(!$window(@tunez),window -zpldk +sbfnx @tunez 250 250 250 250) | filter -fwc $tdir(tunez_.txt) @tunez | if (%tunez.que) { var %x 1 | while (%x <= $numtok(%tunez.que,44)) { cline 4 @tunez $gettok(%tunez.que,%x,44) | inc %x } } | high_c }
alias -l cont_on { set %tunez.cont on | set %tunez.rand off }
alias -l rand_on { set %tunez.rand on | set %tunez.cont off }
alias -l repeat_on { $iif(%tunez.rpt = on,set %tunez.rpt off,set %tunez.rpt on) }
alias -l tunez_m { $iif(%tunez.m = on,scon -a msg #skapegoat.net tunez $+ $t_c(%tunez.c,$chr(44)) $t_tag $m_stuff,echo -a * tunez $+ $t_c(%tunez.c,$chr(44)) $t_tag $m_stuff) }
alias -l in_tune { return $iif($insong,$iif($prop = path,$insong.fname,$nopath($insong.fname)),$iif($inwave,$iif($prop = path,$inwave.fname,$nopath($inwave.fname)),$iif($inmidi,$iif($prop = path,$inmidi.fname,$nopath($inmidi.fname)))))) }
alias -l high_c { $iif($window(@tunez),sline @tunez %tunez.l) }
alias -l rvrt { if ($window(@tunez)) { cline $color(listbox text) @tunez $1 } }
alias -l curupt { if ((!$insong) && (!$inmidi) && (!$inwave) && (%tunez.d != $null)) { echo -a * file corrupted, or simply won't play, skipping. | if ($lines($tdir(tunez_.txt)) < 2) gettunez | if (%tunez.que) { set %tunez.que $deltok(%tunez.que,1,44) | bk -nq | return } | elseif (%tunez.cont = on) { bk -n | return } | elseif (%tunez.rand = on) { bk -r | return } | return } }
alias -l m_stuff { %x = %tunez.c | return $t_c(%x,$chr(40)) $+ $chr(35) $+ $len_(%tunez.l) $+ $t_c(%x,/) $+ $len_($lines($tdir(tunez_.txt))) $+ $t_c(%x,$chr(41)) $+ $&
$t_c(%x,..) $+ play $+ $t_c(%x,') $+ d $+ $t_c(%x,$chr(40)) $+ %tunez.times $+ $t_c(%x,$chr(41)) $+ time $+ $iif(%tunez.times > 1,s) $+ $&
$iif(%tunez.que,$t_c(%x,$chr(44)) que $+ $t_c(%x,$chr(40)) $+ $numtok(%tunez.que,44) $+ $t_c(%x,$chr(41))) $+ $iif(%tunez.plist_a,$t_c(%x,$chr(44)) $remove(%tunez.cplist,.plist) p $+ $t_c(%x,') $+ list) $+ $&
$iif($sound($in_tune(.).path).genre,$iif(%tunez.que || %tunez.plist_a,$t_c(%x,..) $chr(36) $+ $chr(43),$t_c(%x,$chr(44))) $lower($sound($in_tune(.).path).genre) $+ $&
$t_c(%x,.),$iif(%tunez.que || %tunez.plist_a,.. $chr(36) $+ $chr(43),$t_c(%x,$chr(44))) other $+ $t_c(%x,.))
}
alias tdir { return $+(",$scriptdir,$1-,") }
alias -l t_tag { return $iif(%tunez.id3 = on,$iif($sound($in_tune(.).path).artist && $sound($in_tune(.).path).title,$repo($lower($sound($in_tune(.).path).artist - $sound($in_tune(.).path).title $+ $iif($sound($in_tune(.).path).album,$t_c(%tunez.c,..) $+ album $+ $t_c(%tunez.c,$chr(40)) $+ $sound($in_tune(.).path).album $+ $t_c(%tunez.c,$chr(41))))),$repo($lower($remove($in_tune,.mp3,.wma,.wav,.midi,.mid)))),$repo($lower($remove($in_tune,.mp3,.wma,.wav,.midi,.mid)))) }
alias -l repo { return $replace($1-,-,$t_c(%tunez.c,-),.,$t_c(%tunez.c,.),:,$t_c(%tunez.c,:),_,$chr(32),$chr(44),$t_c(%tunez.c,$chr(44)),$chr(41),$t_c(%tunez.c,$chr(41)),$chr(40),$t_c(%tunez.c,$chr(40))) }
;-credit to colby for len_ alias
alias -l len_ { var %1 = $1 | if ($len(%1) > 3) { %1 = $+($left(%1,-3),$t_c(%tunez.c,$chr(44)),$right(%1,3)) } | return %1 }
alias -l chkque { if (%tunez.que != $null) { var %x 1,%b | while (%x <= $numtok(%tunez.que,44)) { %b = $+(%b,$chr(32),%x,.,$chr(32),$read($tdir(tunez_.txt),$gettok(%tunez.que,%x,44)),$chr(32),$iif(%x < $numtok(%tunez.que,44),$crlf)) | inc %x } | .echo -q $input($remove(%b,.mp3),o,que) } | else .echo -q $input(no files que'd at this time.,o,que) }
alias -l t_cdlog { if ($input( white = 0 $crlf black = 1 $crlf blue = 2 $crlf green = 3 $crlf light red = 4 $crlf brown = 5 $crlf purple = 6 $crlf orange = 7 $crlf yellow = 8 $crlf light green = 9 $crlf cyan = 10 $crlf light cyan = 11 $crlf light blue = 12 $crlf pink = 13 $crlf grey = 14 $crlf light grey = 15 $crlf please enter a number from 0 - 15.,e,color?)) { set %tunez.c $ifmatch } }
alias -l t_c { return $+($chr(3),$1,$2,$chr(3),$chr(15)) }
alias -l add_ {
if (!$exists($tdir(played.txt))) { write -c $tdir(played.txt) }
if (!$read($tdir(played.txt),w,$+(*,$in_tune,*))) { write $tdir(played.txt) $+($nopath($in_tune),=,1) | set %tunez.times 1 }
elseif ($read($tdir(played.txt),w,$+(*,$in_tune,*))) { write -l [ $+ [ $readn ] ] $tdir(played.txt) $+($nopath($in_tune),=,$calc(1 + $gettok($read($tdir(played.txt),$readn),2,61))) | set %tunez.times $gettok($read($tdir(played.txt),$readn),2,61) }
}
alias bk {
;-for commandline use /bk -dsl[rf]mcpr[rp]n[ul][pl]q[nq]x
;-sets directory
if ($1 = -d) { %tunez.d = $sdir(c:,choose .mp3 directory) | %x = $ticks | gettunez | .echo -q $input($lines($tdir(tunez_.txt)) files found in $round($calc($calc($ticks - %x) / 1000),2) seconds.,o,$chr(32)) | load_win | window -a @tunez }
;-searches for matchtext specified
if ($1 = -s) { if $2- { gettunez | tmp_tunez $2- | load_win } | else echo -a * specify a search parameter. }
;-lists current a_xupdateio files
if ($1 = -l) { load_win | window -a @tunez }
;-gets any new files you've added to the directory
if ($1 = -rf) { gettunez | load_win | window -a @tunez }
;-sets automessage on/off
if ($1 = -m) { $iif(%tunez.m = on,%tunez.m = off,%tunez.m = on) | echo -a * $iif(%tunez.m = on,automessage enabled,echo enabled) }
;-sets continuous play on/off
if ($1 = -c) { if $2 { gettunez | cont_on | play_ $2 } | elseif !$2 { gettunez | cont_on } }
;-searches for matchtext specified, and plays results
if ($1 = -p) { if (!%tunez.plist_a) { if $2- { gettunez | cont_on | tmp_tunez $2- | play_ 1 } | else .echo -q $input(please specify a search parameter,oh,error) } }
;-turns rand on, plays random song
if ($1 = -r) { gettunez | rand_on | play_ }
;-turns repeat on/off
if ($1 = -rp) { repeat_on | echo -a * $iif(%tunez.rpt = on,repeat enabled,repeat disabled) }
;-plays next song in list
if ($1 = -n) { if ($calc(%tunez.l + 1) > $lines($tdir(tunez_.txt))) { play_ 1 | return } | else play_ $calc(%tunez.l + 1) }
;-unloads playlist, if one is loaded.
if ($1 = -ul) { if (%tunez.plist_a) { plist_da | gettunez | load_win | .echo -q $input($gettok(%tunez.cplist,1,46) playlist unloaded,o,info) } | else .echo -q $input(no playlist loaded,ow,info) }
;-loads a playlist by name if it exists.
if ($1 = -pl) { if ($2 && $exists($tdir($2- $+ $iif(.plist !isin $2-,.plist)))) { load_plist $2- $+ $iif(.plist !isin $2-,.plist) | plist_a } | else { .echo -q $input(the playlist titled $+(",$2-,") could not be found $+ $chr(44) please try again.,ow,info) } }
;-adds a file to que, you MUST specify a number, no text.
if ($1 = -q) { if ($2 isnum) { if (!$istok(%tunez.que,$2,44) && ($2 <= $lines($tdir(tunez_.txt)))) { set %tunez.que $+($iif($chr(44) isin %tunez.que,$+(%tunez.que,$chr(44)),%tunez.que),$2,$chr(44)) } } }
;-plays next que'd file, if no files are qued plays next file in list
if ($1 = -nq) { if (%tunez.que != $null) { :flow | if ($gettok(%tunez.que,1,44) <= $lines($tdir(tunez_.txt))) { play_ $gettok(%tunez.que,1,44) | rvrt $gettok(%tunez.que,1,44) | set %tunez.que $deltok(%tunez.que,1,44) | if (!$numtok(%tunez.que,44)) { unset %tunez.que } } | else { set %tunez.que $deltok(%tunez.que,1,44) | goto flow } } | else { if ($calc(%tunez.l + 1) > $lines($tdir(tunez_.txt))) { play_ 1 | return } | else play_ $calc(%tunez.l + 1) } }
;-stops currently playing song
if ($1 = -x) { splay stop | set %tunez.l 1 | high_c }
}
on *:mp3end: {
if (%tunez.rpt = on) { play_ %tunez.l | return }
elseif (%tunez.que != $null) { :flaw | if ($gettok(%tunez.que,1,44) <= $lines($tdir(tunez_.txt))) { play_ $gettok(%tunez.que,1,44) | if ($window(@tunez)) { rvrt $gettok(%tunez.que,1,44) } | set %tunez.que $deltok(%tunez.que,1,44) | if (!$numtok(%tunez.que,44)) { unset %tunez.que } | return } | else { set %tunez.que $deltok(%tunez.que,1,44) | goto flaw } }
elseif (%tunez.rand = on) { play_ | return }
elseif (%tunez.cont = on) { if (%tunez.l != $lines($tdir(tunez_.txt))) { play_ $calc(%tunez.l + 1) } | else bk -r | return }
return
}
menu channel {
tunez:load_win | window -a @tunez
}
menu @tunez {
dclick:{ play_ $sline(@tunez,1).ln }
tunez
.act/opt
..$iif(%tunez.rand = on,$style(1)) rand:bk -r
..$iif(%tunez.cont = on,$style(1)) cont:bk -c
..$iif(%tunez.cont = on,$style(1)) cont/artist:bk -p $input(artist/matchtext,e,artist/matchtext) | window -c @tunez | load_win
..$iif(%tunez.rpt = on,$style(1)) repeat:bk -rp
..stop:bk -x
..-
..$iif(%tunez.m = on,$style(1)) automessage:bk -m
..$iif(%tunez.id3 = on,$style(1)) check id3:$iif(%tunez.id3 = on,%tunez.id3 = off,%tunez.id3 = on)
..change color:t_cdlog
..$iif(%tunez.randc = on,$style(1)) rand color:$iif(%tunez.randc = on,%tunez.randc = off,%tunez.randc = on)
..-
..relist:window -c @tunez | load_win
..get new:gettunez | load_win | window -a @tunez
..directory:bk -d
.-
.que
..que/selekt:{ bk -q $sline(@tunez,1).ln | cline 4 @tunez $sline(@tunez,1).ln }
..next que:{ if (%tunez.que) { play_ $gettok(%tunez.que,1,44) | rvrt $gettok(%tunez.que,1,44) | set %tunez.que $deltok(%tunez.que,1,44) | if (!$numtok(%tunez.que,44)) { unset %tunez.que } } | else { play_ $calc(%tunez.l +1) } }
..unque/selekt:{ if ($istok(%tunez.que,$sline(@tunez,1).ln,44)) { set %tunez.que $remtok(%tunez.que,$sline(@tunez,1).ln,44) | rvrt $sline(@tunez,1).ln } | if (!$numtok(%tunez.que,44)) { unset %tunez.que } }
..-
..check que:chkque
..clear que:unset %tunez.que
.-
.playlists
..$iif($window(@editor),add select'd,$style(2) unloaded):add_tplist
..view playlists:load_p.win
..new playlist:new_list
..$iif(%tunez.plist_a,unload $+(",%tunez.cplist,"),$style(2) unloaded):plist_da | bk -l
.-
.lyrics
..lyrics window:ly_win
..lyrics for $+(",$sline(@tunez,1),"):chk_line @tunez | ly_setlink $sline(@tunez,1) | ly_win | ly_start | ly_sopen
..-
..$iif(%lyric.aget = on,$style(1)) autoget lyrics:$iif(%lyric.aget = on,%lyric.aget = off,%lyric.aget = on)
..$iif(%lyric.asave = on,$style(1)) autosave lyrics:$iif(%lyric.asave = on,%lyric.asave = off,%lyric.asave = on)
..-
..$iif(%lyric.debug = on,$style(1)) lyric debug:{ if (%lyric.debug = off) { %lyric.debug = on } | else { %lyric.debug = off } }
}
;-playlist stuff.
alias -l getlists { write -c $tdir(plist_.txt) | .echo -q $findfile($scriptdir,*.plist,0,write $+(",$nofile($1-),plist_.txt,") $nopath($1-)) }
;alias -l getlsts { dll $tdir(listfiles.dll) setoutput <fname> | dll $tdir(listfiles.dll) listfiles $tdir > plist > $scriptdirplist_.txt }
alias -l load_p.win { getlists | $iif(!$window(@playlists),window -zpldk +sbfnx @playlists 200 200 140 250) | filter -fwc $tdir(plist_.txt) @playlists | window -a @playlists }
alias -l load_pe.win { $iif(!$window(@editor),window -zpldk +sbfnx @editor 250 250 250 250) | renwin @editor @editor $+(",$1-,") | filter -fwc $tdir($1-) @editor | window -a @editor }
alias -l del_list { chk_line @playlists | if ($input(are you sure you want to delete $nopath($1- $+ ?),yvw,confirmation) = $yes) { remove $1- | load_p.win } }
alias -l clr_list { chk_line @playlists | if ($input(are you sure you want to clear $+(",%tunez.cplist,") of all files,yvw,confirmation) = $yes) { write -c $tdir(%tunez.cplist) | clear @editor } }
alias -l rem_list { chk_line @playlists | write -dl $+ $sline(@playlists).ln $tdir($sline(@playlists,1)) }
alias -l new_list { if ($input(name?,eqv,new playlist,$+(Playlist,$r(1,0999)))) { write -c $tdir($ifmatch $+ .plist) | load_p.win } }
alias -l drag_ { chk_line @editor | set %tunez.drop $sline(@editor,1) | write -dl $+ $sline(@editor,1).ln $tdir(%tunez.cplist) | load_pe.win %tunez.cplist }
alias -l drop_ { chk_line @editor | write -il $+ $calc($sline(@editor,1).ln + 1) $tdir(%tunez.cplist) %tunez.drop | load_pe.win %tunez.cplist | unset %tunez.drop }
alias -l load_plist { if ($input(load $+(",$1-,") to main window?,yv,confirmation) = $yes) { write -c $tdir(tunez_.txt) | filter -ff $tdir($1-) $tdir(tunez_.txt) * | load_win | window -c @editor | window -a @tunez } }
alias -l add_tplist { chk_line @tunez | if ($input(add selected to $+(",%tunez.cplist,",?),yv,confirmation) = $yes) { if ($sline(@tunez,0) = 1) { write $tdir(%tunez.cplist) $sline(@tunez,1) } | else { add_loop } | load_pe.win %tunez.cplist } }
alias -l add_loop { var %x 1 | while (%x <= $sline(@tunez,0)) { write $tdir(%tunez.cplist) $sline(@tunez,%x) | inc %x } }
alias -l open_list { chk_line @playlists | load_pe.win $1- | set %tunez.cplist $1- }
alias -l plist_a { set %tunez.plist_a on }
alias -l plist_da { if (%tunez.plist_a) { unset %tunez.plist_a | gettunez | load_win | .echo -q $input($gettok(%tunez.cplist,1,46) playlist unloaded,o,info) } | else .echo -q $input(no playlist loaded,ow,info) }
alias -l chk_line { $iif(!$sline($1,1),halt) }
alias -l del_a_plist { if ($input(do you want to delete ALL of your playlists?,yv,confimation) = $yes) { if ($input(ARE YOU FUCKING POSITIVE?,yvw,confimation) = $yes) { var %x 1 | while (%x <= $lines($tdir(plist_.txt))) { remove $tdir($read($tdir(plist_.txt),%x)) | inc %x } | write -c $tdir(plist_.txt) | load_p.win | .echo -q $input(all playlists removed i hope you wanted that..,o) } } }
alias -l rem_edt { chk_line @editor | if ($input(do you want to remove $sline(@editor,1) $+ ?,yvw,confirmation) = $yes) { write -dl $+ $sline(@editor,1).ln $tdir(%tunez.cplist) | load_pe.win %tunez.cplist } }
menu @playlists {
playlists
.new playlist:new_list
.edit $+(",$sline(@playlists,1),"):open_list $sline(@playlists,1)
.load playlist:if ($lines($tdir($sline(@playlists,1))) > 1) { load_plist $sline(@playlists,1) | plist_a | return } | else { .echo -q $input(there is little or no content in the playlist you selected $+ $chr(44) please add more using the @editor to load this playlist.,ow,info) }
.-
.rename playlist:chk_line @playlists | set %tmpvar $tdir($input(new name $+ $chr(44) please incl_xupdatee the file extension .plist in the name?,e,input request,$sline(@playlists,1)))) | if (.plist isin %tmpvar) { rename $tdir($sline(@playlists,1)) %tmpvar } | else { .echo -q $input(please incl_xupdatee the file extension .plist in the name!!,ow) | return } | load_p.win | unset %tmpvar
.clear playlist:clr_list @playlists
.remove playlist:del_list $tdir($sline(@playlists,1))
.remove all playlists:del_a_plist
}
menu @editor {
editor
.$iif(!%tunez.drop,drag,drop) $iif(!%tunez.drop,$+(",$sline(@editor,1),"),$+(",%tunez.drop,")):$iif(!%tunez.drop,drag_,drop_)
.remove selected:rem_edt
.-
.load playlist:if ($lines($tdir(%tunez.cplist)) > 1) { load_plist %tunez.cplist | plist_a | return } | else { .echo -q $input(there is little or no content in the playlist you selected $+ $chr(44) please add more using the @editor to load this playlist.,ow,info) }
.clear playlist:clr_list @editor
}
;-lyrics search.
on *:sockopen:lyric: {
if ($sockerr) { .echo @lyrics socket error, please wait trying again.. | ly_sopen }
sockwrite -n $sockname GET $+(/,$lower(%lyric.link)) HTTP/1.1
sockwrite -n $sockname Host: $+(lyricsdownload.com,$crlf,$crlf)
}
on *:sockread:lyric: {
sockread %lyric
if ($sockerr) { .echo @lyrics socket error, please wait trying again.. | .timerlyric off | ly_sopen | return }
if (%lyric = <TITLE></TITLE> || %lyric = HTTP/1.1 404 Not Found) { .timerlyric off | .echo @lyrics sorry, but the song you requested was not found..please make sure your spelling is exact & that you do it in this format, [^B]artist - song[^B]. | sockclose lyric }
if (*<a href="*-lyrics.html">more * Lyrics</a>* iswm %lyric) { %lyric.sig = off }
if (*</a> </center><br>* iswm %lyric) { %lyric.sig = on | return }
if (%lyric.sig = on) { if (* $+ $cr $+ * iswm %lyric) { var %i 1,%y $numtok(%lyric,13) | while (%i <= %y) { .signal -n lyric $gettok(%lyric,%i,13) | inc %i } } | else { .signal -n lyric %lyric } }
if (%lyric.debug = on) { if (!$window(@lyricdebug)) { window -ek @lyricdebug } | if (%lyric) { .echo @lyricdebug . %lyric } }
}
on *:signal:lyric: {
if ($numtok($1-,32) > 1) {
if (!%lyric.start) { set -u3 %lyric.start o | .echo @lyrics lyrics found in [^B] $+ $calc($calc($ticks - %lyric.ticks) / 1000) $+ [^B]secs.. | if (%lyric.asave = on) { ly_autosave | .timerautos 1 1 .echo @lyrics [^B]autosave activated![^B] } }
.aline @lyrics $chr(15) $+ $nohtml($1-)
if ($timer(lyric)) { .timerlyric off }
}
}
on *:input:@lyrics: {
if ($left($1,1) != /) {
clear | if ($chr(45) !isin $1-) { .echo @lyrics please seperate artist from song with a "-", also known as a hyphen..please be exact in your search. | return }
ly_setlink $1- | ly_start
}
}
menu @lyrics {
.lyrics
..$iif(%lyric.aget = on,$style(1)) autoget lyrics:$iif(%lyric.aget = on,%lyric.aget = off,%lyric.aget = on)
..$iif(%lyric.asave = on,$style(1)) autosave lyrics:$iif(%lyric.asave = on,%lyric.asave = off,%lyric.asave = on)
..-
..save lyrics:if ($input(save buffer?,vy) = $yes) { ly_savebuf }
..view saved lyrics:if (!$finddir($tdir,lyrics,1)) { mkdir $tdir $+ lyrics } | run $tdir $+ lyrics
..-
..$iif(%lyric.debug = on,$style(1)) lyric debug:{ if (%lyric.debug = off) { %lyric.debug = on } | else { %lyric.debug = off } }
}
alias -l ly_start { if (!$window(@lyrics)) { .window -Czkeda +sbfnx @lyrics 400 400 400 400 | .echo @lyrics search for lyrics like this, [^B]artist - title[^B]..the hyphen is required to seperate the two. } | %lyric.sig = off | %lyric.ticks = $ticks | clear @lyrics | renwin @lyrics @lyrics $+(",$remove(%lyric.tit,.mp3),") | .echo @lyrics searching lyrics database for.. artist:[^B] $gettok(%lyric.tit,1,45) [^B]song:[^B] $gettok($gettok(%lyric.tit,2-,45),1,46) $+ [^B] $+ $chr(44) please wait.. | ly_sopen }
alias -l ly_aget { if (%lyric.aget = on) { ly_setlink $iif(%tunez.id3 = on,$iif($sound($in_tune(.).path).artist && $sound($in_tune(.).path).title,$sound($in_tune(.).path).artist - $sound($in_tune(.).path).title,$read($tdir(tunez_.txt),%tunez.l)),$read($tdir(tunez_.txt),%tunez.l)) | ly_start } }
alias -l ly_setlink { set %lyric.tit $1- | var %x 1,%l | while (%x <= $numtok($remove($1-,$chr(45)),32)) { %l = %l $+ $gettok($remove($1-,$chr(45)),%x,32) $+ $chr(45) | inc %x } | set %lyric.link $ly_strip(%l) $+ lyrics.html }
alias -l ly_strip { return $remove($1-,_,$chr(32),.mp3,.wav,.mid,.midi,.wma,',.,$chr(44),$chr(63),:,;) }
alias -l ly_selekt { if ($1-) { set %lyric.link $iif($left($1,1) isnum,09,$left($1,1)) $+ / $+ $ly_strip($gettok($1-,1,45)) $+ / $+ $ly_strip($gettok($1-,2-,45)) $+ .html } }
alias -l ly_savebuf { if (!$finddir($tdir,lyrics,1)) { mkdir $tdir(lyrics) } | write -c $tdir($+(lyrics/,$replace($remove($window(@lyrics).title,"),$chr(32),_),.txt)) | savebuf 0 @lyrics $tdir($+(lyrics/,$replace($remove($window(@lyrics).title,"),$chr(32),_),.txt)) | .echo @lyrics [^B]lyrics saved successfully![^B] }
alias -l ly_autosave { .timersave 1 2 ly_savebuf }
alias -l ly_timechk { .timerlyric off }
alias -l nohtml {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
alias -l ly_shitfree { return $remove($1-,<br />,",$chr(9),$cr,<br>) }
alias -l ly_win { if (!$window(@lyrics)) { .window -Czkedap +sbfnx @lyrics 400 400 400 400 | .echo @lyrics search for lyrics like this, [^B]artist - title[^B]..the hyphen is required to seperate the two. } | else { window -a @lyrics } }
alias -l ly_sopen { sockclose lyric | sockopen lyric lyricsdownload.com 80 | ly_timechk }
on *:load:{ set %tunez.l 1 | bk -d }
on *:unload:{ del_a_plist | unset %tunez.* | .remove $tdir(tunez_.txt) }
on *:exit:{ dll -u $tdir(listfiles.dll) | set %tunez.l 1 }
;-the fucking end.