What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Problem in my script ... ( second problem ^^ )

Pages: (3): « First « 1 [ 2 ] 3 » Last »
Problem in my script ... ( second problem ^^ )
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: Problem in my script ... ( second problem ^^ )
Usually if the debug window doesn't appear, in my experience, that means that theres an error.

The only problem I can find (I think) is that the notify function is trying to use a string ("Peace and Love :)"), not a path to a sound file... (I know the path would be a string anyway, you know what I mean :p)Maybe I'm reading it wrong.

As for:
code:
return '/all Je vais manger ! A + !';

I would probably use:
code:
Message = '/all Je vais manger ! A + !';
return Message

Probably unessacerry, or incorrect, but thats the way I like to do things :D

This post was edited on 08-30-2006 at 10:42 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
08-30-2006 10:37 PM
Profile PM Find Quote Report
Rekinmalad
New Member
*


Posts: 12
Joined: Aug 2006
O.P. RE: Problem in my script ... ( second problem ^^ )
For the debug box, it's not very important ... but i have a new problem :D

code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
    if(Message.substr(0,7) == "/manger"){
        notify("Bon appétit :)");
        Messenger.MyStatus = 9;
        Debug.Trace("Statut changé en 'lunch' (9)");
        return '/all Je vais manger ! A + !';
    }
    if(Message.substr(0,5) == "/dodo"){
        notify("Bonne nuit :)");
        Messenger.MyStatus = 7;
        notify("ATTENTION: vous etes toujours en ligne avec le statut Occupé.");
        Debug.Trace("Statut changé en 'away' (7)");
        return '/all Je vais coucher ! A + !';
    }
    if(Message.substr(0,4) == "/fou"){
        notify("Vous êtes fou ?!?");
        return '/all Je suis fou, tu le savais ?!?';
    }
    if(Message.substr(0,7) == "/retour"){
        notify("Vraiment content de vous revoir :)");
        Messenger.MyStatus = 3;
        Debug.Trace("Statut changé en 'online' (3)");
        return '/all Je suis de retour !!';
    }
    if(Message.substr(0,7) == "/occupé"){
        notify("Je vous laisse tranquille alors :)");
        Messenger.MyStatus = 4;
        Debug.Trace("Statut changé en 'busy' (4)");
        return 'Désolé ... je suis occupé ';
    }
    if(Message.substr(0,7) == "/occupe"){
        notify("Je vous laisse tranquille alors :)");
        Messenger.MyStatus = 4;
        Debug.Trace("Statut changé en 'busy' (4)");
        return 'Désolé ... je suis occupé :s';
    }
    if(Message.substr(0,11) == "/tphelp jeu"){
        notify("Aide sur les jeux lancée :)");
        Debug.Trace("Aide sur les jeux lancée.");
        alert('Aide sur la commande "jeu": 3 jeux reconnus: cs; fp et dofus. \n\nExemples:\n/jeu cs\n/jeu fp\n/jeu fp\n\n\nNOTE: La fonction /jeu envoies le message uniquement au contact dont vous etes sur la conversation. "/jeutous" envoie le message a tous les contacts dont une fenetre de conversation est ouverte.');
        return '';
    }
    if(Message.substr(0,4) == "/jeu"){
        if(Message.substr(4,2) == "cs"){
               notify("Bonne boucherie :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je charcute des gens a CS :D';
        }
        else if(Message.substr(4,2) == "fp"){
               notify("Bon frutijeux :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis occupé sur Frutiparc ! :D';
        }
        else if(Message.substr(4,5) == "dofus"){
               notify("Bonnes quetes ! Et faites attentions aux bouftous !");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis en train de jouer a Dofus !';
        }
        else {
            notify("Commande non reconnue ...");
        }
    }
    if(Message.substr(0,8) == "/jeutous"){
        if(Message.substr(8,2) == "cs"){
               notify("Bonne boucherie :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je charcute des gens a CS';
        }
        else if(Message.substr(8,2) == "fp"){
               notify("Bon frutijeux :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis occupé sur Frutiparc !';
        }
        else if(Message.substr(8,5) == "dofus"){
               notify("Bonnes quetes ! Et faites attentions aux bouftous !");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis en train de jouer a Dofus !';
        }
        else {
            notify("Commande non reconnue ...");
        }
    }
}
// DIVERS
function notify(msg){
    msg = MsgPlus.RemoveFormatCodes(msg);
    MsgPlus.DisplayToast("TextsPersos", msg, "");
}

function OnEvent_Initialize(MessengerStart)
{
    notify("Bienvenue :)");
    Messenger.MyStatus = 3;
    Debug.Trace("TEXTPERSOS est lancé. STATUS EN LIGNE");
}

function OnEvent_Uninitialize(MessengerExit)
{
    notify("Bye bye !");
    Debug.Trace("TEXTPERSOS est arrété.");
}
function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>manger</Name>';
            commands+='<Description>Signaler a vos contacts que vous partez manger.</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>dodo</Name>';
            commands+='<Description>Signaler a vos contacts que vous partez au dodo.</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>fou</Name>';
            commands+='<Description>Signalez a vos contacts que vous êtes complètement fou !</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>retour</Name>';
            commands+='<Description>Signalez a vos contacts que vous êtes de retour !</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>occupé</Name>';
            commands+='<Description>Signalez a votre contact que vous êtes occupé !</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>jeutous</Name>';
            commands+='<Description>Signalez a vos contacts que vous jouez ! ( "/tphelp jeu" pour l\'aide )</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>jeu</Name>';
            commands+='<Description>Signalez a votre contact que vous jouez ! ( "/tphelp jeu" pour l\'aide )</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>tphelp jeu</Name>';
            commands+='<Description>L\'aide de textPersos sur la commande "jeu"</Description>';
        commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}

The commands /jeu /jeutous and /tphelp jeu doesn't function >.<

Why ? :/
08-31-2006 11:35 AM
Profile E-Mail PM Find Quote Report
Silentdragon
Full Member
***

Avatar
if(life==null && wrists) EmoAlert();

Posts: 148
Reputation: 2
34 / Male / –
Joined: Jun 2006
RE: Problem in my script ... ( second problem ^^ )
I'm assuming you use a space between the second part of the command so, change the substrings for those functions by 1 character or you will end up getting the space with it.

ie
code:
Message.substr(4,2) == "cs"
should be
code:
Message.substr(5,2) == "cs"
08-31-2006 02:04 PM
Profile E-Mail PM Web Find Quote Report
Rekinmalad
New Member
*


Posts: 12
Joined: Aug 2006
O.P. RE: RE: Problem in my script ... ( second problem ^^ )
quote:
Originally posted by Silentdragon
I'm assuming you use a space between the second part of the command so, change the substrings for those functions by 1 character or you will end up getting the space with it.

ie
code:
Message.substr(4,2) == "cs"
should be
code:
Message.substr(5,2) == "cs"


and for "/tphelp jeu" ?

And for this:
code:
if(Message.substr(0,8) == "/jeutous"){
        if(Message.substr(9,2) == "cs"){
               notify("Bonne boucherie :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je charcute des gens a CS :D';
        }
        else if(Message.substr(9,2) == "fp"){
               notify("Bon frutijeux :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis occupé sur Frutiparc ! :D';
        }
        else if(Message.substr(9,5) == "dofus"){
               notify("Bonnes quetes ! Et faites attention aux bouftous ! :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis en train de jouer a Dofus !';
        }
        else {
            notify("Commande non reconnue ...");
        }
    }
When i send "/jeutous dofus", i have: a notify "Commande non reconnue" and a the normal function.

Why ?
08-31-2006 04:23 PM
Profile E-Mail PM Find Quote Report
Rekinmalad
New Member
*


Posts: 12
Joined: Aug 2006
O.P. RE: Problem in my script ... ( second problem ^^ )
Mu actually code:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
    if(Message.substr(0,7) == "/manger"){
        notify("Bon appétit");
        Messenger.MyStatus = 9;
        Debug.Trace("Statut changé en 'lunch' (9)");
        return '/all Je vais manger ! A + !';
    }
    if(Message.substr(0,5) == "/dodo"){
        notify("Bonne nuit");
        Messenger.MyStatus = 7;
        notify("ATTENTION: vous etes toujours en ligne avec le statut Occupé.");
        Debug.Trace("Statut changé en 'away' (7)");
        return '/all Je vais coucher ! A + !';
    }
    if(Message.substr(0,4) == "/fou"){
        notify("Vous êtes fou ?!?");
        return '/all Je suis fou, tu le savais ?!?';
    }
    if(Message.substr(0,7) == "/retour"){
        notify("Vraiment content de vous revoir");
        Messenger.MyStatus = 3;
        Debug.Trace("Statut changé en 'online' (3)");
        return '/all Je suis de retour !!';
    }
    if(Message.substr(0,7) == "/occupé"){
        notify("Je vous laisse tranquille alors");
        Messenger.MyStatus = 4;
        Debug.Trace("Statut changé en 'busy' (4)");
        return 'Désolé ... je suis occupé ';
    }
    if(Message.substr(0,7) == "/occupe"){
        notify("Je vous laisse tranquille alors :)");
        Messenger.MyStatus = 4;
        Debug.Trace("Statut changé en 'busy' (4)");
        return 'Désolé ... je suis occupé :s';
    }
    if(Message.substr(0,7) == "/tphelp"){
        if(Message.substr(8,11) == "jeu"){
            notify("Aide sur les jeux lancée :)");
            Debug.Trace("Aide sur les jeux lancée.");
            alert('Aide sur la commande "jeu": 3 jeux reconnus: cs; fp et dofus. \n\nExemples:\n/jeu cs\n/jeu fp\n/jeu fp\n\n\nNOTE: La fonction /jeu envoies le message uniquement au contact dont vous etes sur la conversation. "/jeutous" envoie le message a tous les contacts dont une fenetre de conversation est ouverte.');
            return '';
        } else {
            notify("Cette rubrique d'aide n'a pas été trouvée.");
        }
    }
    if(Message.substr(0,4) == "/jeu"){
        if(Message.substr(5,2) == "cs"){
               notify("Bonne boucherie :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je charcute des gens a CS :D';
        }
        else if(Message.substr(5,2) == "fp"){
               notify("Bon frutijeux :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis occupé sur Frutiparc ! :D';
        }
        else if(Message.substr(5,5) == "dofus"){
               notify("Bonnes quetes ! Et faites attention aux bouftous ! :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis en train de jouer a Dofus !';
        }
        else {
            notify("Jeu non reconnu. Pour de l'aide, tapez \"/tphelp jeu\" !");
        }
    }
    if(Message.substr(0,8) == "/jeutous"){
        if(Message.substr(9,2) == "cs"){
               notify("Bonne boucherie :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je charcute des gens a CS :D';
        }
        else if(Message.substr(9,2) == "fp"){
               notify("Bon frutijeux :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis occupé sur Frutiparc ! :D';
        }
        else if(Message.substr(9,5) == "dofus"){
               notify("Bonnes quetes ! Et faites attention aux bouftous ! :)");
               Messenger.MyStatus = 4;
               Debug.Trace("Statut changé en 'busy' (4)");
               return 'Désolé, je suis en train de jouer a Dofus !';
        }
        else {
            notify("Jeu non reconnu. Pour de l'aide, tapez \"/tphelp jeu\" !");
        }
    }
}
// DIVERS
function notify(msg){
    msg = MsgPlus.RemoveFormatCodes(msg);
    MsgPlus.DisplayToast("TextsPersos", msg, "");
}

function OnEvent_Initialize(MessengerStart)
{
    notify("Bienvenue :)");
    Messenger.MyStatus = 3;
    Debug.Trace("TEXTPERSOS est lancé. STATUS EN LIGNE");
}

function OnEvent_Uninitialize(MessengerExit)
{
    notify("Bye bye !");
    Debug.Trace("TEXTPERSOS est arrété.");
}
function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>manger</Name>';
            commands+='<Description>Signaler a vos contacts que vous partez manger.</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>dodo</Name>';
            commands+='<Description>Signaler a vos contacts que vous partez au dodo.</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>fou</Name>';
            commands+='<Description>Signalez a vos contacts que vous êtes complètement fou !</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>retour</Name>';
            commands+='<Description>Signalez a vos contacts que vous êtes de retour !</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>occupé</Name>';
            commands+='<Description>Signalez a votre contact que vous êtes occupé !</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>jeutous</Name>';
            commands+='<Description>Signalez a vos contacts que vous jouez ! ( "/tphelp jeu" pour l\'aide )</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>jeu</Name>';
            commands+='<Description>Signalez a votre contact que vous jouez ! ( "/tphelp jeu" pour l\'aide )</Description>';
        commands+='</Command>';
        commands+='<Command>';
            commands+='<Name>tphelp</Name>';
            commands+='<Description>L\'aide de textPersos.</Description>';
        commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}

The problems: When i send "/jeutous dofus", i have the error ... WHY ? :'(
When i send "/tphelp jeu", i have an error too.

But "/jeu dofus" is perfect ... i don't understand :/
08-31-2006 04:33 PM
Profile E-Mail PM Find Quote Report
Silentdragon
Full Member
***

Avatar
if(life==null && wrists) EmoAlert();

Posts: 148
Reputation: 2
34 / Male / –
Joined: Jun 2006
RE: Problem in my script ... ( second problem ^^ )
/jeutous dofus works for me, and as for /tphelp jeu remove this line
code:
alert('Aide sur la commande "jeu": 3 jeux reconnus: cs; fp et dofus. \n\nExemples:\n/jeu cs\n/jeu fp\n/jeu fp\n\n\nNOTE: La fonction /jeu envoies le message uniquement au contact dont vous etes sur la conversation. "/jeutous" envoie le message a tous les contacts dont une fenetre de conversation est ouverte.');

There's no alert function.
08-31-2006 04:44 PM
Profile E-Mail PM Web Find Quote Report
Rekinmalad
New Member
*


Posts: 12
Joined: Aug 2006
O.P. RE: Problem in my script ... ( second problem ^^ )
Euh, /jeutous dofus, for me, works for her function, but i have another notify:
            notify("Jeu non reconnu. Pour de l'aide, tapez \"/tphelp jeu\" !");

and for alert, i want a function for affich a message for the user ...
08-31-2006 04:58 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: Problem in my script ... ( second problem ^^ )
quote:
Originally posted by Rekinmalad
and for alert, i want a function for affich a message for the user ...


code:
Interop.Call("User32", "MessageBoxW", 0, "Message\n\n/Line 2", "Heading", 0);
Is that what you want?
08-31-2006 05:03 PM
Profile E-Mail PM Web Find Quote Report
Rekinmalad
New Member
*


Posts: 12
Joined: Aug 2006
O.P. RE: Problem in my script ... ( second problem ^^ )
yes, for the alert: no problem. But for the function "/jeutous", i have the good command, and i have the error message too ( notify("Jeu non reconnu. Pour de l'aide, tapez \"/tphelp jeu\" !"); )

Why ? For the command "/jeu" i haven't this problem.

This post was edited on 08-31-2006 at 05:16 PM by Rekinmalad.
08-31-2006 05:15 PM
Profile E-Mail PM Find Quote Report
Rekinmalad
New Member
*


Posts: 12
Joined: Aug 2006
O.P. RE: Problem in my script ... ( second problem ^^ )
for my script, no problem, i have reppear my own script ^^

But for export the script at plsc, that's a another problem ...

I have created a ZIP file. I have drop my js file into this zip. I have rename the *.zip at plsc, and when i want open the plsc, i have an error. He say me this is not a valid scripting pack. Why ?
08-31-2006 09:20 PM
Profile E-Mail PM Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


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