Shoutbox

Problem with Emoticons - 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: Problem with Emoticons (/showthread.php?tid=66663)

Problem with Emoticons by dbgtrgr on 09-26-2006 at 03:11 AM

Ok, I have a script that simply makes what you say into a 3 color gradient, which means it adds a color tag in the middle of the message, which means any emoticons sent alone will not work as a color tag will be placed in the middle, is there a way to fix this without making a workaround for EVERY emoticon tag?


RE: Problem with Emoticons by deAd on 09-26-2006 at 03:24 AM

At the moment, there is no practical way to detect all of the user's emoticon shortcuts.

However, you can make the gradient not work on messages 7 characters or less. This includes every emoticon (the limit is 7 characters).

You could also find how many emoticons there are in a chat window (or an approximate amount) by setting the cursor position to the end of the message box, and then calling the ChatWnd.EditText_GetCurSelEnd() function, which counts each emoticon as one character (that's a bug btw, at least imo, but you can use it to your advantage).

Using the Cursor method, you could find out if there are emoticons in the text field very easily. It would be harder to get an exact amount of emoticons, and even harder to get their positions (if those two were even possible), but those are your choices.


EDIT: Actually, since you want to check if there is one emoticon being sent alone, just use the cursor method. If there are seven characters or less in the ChatWnd.EditText property, and the cursor's position (after you put it at the end) is 1, then you have one emoticon in the message, and no other text/emoticons :)
RE: Problem with Emoticons by dbgtrgr on 09-26-2006 at 10:34 PM

Thx!!! You rockz0r3z. ;D Thats some 1337 thinking there.