What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How To Call Upon Random Files

Pages: (2): « First [ 1 ] 2 » Last »
How To Call Upon Random Files
Author: Message:
Vexor
Full Member
***

Avatar
Pure Capital Gain

Posts: 162
Reputation: 7
43 / Male / –
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']
[Image: DaFuca.png]
07-22-2006 09:45 AM
Profile PM Find Quote Report
John Anderton
Elite Member
*****

Avatar

Posts: 3908
Reputation: 80
37 / Male / Flag
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
Profile E-Mail PM Web Find Quote Report
Vexor
Full Member
***

Avatar
Pure Capital Gain

Posts: 162
Reputation: 7
43 / Male / –
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']
[Image: DaFuca.png]
07-22-2006 06:10 PM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
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-.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-22-2006 06:21 PM
Profile PM Web Find Quote Report
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
Profile PM Find Quote Report
Vexor
Full Member
***

Avatar
Pure Capital Gain

Posts: 162
Reputation: 7
43 / Male / –
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']
[Image: DaFuca.png]
07-23-2006 12:02 AM
Profile PM Find Quote Report
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
[Image: cloudy.jpg]
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

6913 days, 22 hours, 18 minutes, 16 seconds ago
07-23-2006 12:04 AM
Profile E-Mail PM Find Quote Report
Vexor
Full Member
***

Avatar
Pure Capital Gain

Posts: 162
Reputation: 7
43 / Male / –
Joined: Jan 2006
O.P. RE: How To Call Upon Random Files
quote:
Originally posted by cloudhunter
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

I did put sound down every time, i didnt mention music. I been looking, but I cant seem to find anything that will help me.
[Testing A Bunch Of Different Betas']
[Image: DaFuca.png]
07-24-2006 08:42 AM
Profile PM Find Quote Report
Veggie
Full Member
***

Avatar

Posts: 415
Reputation: 21
37 / Male / Flag
Joined: Sep 2004
RE: How To Call Upon Random Files
http://www.pageresource.com/jscript/jrandom.htm
first result ffs
07-24-2006 10:07 AM
Profile E-Mail PM Web Find Quote Report
Vexor
Full Member
***

Avatar
Pure Capital Gain

Posts: 162
Reputation: 7
43 / Male / –
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']
[Image: DaFuca.png]
07-24-2006 10:35 AM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On