What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » If statements and editing a script

If statements and editing a script
Author: Message:
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: If statements and editing a script
quote:
Originally posted by Burningmace
code:
function startsWithAlpha(message) {
[...]
}

can be reduced to one line using regexp :)
code:
function startsWithAlpha(message){
    return /^[A-Za-z]/.test(message);
    }
i'm not a master of reg exp so it might have some errors.. lol :P


quote:
Originally posted by vanillaflavoured
Okay so I'm making some changes to a script (for personal reasons)
*cough*punctuator*cough* :P.
quote:
However my problem is I only want it to uppercase if there is actually a character a-z or A-Z as the first character as when I type Japanese characters it messes the first character up and if I try to send Messenger Plus commands like /busy or /all it creates problems with that too.
the code above should fix that.
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
if(startsWithAlpha(message)){
Message = "$" + Message.substr(1);
}
}
/*If I send 'LOL', it will output as '$OL'*/

This post was edited on 09-24-2008 at 12:26 AM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
09-24-2008 12:13 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
If statements and editing a script - by vanillaflavoured on 09-22-2008 at 09:43 PM
RE: If statements and editing a script - by Jesus on 09-23-2008 at 01:58 AM
RE: If statements and editing a script - by Burningmace on 09-23-2008 at 11:47 PM
RE: If statements and editing a script - by roflmao456 on 09-24-2008 at 12:13 AM
RE: If statements and editing a script - by Burningmace on 09-24-2008 at 12:46 AM
RE: RE: If statements and editing a script - by vanillaflavoured on 09-24-2008 at 12:20 PM
RE: If statements and editing a script - by roflmao456 on 09-24-2008 at 07:55 PM
RE: If statements and editing a script - by vanillaflavoured on 09-25-2008 at 10:41 AM
RE: If statements and editing a script - by Jesus on 09-25-2008 at 10:53 AM
RE: If statements and editing a script - by vanillaflavoured on 09-25-2008 at 11:22 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