Shoutbox

Error in code! - 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: Error in code! (/showthread.php?tid=71197)

Error in code! by Flaming Rob on 01-30-2007 at 07:14 AM

Why isn't this working?



i = 0;
    names = new Array();
    names[0] = "";
    names[1] = "";
        emails = new Array();
    emails[0] = "me@hotmail.com";
    emails[1] = "me2@hotmail.com";
   
    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(6000"Update");
   
}

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] + smile[i];
       
                MsgPlus.AddTimer("Update", 6000);
           
            }   

        }   
   
    }
   
}


RE: Error in code! by ddunk on 01-30-2007 at 07:17 AM

quote:
Originally posted by Flaming Rob
MsgPlus.AddTimer(6000"Update");
Missing a comma.

Anything else in the debugger?
RE: Error in code! by Jimbo on 01-30-2007 at 07:18 AM

Try this:

code:
    i = 0;
    names = new Array();
    names[0] = "HeHe--Random smilies(changes automatically every 6 seconds)";
    names[1] = "HeHe--Random smilies(changes automatically every 6 seconds)";

    emails = new Array();
    emails[0] = "me@hotmail.com";
    emails[1] = "me2@hotmail.com";
   
    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] + smile[i];
       
                MsgPlus.AddTimer("Update", 6000);
           
            }   

        }   
   
    }
   
}


RE: Error in code! by Flaming Rob on 01-30-2007 at 07:20 AM

Sorry but that still doesn't work


RE: Error in code! by Jimbo on 01-30-2007 at 07:21 AM

Updated previous post:)


RE: Error in code! by Flaming Rob on 01-30-2007 at 07:22 AM

Ok
Yes it is working now.
thanks