What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Name colour changer - why won't it work?

Name colour changer - why won't it work?
Author: Message:
CrAzY_KeBaB
New Member
*


Posts: 6
Joined: Sep 2006
O.P. Name colour changer - why won't it work?
I want to make a script that will toggle through the first 50 colours, so it changes your name, why won't this work:

code:
int run=0;
int x=1;
int y=0;
var myname;

function OnEvent_ChatWndSendMessage(ChatWnd,Origin,Message,MessageKind)
{
    if (Message=="n#on")
    {
        run=1;
        return "";
    }
    if (Message=="n#off")
    {
        run=0
        return "";
    }
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
    if (run==1)
    {
        if (x==50)
        {
            x=1;
            y=0;
        }
        myname=Messenger.MyName;
        myname=myname.replace(y,x);
        Messenger.MyName=myname;
        x++;
        y++;
    }
}


Thanks in advance.
09-18-2006 05:59 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Name colour changer - why won't it work?
quote:
Originally posted by CrAzY_KeBaB
code:
int run=0;
int x=1;
int y=0;


JScript only accepts the var prefix for every type of variable declarations. So, this will be:
code:
var run=0;
var x=1;
var y=0;


I didn't took a look at your other code, but that should at least fix that.
Also, try this:
code:
function OnEvent_Initialize(MessengerStart) {
Debug.DebuggingWindowVisible = true;
}
with the script debugger enabled (Plus! preferences > Scripts > Enable script debugging) to see what error you get on what line in your script. ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-18-2006 06:49 PM
Profile E-Mail PM Web Find Quote Report
CrAzY_KeBaB
New Member
*


Posts: 6
Joined: Sep 2006
O.P. RE: Name colour changer - why won't it work?
OK, still doesn't work, and it can't get any errors, because the script doesn't run:

code:
var run=0;
var x=1;
var y=0;
var myname;

function OnEvent_Initialize(MessengerStart)
{
Debug.DebuggingWindowVisible = true;
}

function OnEvent_ChatWndSendMessage(ChatWnd,Origin,Message,MessageKind)
{
    if (Message=="n#on")
    {
        run=1;
        return "";
    }
    if (Message=="n#off")
    {
        run=0;
        return "";
    }
}

function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
    if (run==1)
    {
        if (x==50)
        {
            x=1;
            y=0;
        }
        myname=Messenger.MyName;
        myname=myname.replace(y,x);
        Messenger.MyName=myname;
        x++;
        y++;
    }
}

09-18-2006 07:12 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