What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Capital letter & a dot

Capital letter & a dot
Author: Message:
Mentality
Full Member
***

Avatar
The Best Representation OF me IS ME!

Posts: 490
Reputation: 19
39 / Male / Flag
Joined: Jun 2005
RE: Capital letter & a dot
Might wanna add no parse to that post - a lightbulb smilie is putting it off abit, I wouldn't know how to correct that

I was gonna say if you accidently put "i" instead of "I" as well, something to correct that -

This is a very useful script for me I might add lol

[update]

quote:
Originally posted by dylan!
code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
     
     if (sMessage.charAt(0) != '/' && sMessage.substr(0, 4) != 'www.' && sMessage.substr(0, 7) != 'http://') {

}
     return punctuate(sMessage);
}

function punctuate(s)
{
    var sentences = s.split(" ");
    for (var i = 0; i < sentences.length; i++)
   
    {
        if (sentences[i].charAt(0) == "/")
         {
             return sentences.join(" ");
         }
     else{
        if (i == sentences.length - 1 && isin(sentences[i].charAt(sentences[i].length - 1), "abcdefghijklmnopqrstuvwxyz0123456789"))
            {
                sentences[i] =  sentences[i] + ".";
            }
        if (i == 0)
            {
                sentences[i] = sentences[i].charAt(0).toUpperCase() + sentences[i].substr(1);
            }
        else
            {
                if (isin(sentences[i-1].charAt(sentences[i-1].length - 1), ".?!"))
                {
                    sentences[i] = sentences[i].charAt(0).toUpperCase() + sentences[i].substr(1);
                }
            }   
       
        }
    }

   
   
    return sentences.join(" ");
}

function isin(needle, haystack)
{
    for (var i = 0; i < haystack.length; i++)
        if (haystack.charAt(i) == needle)
            return true;
    return false;


I think someone should make it so it adds " ' " 's into the right spots:P or I could just replace all the theyre with they're and so on :dodgy:

Keep getting an error saying that scripts defective Dylan!

I've manged to work it out for now with the other codes - with a little help from a friend.

This post was edited on 07-02-2006 at 09:38 PM by Mentality.
07-02-2006 09:22 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Capital letter & a dot - by Bmw1000c on 06-27-2006 at 03:48 PM
RE: Capital letter & a dot - by Lou on 06-27-2006 at 03:56 PM
RE: Capital letter & a dot - by Twozzok on 06-27-2006 at 03:57 PM
RE: Capital letter & a dot - by qgroessl on 06-27-2006 at 03:58 PM
RE: Capital letter & a dot - by Mike on 06-27-2006 at 04:01 PM
RE: Capital letter & a dot - by Menthix on 06-27-2006 at 04:05 PM
RE: Capital letter & a dot - by matty on 06-27-2006 at 04:06 PM
RE: Capital letter & a dot - by Bmw1000c on 06-27-2006 at 04:13 PM
RE: Capital letter & a dot - by upsfeup on 06-27-2006 at 04:15 PM
RE: Capital letter & a dot - by hmaster on 06-27-2006 at 04:15 PM
RE: Capital letter & a dot - by Bmw1000c on 06-27-2006 at 04:27 PM
RE: Capital letter & a dot - by upsfeup on 06-27-2006 at 04:31 PM
RE: Capital letter & a dot - by Bmw1000c on 06-27-2006 at 04:34 PM
RE: Capital letter & a dot - by steve_xrcc on 06-30-2006 at 10:24 AM
RE: Capital letter & a dot - by upsfeup on 06-30-2006 at 12:19 PM
RE: Capital letter & a dot - by segosa on 06-30-2006 at 02:34 PM
RE: Capital letter & a dot - by Bmw1000c on 06-30-2006 at 04:06 PM
RE: Capital letter & a dot - by Sypher on 06-30-2006 at 04:20 PM
RE: Capital letter & a dot - by Bmw1000c on 06-30-2006 at 04:22 PM
RE: Capital letter & a dot - by Jellings on 06-30-2006 at 10:03 PM
RE: RE: Capital letter & a dot - by segosa on 07-01-2006 at 06:08 AM
RE: Capital letter & a dot - by steve_xrcc on 07-01-2006 at 06:10 AM
RE: Capital letter & a dot - by Bmw1000c on 07-01-2006 at 09:34 AM
RE: Capital letter & a dot - by Tartooob on 07-01-2006 at 11:59 AM
RE: Capital letter & a dot - by Alexcess on 07-01-2006 at 04:17 PM
RE: Capital letter & a dot - by Sypher on 07-01-2006 at 04:56 PM
RE: Capital letter & a dot - by hmaster on 07-01-2006 at 04:59 PM
RE: RE: Capital letter & a dot - by Tartooob on 07-02-2006 at 12:00 PM
RE: Capital letter & a dot - by Dark_Nightmare on 07-02-2006 at 08:20 PM
RE: RE: Capital letter & a dot - by Tartooob on 07-03-2006 at 10:13 AM
RE: Capital letter & a dot - by dylan! on 07-02-2006 at 08:43 PM
RE: Capital letter & a dot - by Mentality on 07-02-2006 at 09:03 PM
RE: Capital letter & a dot - by dylan! on 07-02-2006 at 09:11 PM
RE: Capital letter & a dot - by Mentality on 07-02-2006 at 09:22 PM
RE: Capital letter & a dot - by Sunshine on 07-03-2006 at 04:23 PM
RE: RE: Capital letter & a dot - by Dark_Nightmare on 07-04-2006 at 02:25 PM
RE: Capital letter & a dot - by Sunshine on 07-04-2006 at 02:37 PM
RE: Capital letter & a dot - by Jellings on 07-04-2006 at 04:22 PM
RE: Capital letter & a dot - by Farkie on 07-04-2006 at 10:21 PM
RE: Capital letter & a dot - by AmbulanceX on 07-08-2006 at 03:27 PM
RE: Capital letter & a dot - by AmbulanceX on 07-08-2006 at 04:03 PM
RE: Capital letter & a dot - by XAaronX on 07-29-2006 at 02:38 AM


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