Shoutbox

command to detect characters - 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: command to detect characters (/showthread.php?tid=66591)

command to detect characters by Jimbo on 09-24-2006 at 07:05 AM

i'm new to scripting but i have made my first script and i really need to know the command(s) for detecting when a ?,! etc are recieved.

also is there a way to stop the script doing something if one of those characters are recieved at the end of a message?


RE: command to detect characters by Matti on 09-24-2006 at 08:44 AM

If you want to know if a "?" or "!" or anything else is received, use the OnEvent_ChatWndReceiveMessage function. ;)

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, Kind) {
   if(Origin != Messenger.MyName && Message.match(/[?!]/)) {
      //This will be triggered when the message came from someone else but you and contains a ? or ! character
   }
}
I don't really understand what you mean with "stop to do something", so maybe you should explain what you're making and what you want it to do. :)
RE: command to detect characters by Jimbo on 09-24-2006 at 03:58 PM

mattike see chris4s comment on this thread
http://shoutbox.menthix.net/showthread.php?tid=66567


RE: command to detect characters by Felu on 09-24-2006 at 04:04 PM

quote:
Originally posted by 134jimbodude
mattike see chris4s comment on this thread http://shoutbox.menthix.net/showthread.php?tid=66567
I think there is nothing you have done in the script if you ask for each and every line of code :p.
RE: command to detect characters by Jimbo on 09-24-2006 at 04:16 PM

what do you mean, this is the first line of code i have asked for in my script