What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Replacing Words from an Array

Replacing Words from an Array
Author: Message:
KooKas
New Member
*


Posts: 3
Joined: Dec 2008
O.P. Replacing Words from an Array
Hello, this is my first post here, I'm just going to ask how I sort this out.
I'm trying to make a translator script from normal chat to chavspeak but currently it does not work. It should turn hi into sfe, hey into wagwan, hello into yo and helo into oi. It does not do that, except it does turn helo into oi.
Can someone help me with it please?

code:
function OnEvent_Initialize(MessengerStart)
{
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{   
    var Greet1 = new Array();
    Greet1[0] = "hi";
    Greet1[1] = "hey";
    Greet1[2] = "hello";
    Greet1[3] = "helo";
   
    var Greet2 = new Array();
    Greet2[0] = "sfe";
    Greet2[1] = "wagwan";
    Greet2[2] = "yo"
    Greet2[3] = "oi"   
   
    var x=0;

    for (x=0; x<4; x++)
    {
        ChatWnd.EditText = Message.replace(Greet1[x], Greet2[x]);
    }
}
function OnEvent_Uninitialize(MessengerExit)
{
}

12-31-2008 07:18 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Replacing Words from an Array - by KooKas on 12-31-2008 at 07:18 AM
RE: Replacing Words from an Array - by Matti on 12-31-2008 at 09:29 AM
RE: Replacing Words from an Array - by KooKas on 12-31-2008 at 12:09 PM
RE: Replacing Words from an Array - by matty on 12-31-2008 at 03:21 PM
RE: Replacing Words from an Array - by KooKas on 12-31-2008 at 11:06 PM


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