What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Code for script with sounds

Code for script with sounds
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Code for script with sounds
quote:
Originally posted by Jumpfreakske
if(Message == "Razzia")
{
ChatWnd.SendMessage("/sound Dj Zany - Razzia");
   MsgPlus.AddTimer("Delay", 12000);
ChatWnd.SendMessage("/sound Dj Zany - Razzia 2");
   MsgPlus.AddTimer("Delay", 12000);
ChatWnd.SendMessage("/sound Dj Zany - Razzia 3");
}
The reason why this isn't working is because MsgPlus.AddTimer only adds a timer. It's not like the Sleep function that it'll make the script pauze for a certain period. Therefore, the right way of thinking here is:
  1. Play the first sound.
  2. Create the first timer, called "Delay1".
  3. Make a timer event.
  4. In the event, if the "Delay1" timer ends, play the second sound and create the second timer, "Delay2".
  5. Still in the event, if the "Delay2" timer ends, play the last sound.
And that's what NanaFreak's code does. :)

Just a note: the whole cyclus should be executed before a new "Razzia" message is received. Otherwise, the first cyclus will be stopped and the new one will play. This could lead to complications when this happens in two chat windows.

EDIT: Yes Felu, that's what I wanted to explain but you've beaten me. :P
When the first message arrives, the first sound will play. When another contact sends the message, the first sound will play in the new window but the other contact won't hear the other two. Also, when you close the window before all sounds are sent you get an error because the ChatWindow is invalid.

This post was edited on 01-28-2007 at 11:31 AM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
01-28-2007 11:28 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Code for script with sounds - by Jumpfreakske on 01-27-2007 at 03:50 PM
RE: Code for script with sounds - by phalanxii on 01-28-2007 at 06:26 AM
RE: Code for script with sounds - by Jumpfreakske on 01-28-2007 at 09:27 AM
RE: Code for script with sounds - by vikke on 01-28-2007 at 09:32 AM
RE: Code for script with sounds - by Menthix on 01-28-2007 at 11:10 AM
RE: Code for script with sounds - by Jumpfreakske on 01-28-2007 at 11:12 AM
RE: Code for script with sounds - by NanaFreak on 01-28-2007 at 11:18 AM
RE: Code for script with sounds - by Felu on 01-28-2007 at 11:21 AM
RE: Code for script with sounds - by Matti on 01-28-2007 at 11:28 AM
RE: Code for script with sounds - by vikke on 01-28-2007 at 11:54 AM
RE: Code for script with sounds - by Felu on 01-28-2007 at 11:57 AM
RE: Code for script with sounds - by vikke on 01-28-2007 at 12:01 PM
RE: Code for script with sounds - by Jumpfreakske on 01-29-2007 at 09:48 PM


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