Shoutbox

Why won't this work?[SOLVED] - 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: Why won't this work?[SOLVED] (/showthread.php?tid=67578)

Why won't this work?[SOLVED] by Jimbo on 10-22-2006 at 04:15 PM

Why won't this work. I think it is meant to randomly change my PSM

code:
    i = 0;
//Change here your PSM   
    names = new Array();
    names[0] = "HeHe ";
     
//Change here your email
    emails = new Array();
    emails[0] = "jamesross_134@hotmail.com";
   
//Here your smiley's (add "smile[28] = '[smile]'" etc.)   
    smile = new Array();
    smile[0]  = "(L)";
    smile[1]  = "(K)";
    smile[2]  = "(F)";
    smile[3]  = ":$";
    smile[4]  = "(a)";
    smile[5] = ":)";
    smile[6] = ":(";
    smile[7] = ":'(";
    smile[8] = ":|";
    smile[9] = "|-)";
    smile[10] = ":@";
    smile[11] = "(B)";
    smile[12] = "^o)";
    smile[13] = "(R)";
    smile[14] = "(S)";
    smile[15] = "(*)";
    smile[16] = ":-#";
    smile[17] = "8o|";
    smile[18] = "(H)";
    smile[19] = "(T)";
    smile[20] = "(I)";
    smile[21] = "({)";
    smile[22] = "(})";
    smile[23] = ":P";
    smile[24] = "+o(";
    smile[25] = "(M)";
    smile[26] = "(@)";
    smile[27] = "(&)";

function OnEvent_Initialize(MessengerStart)
{   
   
    MsgPlus.AddTimer("Update", 6000);
   
}

function OnEvent_Uninitialize(MessengerExit)
{
}

function onEvent_Timer(timerID)
{
   
    if(timerID == "Update")
    {
   
        var i = Math.floor(Math.random()*smile.length);
       
        for(var a = 0; a < email.length; a++)
        {

            if(Messenger.MyEmail == emails[a])
            {
       
                Messenger.MyPersonalMessage = smile[i] + " " + names[a];
       
                MsgPlus.AddTimer("Update", 6000);
           
            }   

        }   
   
    }
   
}


RE: Why won't this work? by pollolibredegrasa on 10-22-2006 at 04:19 PM

Only had a quick look, but:

code:
for(var a = 0; a < email.length; a++)


Shouldn't email be emails?
RE: Why won't this work? by Jimbo on 10-22-2006 at 04:23 PM

Thanks. i'll post the code incase anyone wants to use it.

code:
    i = 0;
//Change here your PSM   
    names = new Array();
    names[0] = "YOUR PSM HERE ";
     
//Change here your email
    emails = new Array();
    emails[0] = "1@hotmail.com";
    emails[1] = "2@hotmail.com";
   
//Here your smiley's (add "smile[28] = '[smile]'" etc.)   
    smile = new Array();
    smile[0]  = "(L)";
    smile[1]  = "(K)";
    smile[2]  = "(F)";
    smile[3]  = ":$";
    smile[4]  = "(a)";
    smile[5] = ":)";
    smile[6] = ":(";
    smile[7] = ":'(";
    smile[8] = ":|";
    smile[9] = "|-)";
    smile[10] = ":@";
    smile[11] = "(B)";
    smile[12] = "^o)";
    smile[13] = "(R)";
    smile[14] = "(S)";
    smile[15] = "(*)";
    smile[16] = ":-#";
    smile[17] = "8o|";
    smile[18] = "(H)";
    smile[19] = "(T)";
    smile[20] = "(I)";
    smile[21] = "({)";
    smile[22] = "(})";
    smile[23] = ":P";
    smile[24] = "+o(";
    smile[25] = "(M)";
    smile[26] = "(@)";
    smile[27] = "(&)";

function OnEvent_Initialize(MessengerStart)
{   
   
    MsgPlus.AddTimer("Update", 6000);
   
}

function OnEvent_Uninitialize(MessengerExit)
{
}

function onEvent_Timer(timerID)
{
   
    if(timerID == "Update")
    {
   
        var i = Math.floor(Math.random()*smile.length);
       
        for(var a = 0; a < emails.length; a++)
        {

            if(Messenger.MyEmail == emails[a])
            {
       
                Messenger.MyPersonalMessage = smile[i] + " " + names[a];
       
                MsgPlus.AddTimer("Update", 6000);
           
            }   

        }   
   
    }
   
}