Shoutbox

[Request] Adding a sound for recieved message - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Request] Adding a sound for recieved message (/showthread.php?tid=63692)

[Request] Adding a sound for recieved message by ArGoS on 07-20-2006 at 08:28 PM

Hi there, I would like WLM to execute a sound when a new message is recieved even if the chat window is maximized. Also another sound notification after I press the enter key while sending a message.

I write these lines of code but it does not work:

code:
function OnEvent_ChatWndReceiveMessage(  )
{
    Interop.Call( "kernel32.dll", "Beep", 1000, 1000 );
}


I also would like to change the appearance of the text before the incoming message. I would prefer an IRC style format like [ time ] <username>:
for example:
[ 12:32 ] ArGoS: hi dude

Can please someone help me?
Thanks in advance.
RE: [Request] Adding a sound for recieved message by AberNStein on 07-20-2006 at 09:12 PM

you have to put the arguments in OnEvent_ChatWndReceiveMessage

OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)

note that the beep is a second long and pretty much hangs msn until it's done beeping


RE: [Request] Adding a sound for recieved message by ArGoS on 07-20-2006 at 09:14 PM

Thank you for replying.


RE: [Request] Adding a sound for recieved message by AberNStein on 07-20-2006 at 09:16 PM

no prob.
as for the square brackets around the time, i'll see what i can do in msgslang.dll


RE: [Request] Adding a sound for recieved message by ArGoS on 07-20-2006 at 09:22 PM

Thank you so much for your help.


RE: [Request] Adding a sound for recieved message by AberNStein on 07-20-2006 at 09:36 PM

code:
function OnEvent_Initialize(MessengerStart)
{
}

function OnEvent_Uninitialize(MessengerExit)
{
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
if (Origin != Messenger.MyName)
{
var num = 0;
for (var i=0;i<18;i++)
{
num = 75 * i + 700;
Interop.Call( "kernel32.dll", "Beep", num, 35 );
}
}
}


RE: [Request] Adding a sound for recieved message by ArGoS on 07-20-2006 at 09:50 PM

I used your code but it doesn't work. :(

As about the text, i would like to have every chat message in one single line with [ Time ] <username>: <message> in order to save space.

EDIT:
I have a question: what does the third parameter of the .Call method is for? Why 18 calls to Interop.Call?


RE: [Request] Adding a sound for recieved message by AberNStein on 07-20-2006 at 10:16 PM

are you sure it doesn't work? it works here.
the third parameter is the frequency, which increases with each iteration of the for loop. the last parameter is the length, in milliseconds, i assume.

i'll edit the post to show the whole script. try that.

quote:
Originally posted by ArGoS
As about the text, i would like to have every chat message in one single line with [ Time ] <username>: <message> in order to save space.

what do you mean in one single line? if it's a long message or username, it'll wrap.
to get the time before the username, use a-patch. www.a-patch.tk
RE: [Request] Adding a sound for recieved message by ArGoS on 07-20-2006 at 10:29 PM

In one single line means something like this:

[ 12:31 ] ArGoS: thanks for your help
[ 12:32 ] AberNstein: you are welcome
[ 12:32 ] ArGoS: have to go now mate
[ 12:32 ] AberNstein: see ya pal, bb
[ 12:33 ] ArGoS: cu later

as you see above every message is in one line only instead of the dafault:

ArGoS writes (12:30):
   thanks for your help

that is in two lines.

As for your code:

I performed a copy & paste of all the code in a new empty Script Editor window (I removed the standard events because are already contained in your code). Saved the script and started it.

I tried chatting with a friend but if he send me a message and my window is maximized I do not hear anything (like the script is doing nothing).

If the code does works in your machine, then I'll try to check where's the mistake I do. Thank you anyway, very much appreciated.


RE: [Request] Adding a sound for recieved message by AberNStein on 07-21-2006 at 10:03 PM

hey hey hey don't put words in my mouth.
j/k
that's certainly not doable with a script, and i doubt you could even mod wlm to do it.
try miranda or trillian.


RE: [Request] Adding a sound for recieved message by Chrono on 07-22-2006 at 01:27 AM

To everyone who has posted on this thread: Please stop double or even triple posting. There's an edit button, use it.

And no, you dont need to reply to this post, i know you will read it. Thanks :)