What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Displaying my name in colour?

Displaying my name in colour?
Author: Message:
Ashylay
Junior Member
**

Intermediate Scripter

Posts: 70
Reputation: 1
– / Male / –
Joined: Mar 2007
O.P. Displaying my name in colour?
What I want to do is when I send a message (/myname) a toast appears with my name on it IN COLOUR.

Alls I can do is remove the format codes, which I dont want to do and display the format codes which I dont want to do. Any help?

code:
var myName = Messenger.MyName

function OnGetScriptCommands(){
    var commands = "<ScriptCommands>";
    commands += " <Command>"
    commands += " <Name>myname</Name>"
    commands += " <Description>Displays your msn name in a toast</Description>"
    commands += "</ScriptCommands>"
    return commands;
}


function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if(Message=="/myname") {
        myName = MsgPlus.RemoveFormatCodes(myName);
        MsgPlus.DisplayToast("Boo", myName);
    }
}
04-01-2007 05:06 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Displaying my name in colour?
quote:
Originally posted by Ashylay
What I want to do is when I send a message (/myname) a toast appears with my name on it IN COLOUR.

Alls I can do is remove the format codes, which I dont want to do and display the format codes which I dont want to do. Any help?

code:
var myName = Messenger.MyName

function OnGetScriptCommands(){
    var commands = "<ScriptCommands>";
    commands += " <Command>"
    commands += " <Name>myname</Name>"
    commands += " <Description>Displays your msn name in a toast</Description>"
    commands += "</ScriptCommands>"
    return commands;
}


function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if(Message=="/myname") {
        myName = MsgPlus.RemoveFormatCodes(myName);
        MsgPlus.DisplayToast("Boo", myName);
    }
}

First of all you don't want your nickname to be a global variable like that because it won't wont work unless you restart the script manually after signing in and even then it will not update it if you choose a different name.  Secondly to get the colour in the name you have to use MsgPlus.DisplayToastContact rather than the one you used as the first parameter after the title (where you have your nick name) is displayed in colour, but you have to remember to add an empty string (the "") for a third variable, unless you want to add something else there.  The only problem is that only one line can be displayed in colour, but you do have the other lines that can be plain text if you wish to use them.  I have fixed the code up for you a little.  Keep working on it, I'm sure you will get a handle of it all soon enough.
code:
function OnGetScriptCommands(){
    var commands = "<ScriptCommands>";
    commands += " <Command>"
    commands += " <Name>myname</Name>"
    commands += " <Description>Displays your msn name in a toast</Description>"
    commands += "</ScriptCommands>"
    return commands;
}


function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if(Message=="/myname") {
        MsgPlus.DisplayToastContact("Boo",Messenger.MyName,"");
    }
}
[Image: markee.png]
04-02-2007 11:48 AM
Profile PM Find Quote Report
Ashylay
Junior Member
**

Intermediate Scripter

Posts: 70
Reputation: 1
– / Male / –
Joined: Mar 2007
O.P. RE: Displaying my name in colour?
Cheers ill fiddle about with that script now.
04-02-2007 12:01 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Displaying my name in colour?
You want to use DisplayToastContact instead of DisplayToast.

This will display colour in the toast.
04-02-2007 12:26 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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