Hey guys. I've been working on this one for a while. It's a mIRC MP3 Player. Thanks to my friend hello2u with help for the playlist functions, it has finally been finished! Enjoy!
How it works: Right click for the menu or use the alias to bring it up. Once you do that set the directory for the music and start playin some tunes!
How to activate it: Take the script, put it in your remote tab and you are good to go!
That's about it for this script. Hope you enjoy.
~ This script was made by Wariopower and hello2u of #WarizardWorks on irc.purplesurge.com ~
;########## Wariopower's Mp3 Player ###########
;# Plays ONLY Mp3's. Made by Wariopower and hello2u of #warizardworks on irc.purplesurge.com
;# (Clueless also helped a bit.)
;# Version: 2.7 (Approx.)
;# Must have sound enabled, mIRC Options -> sounds -> enable sounds
;# To play a song: Search files -> highlight a/your song -> press play.
;##############################################
;Loading command, if you copy and paste the code, you'll need to set the directory before opening files.
on *:load: {
set %songdir c:\
}
;menu
menu channel {
Wariopower's MP3 Player: dialog -dmho wpmp3 wpmp3
}
;dialog
dialog WPMP3 {
title "mIRC MP3 Player"
size -1 -1 117 178
option dbu
list 9, 19 19 82 60, hsbar vsbar
button "Play", 1, 20 85 30 10
button "Stop", 2, 20 100 30 10
button "Pause", 3, 67 85 30 10
button "Resume", 4, 67 100 30 10
button "Search Files", 5, 11 117 48 10
button "Share", 6, 11 127 48 10
text "Wariopower's mIRC MP3 Player", 7, 22 4 78 8
link "Made By: Wariopower", 8, 31 165 58 9
button "Clear All", 14, 11 137 48 10
button "Play All", 15, 59 127 48 10
button "Clear One", 16, 59 137 48 10
button "Load Many", 17, 59 117 48 10
edit "10000", 22, 29 149 29 10
text "ms of:", 23, 62 150 17 8
edit "", 24, 79 149 28 10, read
button "Go to:", 21, 11 149 18 10
menu "Playlists", 10
item "Open", 11, 10
item "Save", 12, 10
item "Clear", 13, 10
menu "Options", 18
item "Set Song Directory", 20, 18
}
;####Dialog events####
;Play button. This will NOT work with pause! It will only start the song again.
on *:DIALOG:wpmp3:sclick:1: { set %file $+(%,file,$did(9).sel) | splay $(%file,2) | did -o wpmp3 24 1 $sound($(%file,2)).length }
;Stop
on *:DIALOG:wpmp3:sclick:2: { splay stop | set %mp3playall false }
;Pause
on *:DIALOG:wpmp3:sclick:3: { splay pause }
;Resume
on *:DIALOG:wpmp3:sclick:4: { splay resume }
;File searching, unfortunately only one can be opened at a time, mSL is limited there.
on *:DIALOG:wpmp3:sclick:5: {
inc %filenum
if (!$1) set $+(%,file,%filenum) $sfile(%songdir,Pick a MP3 File,Play!)
else { set $+(%,file,%filenum) $1- }
if ( $+(%,file,%filenum) ) {
/did -a wpmp3 9 $nopath($($+(%,file,%filenum),2))
}
/did -z wpmp3 9
}
;Music Sharing, not a database, just a /me
on *:DIALOG:wpmp3:sclick:6: { ame is now playing:2 $sound($(%file,2)).title 6-3 $sound($(%file,2)).artist }
;Link to the #warizardworks profile
on *:DIALOG:wpmp3:sclick:8: { set %link http://www.hawkee.com/profile/58981/ | run %link }
;-Playlist
;Opens the playlist, the playlist was one of the hardest parts. Yes, it cannot be named and there can only be one... may be changed in later versions.
on *:DIALOG:wpmp3:*:11:{
/did -r wpmp3 9
clearfiles
set %i 1
while ( $readini(mp3.ini,playlist,%i) != $null ) {
/did -a wpmp3 9 $nopath($readini(mp3.ini,playlist,%i))
set $+(%,file,%i) $readini(mp3.ini,playlist,%i)
inc %i
}
/did -z wpmp3 9
set %filenum $calc(%i - 1)
}
;Saves the playlist
on *:DIALOG:wpmp3:*:12:{
set %i 1
while ( $+(%,file,%i) != $null ) {
writeini mp3.ini playlist %i $($+(%,file,%i),2)
inc %i
}
}
;Clears the entire playlist.
on *:DIALOG:wpmp3:*:13:{
remini mp3.ini playlist
}
;More other dialog commands...
;Clear the list.
on *:DIALOG:wpmp3:sclick:14:{ /did -r wpmp3 9 | set %filenum 0 | clearfiles }
;Play all. (Part 1)
on *:DIALOG:wpmp3:sclick:15: { set %mp3playall true | set %file $+(%,file,1) | /splay $(%file,2) | did -o wpmp3 24 1 $sound($(%file,2)).length }
;Clears one entry from the list... surprisingly complex.
on *:DIALOG:wpmp3:sclick:16: {
set %i $did(9).sel
while ( $($+(%,file,$calc(%i + 1)),2) != $null ) {
set $+(%,file,%i) $($+(%,file,$calc(%i + 1)),2)
inc %i
}
set $+(%,file,%i) $null
did -d wpmp3 9 $did(9).sel
dec %filenum
}
;Load many button, took a LONG time to figure out the $msfile command... kept skipping over it in the help D:
on *:DIALOG:wpmp3:sclick:17: {
inc %filenum
echo -a $msfile(%songdir,Pick a MP3 File,Play!) song(s) loaded
set %i 1
while ( $msfile(%i) != $null ) {
if (!$1) set $+(%,file,%filenum) $msfile(%i)
else { set $+(%,file,%filenum) $1- }
if ( $+(%,file,%filenum) ) {
/did -a wpmp3 9 $nopath($($+(%,file,%filenum),2))
}
inc %i
inc %filenum
}
/did -z wpmp3 9
}
;Set the song directory, for easier loading.
on *:DIALOG:wpmp3:*:20: { set %songdir $sdir(c:\) }
;Seeking: our version of a fast foreward button. The total length is determined by tags and may be incorrect or missing.
on *:DIALOG:wpmp3:sclick:21: { /splay seek $did(22).text }
;Closing the player without this will mess it up a bit, so we added commands for closing it. Keeps it from breaking.
on *:DIALOG:wpmp3:close:*: { splay stop | set %filenum 0 | clearfiles }
;Part 2 of the Play all button. Don't worry, playing a song with a different script wont mess it up unless it is the same song.
on *:MP3END: {
if ( $+(%,file,$calc( $didwm(wpmp3,9,$nopath($(%file,2))) + 1)) == $null ) { set %mp3playall false }
if ( $nopath($filename) == $nopath($(%file,2)) ) {
if ( %mp3playall == true ) {
set %file $+(%,file,$calc( $didwm(wpmp3,9,$nopath($(%file,2))) + 1))
splay $(%file,2)
}
}
did -o wpmp3 24 1 $sound($(%file,2)).length
}
;####Aliases####
;Simple clearfile alias. Note that it's local.
alias -l clearfiles {
unset %file*
}
Oh hi repod lol
waves
Anyway, Wariopower is still having trouble getting on, and on top of that, his mirc computer broked D: So it's more delays for the official release.
On the bright side, here is the beta version (Minus the options dialog) for all you eager beavers :)
http://wzw.pastebin.com/L81PyjXc
P.S. We had one or two reports of mirc crashing when play is pressed... We're looking into it. Feel free to report any info you have in #warizardworks or in a P.M.
I added a play random to the newest version (still being tested,) it does the same thing, I just called it something different. But now that you mention it, I should change it to say shuffle so it fits better ;).
Some other new features that are already added and will probably be released:
-multiple player layouts
-bug fixes
-Volume control
-Playlist naming
And much more!
Things being considered/written:
-Playlist selection dialog
-Options dialog
-Volume slider
-Quicktime integration (which will play most media)
-Ability to share to only one channel
-aliases for buttons not on all the formats
We really appreciate all comments! :D