[Request] Alert on specific 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] Alert on specific message (/showthread.php?tid=76172) [Request] Alert on specific message by glargle on 07-17-2007 at 11:51 PM
I have no knowledge of scripting, so all my attempts have failed. RE: [Request] Alert on specific message by roflmao456 on 07-18-2007 at 12:25 AM
Welcome to the forum! code: i'm not sure if that will work but you can try. btw, for a single backslash ( \ ) you have to put two. so \\ will result in a single backslash RE: [Request] Alert on specific message by glargle on 07-18-2007 at 12:44 AM
Thanks alot man, but it doesn't work RE: [Request] Alert on specific message by roflmao456 on 07-18-2007 at 01:32 AM
could you get the text from the debug window? RE: [Request] Alert on specific message by glargle on 07-18-2007 at 01:45 AM
Script has been stopped RE: [Request] Alert on specific message by roflmao456 on 07-18-2007 at 02:30 AM
quote: when you receive a message lol RE: [Request] Alert on specific message by glargle on 07-18-2007 at 03:10 AM Function called: OnEvent_ChatWndReceiveMessage RE: [Request] Alert on specific message by roflmao456 on 07-18-2007 at 03:42 AM
quote:nothing after? RE: [Request] Alert on specific message by glargle on 07-18-2007 at 04:33 AM Nope. I get that message everytime I send or receive a message. RE: [Request] Alert on specific message by markee on 07-18-2007 at 04:45 AM
quote:Your code can be made a little better, the use of a regular expression means that you only have to make the one if statement rather than 2 and the for statement. Also you might want to look at using things other than a search method because it doesn't give much that you can work with after (I know there was nothing in this case but it can be useful later and a good habit to get into). code: This code does exactly the same as roflmao456's code anyway, I think the problem might be in the path that you are making. Please make sure that you use the \\ and that you start from the drive letter and double check that the file exists where you are looking. If that doesn't work then please try this code: code:This is just to make sure that the sound file is work and that you have the right path to it. It should make the sound when you save the script. I advise you to get rid of this once it has worked or else every time you start messenger then you will hear the sound. If you keep having troubles can you please copy and paste the path that you are using to the file so that we can just double check you are doing it correctly and also make sure that you have your sound on (you'd be amazed at how many people don't think of the little things). RE: [Request] Alert on specific message by glargle on 07-18-2007 at 04:58 AM
Thanks, but I'm still not getting any sound. I'm using: code: RE: RE: [Request] Alert on specific message by davidpolitis on 07-18-2007 at 06:39 AM
quote:Try the following code: You could also use a toast to play the sound and say what word from the array the received message contained if you really want to RE: [Request] Alert on specific message by Spunky on 07-18-2007 at 12:25 PM
Just to explain... a relative path is relative to the scripts folder so it would be easier to copy the sound file there and just use the filename in the script. RE: RE: [Request] Alert on specific message by davidpolitis on 07-18-2007 at 01:36 PM
quote:sorry, knew you could do that with toasts, but not with this, not really good at JS. RE: [Request] Alert on specific message by glargle on 07-18-2007 at 02:50 PM
I'm messing up something because it's still not working. I've tried the relative and absoloute things but still fails :\ code: RE: [Request] Alert on specific message by Spunky on 07-18-2007 at 03:47 PM use code:and place the mp3 in the script folder (Wakealert folder) RE: [Request] Alert on specific message by glargle on 07-18-2007 at 04:00 PM Still nothing. Does it work for you guys or is it a problem on my end? RE: [Request] Alert on specific message by Spunky on 07-18-2007 at 04:20 PM try seeing what the function returns... code:If it's false, then it won't play... I just tried it a few times with a test script and it works when it wants tbh RE: [Request] Alert on specific message by glargle on 07-18-2007 at 04:28 PM
When I change that, the debugger says code: I don't know what I'm messing up. RE: [Request] Alert on specific message by Spunky on 07-18-2007 at 05:14 PM
my mistake... RE: [Request] Alert on specific message by glargle on 07-18-2007 at 05:35 PM Yeah, it says false. RE: RE: RE: [Request] Alert on specific message by CookieRevised on 07-18-2007 at 10:46 PM
quote: + quote: = MsgPlus.PlaySound("\\C:\\Program Files\\Messenger Plus! Live\\Scripts\\Wakealert\\wakeupfaggot.mp3"); or if you put the mp3 in the same directory as your script: MsgPlus.PlaySound("wakeupfaggot.mp3"); --------------- PS: glargle, make also sure the MP3 is an actual proper MP3. Also, Plus! can play many formats, but it is quite possible that some subformats can't be played. RE: [Request] Alert on specific message by Spunky on 07-19-2007 at 12:27 AM
quote: I thought about the file format, but wasn't sure. I tried PlaySound with the ScriptFilesPath and it worked occasionally... Does that still have to have the \\ at the start or not? RE: [Request] Alert on specific message by glargle on 07-19-2007 at 01:14 AM
OK I'm confused now, it turns out it was the .mp3 that wouldn't play, because I tried using a .wav and it plays fine. RE: [Request] Alert on specific message by CookieRevised on 07-19-2007 at 09:47 AM
quote:If you want the path to be absolute then yes, you need the have the \ character at the start of the path string. And to have a \ character in JScript you need to enter either the string "\\" or enter the character as a ascii code like "\x5C". RE: [Request] Alert on specific message by markee on 07-19-2007 at 01:08 PM
quote:And this is why I think Patchou needs to amend the documentation to make it easier for new people to understand for this stuff to do with files. He should at least put it in the remarks section, isn't that why it is there after all? RE: [Request] Alert on specific message by CookieRevised on 07-19-2007 at 03:20 PM
In one way I totally agree. |