Top

Random Songs On Start


mIRC Code
+ 0 likes
Please Register to submit score.
Average Score  4.0
Scores Submitted  2
Date Added  Mar 18, 2007
Last Updated  Mar 18, 2007
Tags  random  splay  start 
  Bookmark and Share

Introduction

Using a piece of Snooop's coding in his Random Greet snippet that sets the variables for his random messaging I created this snippet to play a random song on start. I only coded it for three since I only had three songs I wanted it to choose from but more can easily be added. Simply replace the word filename with the title of the songs you want it to choose from.
Press alt+r and paste this into the remotes section of your Scripts Editor.
All comments are welcome.
P.S. I hope you don't mind that I used that piece of your coding Snooop. I will give you full credit for it in my script if you would like.

Grab the Code

Comments

  (11)  RSS
Teh Maestro
Comments: 22
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 12:26 am
A good way that would allow for someone to use even a list of a hundred .MP3s to choose from would be to name them in sequence like song1.mp3, song2.mp3, etc., and then doing something like:

on *:START:{
var %rander = $rand(1,100)
splay $+(song,%rander,.,mp3)
}

Bouncer
Comments: 120
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 12:34 am
Ty Teh Maestro but as I am self taught and still learning I only understand parts of the code you gave me and not all. But I appreciate the feedback and hope to submit better snippets that accomplish as much as possible with the least amount of code so please bear with me as I learn new ways to code. :P
Bouncer
Comments: 120
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 12:36 am
After studying it further I believe I fully understand what your code accomplishes and I see how it could cut down on lines of code. But one quick question. To make it work all they would have to do is literally title the songs in their mRIC folder song1.mp3, song2.mp3, song3.mp3 etc...?
Teh Maestro
Comments: 22
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 1:20 am
Yeah pretty much, though I think it's be better to use /run [mp3], since that would open it with the users preferred program.
DarthReven
Comments: 468
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 4:34 am
You can use this: "on *:start: { splay $findfile(C:\,*.mp3,$r(1,$findfile(C:\,*.mp3,0))) }" this will play a random mp3 file that resides on your C:\ Drive
Noutrious
Comments: 355
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 5:09 am
Better not use what DarthReven said, replace C:\ with $mircdirsound - it would take more than 10 minutes to search all of my files in C:\ dir.
DarthReven
Comments: 468
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 6:53 am
Cause we don't know if $+($mircdir,sound) has any files in it
RusselB
Comments: 100
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 12:57 pm
The same thing could be said about any drive or directory. It's possible (although unlikely) for someone to have no mp3 files on their system.
Acid-Religion
Comments: 62
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 18, 2007 4:25 pm
It is also possible to allow the user to specify the music/mp3 directory, which I think would be the best way to do it...
DarthReven
Comments: 468
 
mIRC Snippet:  Random Songs On Start
Posted on Mar 20, 2007 4:56 am
Agreed Acid a simple setting of a variable w/ $sdir would be best
templar
Comments: 1
 
mIRC Snippet:  Random Songs On Start
Posted on Apr 21, 2007 10:46 pm
Code:

on *:start: {
    .splay $findfile(sounds,*,$rand(1,$findfile(sounds,*,0))) 
}



Please Register or Login to start posting comments.
Bottom