Shoutbox

A Challenge! - 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: A Challenge! (/showthread.php?tid=77821)

A Challenge! by Nopraptor on 09-27-2007 at 05:04 PM

When i make my msn names, i like them to be original. something no one else does. and same goes with my fonts when i type. Ive heard theres a plugin that can change your font to a gradient colour. BUT heres the challenge! can it be done so that when your typing a message, only the first letter changes colour?! something like this...

(my name)
[c=4]J[/c][c=1]ordan[/c][c=4]T[/c][c=1]oner[/c]

If so, that would OWN. im no good at scripting myself, so i was wondering if anyones got the knack of scripting, try to have a go! :D email or add me if you need to talk to me about it

jordantoner2006@hotmail.co.uk


RE: A Challenge! by Spunky on 09-27-2007 at 05:17 PM

code:
function OnEvent_ChatWndSendMessage(PlusWnd, Message){
    if(Message.substr(0,1)!="\\"){
        Message = Message.split(" ");
        for(var s in Message){
            Message[s].substr(0,1) = "[c=4]"+Message[s].substr(0,1)+"[/c]";
        }
        return Message.join(" ");
    }
}

Should work, but gradients can't be put onto a single letter, so it's only a single colour
RE: A Challenge! by Matti on 09-28-2007 at 04:09 PM

I didn't know you could "set" a substr()? :O

...
Oh yeh, that's because you can't. :P Try this instead of the "Message[s].substr(0,1) = ..." line:

code:
Message[s] = "[c=4]"+Message[s].charAt(0)+"[/c]"+Message[s].substr(1);
I more like to use charAt(0) instead of substr(0,1) because it's shorter and easier to understand. :) (the first character uh! ;))

However you should note that this will NOT work on words after a new-line or tab character. I'll see if I can do the same with replace combined with a function...
RE: A Challenge! by Spunky on 09-28-2007 at 06:04 PM

I did notice that after I posted it... I fixed it and developed the script and it has now been released :p

[Release] ColourZ