Shoutbox

Need some serious scripting help! - 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: Need some serious scripting help! (/showthread.php?tid=69605)

Need some serious scripting help! by sljaxon on 12-17-2006 at 03:29 PM

Hello, I haven't been around in a while :D

I have been scripting, almost everything for my script should work as I see, but it does not. The bug appears to be in this stretch of code:

code:
function ExtendPSM(psm)
{
    spsm = psm;
    if(psm.Length >= 129)
    {
        Messenger.MyPersonalMessage = psm.Substring(0,129);
        MsgPlus.AddTimer('first',100);
    }
    else
    {
        Messenger.MyPersonalMessage = psm;
    }
}

function OnEvent_Timer(TimerId)
{
    if(TimerId=='first')
    {
        FurtherPSM(129);
        MsgPlus.AddTimer('second',100);
    }

    if(TimerId=='second')
    {
        FurtherPSM(258);
        MsgPlus.AddTimer('third',100);
    }

    if(TimerId=='third')
    {
        FurtherPSM(387);
        MsgPlus.AddTimer('fourth',100);
    }
    if(TimerId=='fourth')
    {
        FurtherPSM(515);
    }
   
}

function FurtherPSM(charFrom)
{
    Messenger.MyPersonalMessage = spsm.Substring(charFrom,charFrom+129);
}

Does anybody see a bug there?
This is for the contest, so a prompt reply would be appreciated.
RE: Need some serious scripting help! by J-Thread on 12-17-2006 at 03:32 PM

Replace Substring by substring;)