Yes,i know that this script is very crude. ;)
This is my first mp3 player made in dialog, it took me so long cause im stupid and couldn't figure out some of the commands, had to make it from scratch. lol, to use it just:
Right click in channel and click Mp3 Player
Type /mp3
Type /dialog -dm mp3 mp3
The script likes to mess up and give you 0 for a lot of things..if anyone knows a fix it'd be much appreciated. this is what shows up every once in a while instead of regular:
[Now Playing: 01 - Metallica - Enter Sandman][Duration: 0Seconds][Size: 0 Megabytes][Bitrate: Kbps][Mp3s Played: 245]
Basicly i just want to submit this to see what everyone thinks of it, if anyone sees an error please tell me :D
Errors: Another reason why im stupid, i dont know the command to get the mp3 to repeat, i got something on the bottom that tries to do it, but i tried to repeat $Did(13).seltext and %mp3, neither of which work, if anyone works it would be much appreciated.
```mirc
alias mp3 { /dialog -dm mp3 mp3 }
menu channel {
-
Mp3 Player:/dialog -dm mp3 mp3
}
dialog mp3 {
title "LuGiA Mp3 Player Beta"
size -1 -1 140 210
option dbu
box "Options", 1, 1 1 108 43
box "Song List", 2, 1 100 138 109
box "Info", 3, 1 44 138 56
box "Msg", 4, 110 1 29 43
button "Play", 5, 2 9 35 11
button "Stop", 6, 37 9 35 11
button "Pause", 7, 2 20 35 11
button "Resume", 8, 37 20 35 11
button "Repeat", 9, 2 31 35 11
button "No Repeat", 10, 37 31 35 11
button "Set Directory", 11, 72 9 36 33
button "Msg", 12, 111 9 27 11
button "Amsg", 14, 111 20 27 11
button "None", 15, 111 31 27 11
list 13, 2 108 136 100
text "", 16, 4 54 136 8
text "", 17, 4 62 100 8
text "", 18, 4 70 100 8
text "", 19, 4 78 100 8
text "", 20, 4 86 100 8
}
ON *:DIALOG:MP3:SCLICK:*:{
if ($did == 5) {
set %mp3 $Did(13).seltext
set %bitrate $Sound($Insong.fname).bitrate Kbps
set %size $Round($calc($lof($Insong.fname)/1000000),2) Megabytes
set %duration $Replace($Duration($Calc($Sound($Insong.fname).length / 1000)),mins,Minutes,secs,Seconds)
if (%msg == msg) msg $active 14[15 $+ Now Playing: %mp3 $+ 14][15 $+ Duration: %duration $+ 14][15 $+ Size: %size $+ 14][15 $+ Bitrate: %bitrate $+ 14][15 $+ Mp3s Played: %mp3.played $+ 14]
if (%msg == amsg) msg $active 14[15 $+ Now Playing: %mp3 $+ 14][15 $+ Duration: %duration $+ 14][15 $+ Size: %size $+ 14][15 $+ Bitrate: %bitrate $+ 14][15 $+ Mp3s Played: %mp3.played $+ 14]
splay -p %mp3dir $+ $Did(13).seltext $+ .mp3
did -ra mp3 16 Mp: $Did(13).seltext
did -ra mp3 17 Duration: $Replace($Duration($Calc($Sound($Insong.fname).length / 1000)),mins,Minutes,secs,Seconds)
did -ra mp3 18 Size: $round($calc($lof($Insong.fname)/1000000),2) Megabytes
did -ra mp3 19 Bitrate: $Sound($Insong.fname).bitrate Kbps
did -ra mp3 20 Mp Played: %mp3.played
inc %mp3.played
else halt } {
if ($did == 6) { splay -p stop }
if ($did == 7) { splay -p pause }
if ($did == 8) { splay -p resume }
if ($did == 9) { set %repeat on }
if ($did == 10) { unset %repeat }
if ($did == 11) { /set %mp3dir $sdir="Select your Mp Directory" }
if ($did == 12) { set %msg msg }
if ($did == 14) { set %msg amsg }
if ($did == 15) { unset %msg }
} }
on *:DIALOG:Mp3:INIT:0:{ /Mp3List }
alias Mp3List {
var %mp3amt = 1
while (%mp3amt <= $findfile(%Mp3dir,*.mp3,0)) {
did -a Mp3 13 $Remove($Nopath($Findfile(%mp3dir,*.mp3,%mp3amt)),.mp3)
inc %mp3amt 1
}
}
on *:MP3END:{ if (%repeat == on) splay -p " $+ %mp3 $+ " }
```