How To Call Upon Random Files |
Author: |
Message: |
Vexor
Full Member
Pure Capital Gain
Posts: 162 Reputation: 7
43 / / –
Joined: Jan 2006
|
O.P. How To Call Upon Random Files
I am looking for a way to call upon a random sound file from a directory? mainly so that when I sign in, I want it to play a different song? it can either open the song or play the song.
Also is there a script out there that has something that has a random message for the day toast displayer, cos I think I would use one of these.
[Testing A Bunch Of Different Betas']
|
|
07-22-2006 09:45 AM |
|
|
John Anderton
Elite Member
Posts: 3908 Reputation: 80
37 / /
Joined: Nov 2004
Status: Away
|
RE: How To Call Upon Random Files
Use the random function (in jscript) to get a number and use the if condition to play a different file.
This of course works only if you know the file names. Or you could do search the directory and store all its files in an array and then generate a random number (using jscript) and use it as the subscript of the array giving you a random file to everytime
This post was edited on 07-22-2006 at 10:59 AM by John Anderton.
[
KarunAB.com]
[img]http://gamercards.exophase.com/459422.png[
/img]
|
|
07-22-2006 10:56 AM |
|
|
Vexor
Full Member
Pure Capital Gain
Posts: 162 Reputation: 7
43 / / –
Joined: Jan 2006
|
O.P. RE: How To Call Upon Random Files
ok, so as in if i had the files named 1.mp3, 2.mp3, 3.mp3 and so on, how would i write this?
[Testing A Bunch Of Different Betas']
|
|
07-22-2006 06:10 PM |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
Joined: Mar 2004
|
RE: How To Call Upon Random Files
quote: Originally posted by Vexor
ok, so as in if i had the files named 1.mp3, 2.mp3, 3.mp3 and so on, how would i write this?
Step 1: type http://google.com into your web browser
Step 2: type "jscript how to make random numbers"
Step 3: hit enter
Step 4: then open results until you find your answer
This post was edited on 07-22-2006 at 06:22 PM by -dt-.
Happy Birthday, WDZ
|
|
07-22-2006 06:21 PM |
|
|
Hengy
Junior Member
Posts: 16
Joined: Jul 2006
|
RE: How To Call Upon Random Files
You could always make a windows media player playlist and always have shuffle on...
|
|
07-22-2006 08:11 PM |
|
|
Vexor
Full Member
Pure Capital Gain
Posts: 162 Reputation: 7
43 / / –
Joined: Jan 2006
|
O.P. RE: How To Call Upon Random Files
Ok that didnt help, I was looking for a way to do it so that when ever i signed into WLM it would play a random sound, but it doesnt matter.
[Testing A Bunch Of Different Betas']
|
|
07-23-2006 12:02 AM |
|
|
cloudhunter
Senior Member
Posts: 536 Reputation: 18
37 / – / –
Joined: Dec 2005
|
RE: How To Call Upon Random Files
Ah, you should have said "sound" then not "music" But it's possible I think. You just need to find a way of playing the sound Follow -dt-'s advice and google it, it should be pretty well known
Cloudy
Sig by pirateok/marisaok/marisa
quote: Originally posted by Moulin Rouge
The greatest thing you'll ever learn, is just to love and be loved in return
6914 days, 56 minutes, 28 seconds ago
|
|
07-23-2006 12:04 AM |
|
|
Vexor
Full Member
Pure Capital Gain
Posts: 162 Reputation: 7
43 / / –
Joined: Jan 2006
|
O.P. RE: How To Call Upon Random Files
[Testing A Bunch Of Different Betas']
|
|
07-24-2006 08:42 AM |
|
|
Veggie
Full Member
Posts: 415 Reputation: 21
37 / /
Joined: Sep 2004
|
RE: How To Call Upon Random Files
|
|
07-24-2006 10:07 AM |
|
|
Vexor
Full Member
Pure Capital Gain
Posts: 162 Reputation: 7
43 / / –
Joined: Jan 2006
|
O.P. RE: How To Call Upon Random Files
Ok then, I tried this from a while ago when i went to that site, and this is what i came up with.
and no surprises, but I cannot get it to work. it is simple, but well I hope it will get me started in loading random things from scripts.
any ideas how i can make this work?
I tried everything "I" can think of.
code: function getaSound()
{
var whichsound=get_random();
var quote=new Array(2)
quote[0]="Chimes.WAV";
quote[1]="Ding.WAV";
}
function OnEvent_ChatWndCreated(ChatWnd)
{
var ChatWndContacts = ChatWnd.Contacts;
if(ChatWndContacts.Count == 1)
{
var e = new Enumerator(ChatWndContacts);
var Contact = e.item();
{
MsgPlus.DisplayToastContact(Messenger.MyName , "Has Just Opened A Window With" , Contact.Name , getaSound );
}
}
}
[Testing A Bunch Of Different Betas']
|
|
07-24-2006 10:35 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|