/!\/!\/!\ MP3 Player /!\/!\/!\

Platform:  mIRC
Published  Nov 03, 2007
Updated  Nov 03, 2007
Well i made a useful mp3 player hope you like it alias acemp3 {
set %script.address $mircdiracemp3/acemp3dat.ini
if (($dialog(acemp3) == $null) && ($readini %script.address acemp3 relative == no)) { dialog -md acemp3 acemp3 }
if (($dialog(acemp3) == $null) && ($readini %script.address acemp3 relative == yes)) { dialog -ma acemp3 acemp3 }
if ($dialog(acemp3) != $null) { dialog -ve acemp3 }
if ($dialog(acemp3) == $null) { dialog -md acemp3 }
}

dialog acemp3 {
size -1 -1 300 200
title "-= ( AceMP3 - MP3 System for mIRC ) =-"
button "OK",1, 394 253 10 10,ok
box "", 999, 5 5 183 30
edit "", 2, 10 13 170 20,center,read
box "", 998, 182 5 114 30
edit "", 3, 190 13 100 20,center,read
box "", 997, 5 32 183 30
icon 4, 10 40 30 20, acemp3/last_s.bmp
icon 5, 30 40 30 20, acemp3/play.bmp
icon 6, 50 40 30 20, acemp3/stop.bmp
icon 7, 70 40 30 20, acemp3/pause.bmp
icon 8, 90 40 30 20, acemp3/next_s.bmp
icon 9, 133 40 46 20, acemp3/id3.bmp
box "", 996, 182 32 114 30
icon 11, 252 40 30 20, acemp3/inc.bmp
list 12, 226 40 30 19, size, disabled
icon 13, 200 40 30 20, acemp3/dec.bmp
box "", 995, 5 59 183 30
box "", 994, 182 59 114 30
text "AceMP3 V.3.0 by Ace (c) 2oo2 ", 14, 17 70 175 25, disable
icon 15, 220 67 40 20, acemp3/setup.bmp
box "", 993, 5 87 291 110
list 16, 10 97 279 109 vsbar, autovs, read
}

on *:DIALOG:acemp3:init:0: {
if ($readini %script.address acemp3 dir == $null) { did -ra acemp3 12 $round($calc($vol(master) / 65535 * 100),0) $+ $chr(37)
}
else { set %acemp3.dir $readini %script.address acemp3 dir | add2list
update.boxes S.START | did -ra acemp3 12 $round($calc($vol(master) / 65535 * 100),0) $+ $chr(37)
}
}

on *:dialog:acemp3:close:*: {
splay -p stop
}

on *:dialog:acemp3:dclick:16: {
set %acemp3file $findfile(%acemp3.dir,*.mp3,$did(16).sel)
acemp3play dclick
}

on *:dialog:acemp3:sclick:9: { id3 }

on *:dialog:acemp3:sclick:4: {
if $readini %script.address acemp3 shuffle == yes {
set %acemp3file $findfile(%acemp3.dir,*.mp3,$rand(1,$findfile(%acemp3.dir,*.mp3,0)))
acemp3play end
}
else {
if (%acemp3.id != 1) {
set %acemp3file $findfile(%acemp3.dir,*.mp3,$calc(%acemp3.id - 1))
acemp3play end
}
}
}

on *:dialog:acemp3:sclick:8: {
if $readini %script.address acemp3 shuffle == yes {
set %acemp3file $findfile(%acemp3.dir,*.mp3,$rand(1,$findfile(%acemp3.dir,*.mp3,0)))
acemp3play end
}
else {
if (%acemp3.id != $did(acemp3,16).lines) {
set %acemp3file $findfile(%acemp3.dir,*.mp3,$calc(%acemp3.id + 1))
acemp3play end
}
}
}

on *:dialog:acemp3:sclick:5: {
if $group(#pause).status == on { .splay -p resume | .disable #pause }
else { acemp3play click }
}

on *:dialog:acemp3:sclick:6: {
splay -p stop | update.boxes STOP
}

on *:dialog:acemp3:sclick:7: {
.enable #pause | splay -p pause | update.boxes PAUSE
}

on *:dialog:acemp3:sclick:11: { volume up }

on *:dialog:acemp3:sclick:13: { volume down }

alias set.id {
set %acemp3.id $didwm(acemp3,16, $remove($nopath(%acemp3file),.mp3))
if $dialog(acemp3).ok != $null {
did -c acemp3 16 %acemp3.id
}
}

alias acemp3play {
if $1 == dclick { update.boxes PLAY | set.id | .splay -p $shortfn(%acemp3file) }
if $1 == click {
if ( $did(acemp3,16).sel != $null) {
set %acemp3file $findfile(%acemp3.dir,*.mp3,$did(acemp3,16).sel) | update.boxes PLAY | set.id | .splay -p $shortfn(%acemp3file)
}
else { if %acemp3file != $null { update.boxes PLAY | set.id | .splay -p $shortfn(%acemp3file) } }
}
if $1 == end { update.boxes PLAY | set.id | .splay -p $shortfn(%acemp3file) }
}

alias mp3.length {
var %mplayer.len $int($calc($1 / 1000))
var %mplayer.min $int($calc(%mplayer.len / 60))
var %mplayer.sec $calc(%mplayer.len - (%mplayer.min * 60))
if (%mplayer.min < 10) { set %mplayer.min 0 $+ %mplayer.min }
if (%mplayer.sec < 10) { set %mplayer.sec 0 $+ %mplayer.sec }
set %mplayer.len %mplayer.min $+ : $+ %mplayer.sec
return %mplayer.len
}

alias mp3.position { if ($dialog(acemp3) != $null) did -ra acemp3 3 $mp3.length($inmp3.pos) $mp3(%acemp3file).bitrate $+ kbps $left($mp3(%acemp3file).sample,2) $+ k }

alias make.filename {
return $nopath($remove(%acemp3file,$right(%acemp3file,4)))
}

alias update.boxes {
if $1 == play {
if $dialog(acemp3).ok != 1 { if ($readini %script.address acemp3 mp3msg == yes) { mp3msg } }
else {
.timer_mp3PLAY 0 1 mp3.position
did -ra acemp3 2 $make.filename
if $readini %script.address acemp3 mp3msg == yes { mp3msg }
}
}
if $1 == stop { .timer_mp3PLAY off }
if $1 == pause { }
if $1 == s.start { did -ra acemp3 2 $make.filename }
}

alias mp3msg {
set %mp3msgchan $nopath($remove(%acemp3file,$right(%acemp3file,4)))
set %mp3msgtime $mp3.length($mp3(%acemp3file).length)
set %mp3msgrate $mp3(%acemp3file).bitrate $+ kbps $left($mp3(%acemp3file).sample,2) $+ khz
if %mp3msgchan == $null { unset %mp3msg* | halt }
if ($server == $null) {
if ($readini %script.address msg default == yes) { echo -a 2You are listening to: -=(7 %mp3msgchan )=- -=(7 %mp3msgtime 2minutes @7 %mp3msgrate )=- -=( 7 AceMP3  )=- }
else { echo -a $replace.msg $+ ( 7 AceMP3  ) | unset %acemp3.rpl* }
}
else {
if ($readini %script.address msg default == yes) { /ame 4,1× L14,1istens 4,1T14,1o4,1: 14,1-4,1=14,1(4,1 %mp3msgchan 14,1)14,1=4,1- -14,1=14,1(4,1 %mp3msgtime minutes @ %mp3msgrate 4,1)14,1=4,1- 14,1-4,1=14,1( 4,1A14,1ce4,1M14,1P3 )4,1=14,1- 4,1× }
else { /ame $replace.msg $+ ( 7 AceMP3  ) | unset %acemp3.rpl* }
}
unset %mp3msg*
}

alias volume {
if ($1 = up) { set %vol $calc($vol(master) + 655.35) }
if ($1 = down) { set %vol $calc($vol(master) - 655.35) }
vol -v %vol | did -ra acemp3 12 $round($calc($vol(master) / 65535 * 100),0) $+ $chr(37)
unset %vol
}

; --------------------------------------------------------

alias loadingmp3 { if ($dialog(loadmp3) == $null) dialog -omd loadmp3 loadmp3 }
dialog loadmp3 {
size -1 -1 167 42
title -= ( Loading... ) =-
box "",2, 1 -4 165 45
text " Loading MP3 list... please wait... ",1, 5 16 300 14
button " OK ",888, 93 214 70 25,ok
}

; --------------------------------------------------------

alias id3open { if ($dialog(id3) == $null) dialog -m id3 id3 }
dialog id3 {
size -1 -1 260 250
title " -= ( AceMP3 - ID3 Tag ) =-"
box "",565, 1 1 257 205
text " Artist / Song: ",1, 25 16 100 14
edit "", 11, 25 32 150 20, center,read
text " Bitrate: ",3, 180 16 50 12
edit "", 13, 180 32 50 20, center,read
text " Sample: ",4, 180 55 50 12
edit "", 14, 180 70 50 20, center,read
text " Length: ",5, 178 95 50 14
edit "", 15, 180 110 50 20, center,read
text " Genre: ",8, 180 133 50 12
edit "", 18, 180 145 50 20, center,read
text " Year: ",21, 180 170 50 12
edit "", 20, 180 182 50 20, center,read
text " Version: ",6, 25 93 100 12
edit "", 16, 25 108 150 20, center,read
text " Album: ",2, 25 53 150 12
edit "", 12, 25 68 150 20, center,read
text " Mode: ",7, 25 131 100 12
edit "", 17, 25 143 150 20, center ,read
text " Comments: ",9, 25 168 100 12
edit "", 19, 25 180 150 20, center,read
box "", 887, 1 203 257 40
button " OK ",888, 93 214 70 25,ok
}

alias id3 {
id3open
did -i id3 11 11 $nopath($remove(%acemp3file,$right(%acemp3file,4)))
did -i id3 12 12 $mp3(%acemp3file).album
did -i id3 13 13 $mp3(%acemp3file).bitrate $+ kbps
did -i id3 14 14 $left($mp3(%acemp3file).sample,2) $+ khz
did -i id3 15 15 $mp3.length($mp3(%acemp3file).length)
did -i id3 16 16 $mp3(%acemp3file).version
did -i id3 17 17 $mp3(%acemp3file).mode
did -i id3 18 18 $mp3(%acemp3file).genre
did -i id3 19 19 $mp3(%acemp3file).comment
did -i id3 20 20 $mp3(%acemp3file).year
}

; ---------------------------------------------------------------------------------------

alias aboutacemp3 { if ($dialog(aboutacemp3) == $null) dialog -m aboutacemp3 aboutacemp3 }
dialog aboutacemp3 {
title " -=( AceMP3 V.3.0 )=-"
size -1 -1 215 225
box "",888, 3 1 210 175
box "",889, 3 175 210 45
text "AceMP3",1,10 20 90 15
icon 900, 160 22 45 140
text "Version: AceMP3 V.3.0",3,10 114 150 15
text "Author: Ace ",2,10 129 150 15
button "&OK",6,70 188 70 25,OK
}
on *:dialog:aboutacemp3:init:0: {
did -g $dname 900 acemp3/logo.bmp
}

; --------------------------------------------------------

on *:dialog:acemp3setup:sclick:7 { aboutacemp3 }

alias acemp3setup { if ($dialog(acemp3setup) == $null) dialog -m acemp3setup acemp3setup }
dialog acemp3setup {
size -1 -1 220 190
title " -= ( AceMP3 Setup ) =-"
button " OK ",1, 160 95 50 85,ok
box " Check Options ", 2, 3 3 215 80
box "",11,3 80 146 108
box "",12, 153 80 65 108

check "Use Channel Messaging: ",5, 9 15 200 25, style(left)
check "AceMP3 Relative to mIRC window: ",8, 9 35 200 25, style(left)
check "Use Shuffle play (else Continuos play): ",9, 9 55 200 25, style(left)

button " MP3 Directory ",3, 10 95 132 25
button " Setup Messages ",10, 10 125 132 25
button " About ",7, 10 155 132 25
}

on *:dialog:acemp3:sclick:15 { acemp3setup }

on *:dialog:acemp3setup:sclick:10 { acemp3msg }

on *:DIALOG:acemp3setup:init:0: {
acemp3.readvalues
}

alias acemp3.readvalues {
if ($readini %script.address acemp3 shuffle == yes) { did -c acemp3setup 9 }
else { did -u acemp3setup 9 }
if ($readini %script.address acemp3 relative == yes) { did -c acemp3setup 8 }
else { did -u acemp3setup 8 }
if ($readini %script.address acemp3 mp3msg == yes) { did -c acemp3setup 5 }
else { did -u acemp3setup 5 }
}

on *:dialog:acemp3setup:sclick:3: {
set %dir.back %acemp3.dir
set %acemp3.dir $sdir="Select your MP3 Directory"
if %acemp3.dir != $null {
writeini %script.address acemp3 dir %acemp3.dir | unset %dir.back | add2list
}
else { .set %acemp3.dir %dir.back | unset %dir.back }
}

on *:dialog:acemp3setup:sclick:9: {
if ($did(9).state == 1) { writeini %script.address acemp3 shuffle yes }
if ($did(9).state == 0) { writeini %script.address acemp3 shuffle no }
}

on *:dialog:acemp3setup:sclick:8: {
if ($did(8).state == 1) { writeini %script.address acemp3 relative yes }
if ($did(8).state == 0) { writeini %script.address acemp3 relative no }
}

on *:dialog:acemp3setup:sclick:5: {
if ($did(5).state == 1) { writeini %script.address acemp3 mp3msg yes }
if ($did(5).state == 0) { writeini %script.address acemp3 mp3msg no }
}

alias add2list {
loadingmp3
set %i 0
did -r acemp3 16
while (%i < $findfile(%acemp3.dir,*.mp3,0)) {
inc %i
did -a acemp3 16 $remove($nopath($findfile(%acemp3.dir,*.mp3,%i)),.mp3)
}
dialog -x loadmp3
}

ctcp 1:version:ctcpreply $nick VERSION Using
; ---------------------------------------------------------------------------------------

alias acemp3msg { if ($dialog(acemp3msg) == $null) dialog -m acemp3msg acemp3msg }
dialog acemp3msg {
size -1 -1 305 158
title " -= ( Setup Channel Messaging ) =-"
button " OK ",1, 240 12 55 82,ok
check "Use Standard Channel Messaging ",2, 9 10 200 25, style(right)
check "Use Custom Channel Messaging ",3, 9 30 200 25, style(right)
edit "", 4, 25 60 200 20,center autohs
box "",5, 2 0 300 98
box "",6, 2 95 300 60
text "NOTE: Insert MP3_NAME where you want the current mp3's file name to be shown. Do the same for MP3_TIME the mp3's file time, and MP3_RATE for the play rate.",7,9 107 290 50
}

on *:DIALOG:acemp3msg:init:0: {
if ($readini %script.address msg default == yes) {
did -c acemp3msg 2 | did -u acemp3msg 3
did -ra acemp3msg 4 $readini %script.address msg message | did -b acemp3msg 4
}
else {
did -c acemp3msg 3 | did -u acemp3msg 2
did -ra acemp3msg 4 $readini %script.address msg message | did -e acemp3msg 4
}
}

on *:dialog:acemp3msg:sclick:*: {
if ($did == 2) { did -c acemp3msg 2 | did -u acemp3msg 3 | did -b acemp3msg 4
writeini %script.address msg default yes
}
if ($did == 3) { did -c acemp3msg 3 | did -u acemp3msg 2 | did -e acemp3msg 4
writeini %script.address msg default no
}
if ($did == 1) {
.set %acemp3.default.msg 4,1× L14,1istens 4,1T14,1o4,1: 14,1-4,1=14,1(4,1 MP3_NAME 14,1)14,1=4,1- -14,1=14,1( MP3_TIME 4,1M14,1inutes 4,1@14,1 MP3_RATE 14,1)14,1=4,1- ×
if $did(4).text == $null {
writeini %script.address msg message %acemp3.default.msg
}
else { writeini %script.address msg message $did(4).text }
unset %acemp3.default.msg
}
}

alias replace.msg {
set %acemp3.rpl $readini %script.address msg message
set %acemp3.rpl1 $replace(%acemp3.rpl,MP3_NAME,%mp3msgchan)
set %acemp3.rpl2 $replace(%acemp3.rpl1,MP3_TIME,%mp3msgtime)
set %acemp3.rpl3 $replace(%acemp3.rpl2,MP3_RATE,%mp3msgrate)
return %acemp3.rpl3
}

; ---------------------------------------------------------------------------------------

on *:MP3END: {
if $readini %script.address acemp3 shuffle == yes {
set %acemp3file $findfile(%acemp3.dir,*.mp3,$rand(1,$findfile(%acemp3.dir,*.mp3,0)))
acemp3play end
}
else {
if (%acemp3.id != $did(acemp3,16).lines) {
set %acemp3file $findfile(%acemp3.dir,*.mp3,$calc(%acemp3.id + 1))
acemp3play end
}
}
}

menu * {
-
AceMP3: { acemp3 }
}

#pause on
#pause end

Comments

Sign in to comment.
^Neptune   -  Apr 03, 2008
In the about dialog:

Version: AceMp3
Author: Ace
..Why is AceMP3 plastered everywhere?

Honestly, I\'m getting rather pissed off by you ripping everything. All you know are popups from what I\'ve gathered, and even some of those are ripped. From what I\'ve seen you wouldn\'t even know how to make a dialog (so don\'t pretend to be \"ace\"). You don\'t even test scripts before you submit them, and if someone finds an error you reply back with all but an emoticon which obviously helps the person.

My advice: learn how to script.

[/rant]
 Respond  
The_Fuzzy_Wookie   -  Apr 02, 2008
LINE 6, mp3 script..
need to fix.. and a little messy... but looks cool browsing throu it...
 Respond  
Noa Destiny   -  Nov 05, 2007
o_O
 Respond  
SpotRedDog   -  Nov 05, 2007
* /dialog: insufficient parameters (line 6, MP3 Script)

It does not work thats the error I get along with the 1st cat up there you need to fix it!!!
 Respond  
SpotRedDog   -  Nov 05, 2007
* /dialog: insufficient parameters (line 6, MP3 Script)

It does not work thats the error I get along with the 1st cat up there you need to fix it!!!
 Respond  
Noa Destiny   -  Nov 05, 2007
Oh Sorry And thanx for the advice and help ^silk ^_^
 Respond  
^silk   -  Nov 03, 2007
Just by browsing your code, this snippet won\'t work. You don\'t have the bmp images, and I think you are specifying an incorrect /dialog syntax. Also, your $mp3.length alias could be reduced to $gmt($calc($insong.length / 1000),nn:ss) :] Sorry, this needs to be filtered quite a bit.
 Respond  
Sora-   -  Nov 03, 2007
Something\'s wrong with line 6
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.