Shoutbox

Problem in my script ... ( second problem ^^ ) - 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: Problem in my script ... ( second problem ^^ ) (/showthread.php?tid=65531)

Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-29-2006 at 09:38 AM

Hello world !

i'm french so i can't search efficacely ( oh ? xD )

So i need help, i want change the user's status in my script ... the real problem is i don't can't change status so i want think what is the command for change status.

( Sorry for my language, if you don't understand un will use google traduction xD )


RE: Change user status by RaceProUK on 08-29-2006 at 10:39 AM

Messenger.MyStatus = <status number>;

If I have remembered that right. The numbers are in the docs.


RE: Change user status by Rekinmalad on 08-29-2006 at 03:10 PM

Yes, the numbers are in the docs. Thank you, i'm going to test that now ^^

:)


I've a problem, my script bug ...

code:
Messenger.MyStatus = 3;
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
    if(Message=="/manger"){
        notify("Bon appétit :)");
        return '/all Je vais manger ! A + !';
        Messenger.MyStatus = 9;
        Debug.Trace("Statut changé en 'lunch' (9)");
    }
    if(Message=="/dodo"){
        notify("Bonne nuit :)");
        return '/all Je vais coucher ! A + !';
        Messenger.MyStatus = 7;
        notify("ATTENTION: vous etes toujours en ligne avec le statut Occupé.");
        Debug.Trace("Statut changé en 'away' (7)");
    }
    if(Message=="/fou"){
        notify("Vous êtes fou ?!?");
        return '/all Je suis fou, tu le savais ?!?';
    }
    if(Message=="/retour"){
        notify("Vraiment content de vous revoir :)");
        return '/all Je suis de retour !!';
        Messenger.MyStatus = 3;
        Debug.Trace("Statut changé en 'online' (3)");
    }
    if(Message=="/occupé"){
        notify("Je vous laisse tranquille alors :)");
        return 'Désolé ... je suis occupé :s';
        Messenger.MyStatus = 4;
        Debug.Trace("Statut changé en 'busy' (4)");
    }
    if(Message=="/occupe"){
        notify("Je vous laisse tranquille alors :)");
        return 'Désolé ... je suis occupé :s';
        Messenger.MyStatus = 4;
        Debug.Trace("Statut changé en 'busy' (4)");
    }
}
// DIVERS
function notify(msg){
    msg = MsgPlus.RemoveFormatCodes(msg);
    MsgPlus.DisplayToast("TextsPersos", msg, "Peace And Love :)");
}

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 contacts que vous êtes occupé !</Description>';
        commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}

This is my script (in french, i'm french ...) but my status doesn't change and i've have not debug box ( it's activated in my prefs ) and for "/dodo", the second notify don't appear ...

PLEASE, HELP ME :'( :'( :'(
RE: Problem in my script ... ( second problem ^^ ) by Felu on 08-29-2006 at 03:44 PM

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é ';
    }
}
// DIVERS
function notify(msg){
    msg = MsgPlus.RemoveFormatCodes(msg);
    MsgPlus.DisplayToast("TextsPersos", msg, "Peace And Love ");
}

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 contacts que vous êtes occupé !</Description>';
        commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}
Use that code code. Just make sure everything is done before returning, nothing can be done after returning [Image: msn_wink.gif].
RE: Problem in my script ... ( second problem ^^ ) by Reload2 on 08-29-2006 at 04:13 PM

Here's the link of the french forum, if it can help: http://www.mess-france.com/forum/index.php


RE: Problem in my script ... ( second problem ^^ ) by RaceProUK on 08-30-2006 at 10:05 AM

quote:
Originally posted by Rekinmalad
if(Message=="/manger"){
notify("Bon appétit (Smilie)");
return '/all Je vais manger ! A + !';
Messenger.MyStatus = 9;
Debug.Trace("Statut changé en 'lunch' (9)");
}
You do know what a return statement does, yes?
RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-30-2006 at 08:45 PM

Oh yes i'm a terrible idiot xD

But the debug box don't appear, and she is activated in my prefs ... strange ...

ah, also, what I have to do to export my script has a *.plsc ?


RE: Problem in my script ... ( second problem ^^ ) by boston on 08-30-2006 at 08:55 PM

you have to use winAce or Winrar or your plsc zipper
and then post reply or edit and attachments browse
if it doesnt open with msgplus live put it in to a zipped file and put the plsc in there

jope it help :D;)


RE: Problem in my script ... ( second problem ^^ ) by matty on 08-30-2006 at 09:02 PM

Simply create a zip file and rename the .zip to .plsc.
You can use the Windows BuiiltIn zip or WinZIp or WInRAR or WinAce or 7GZip as long as it is a zip file you will be ok.

quote:
Originally posted by Rekinmalad
Oh yes i'm a terrible idiot xD

But the debug box don't appear, and she is activated in my prefs ... strange ...

Because when you use return in a function no code after it is executed.

if i want to put something in the debug window i would need to do this
code:
function somefunction(){
    Debug.Trace('hi');
    return 'hi'; // ---- no code is executed after this line
}

RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-30-2006 at 10:25 PM

I have changed my code :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é ';
    }
}
// DIVERS
function notify(msg){
    msg = MsgPlus.RemoveFormatCodes(msg);
    MsgPlus.DisplayToast("TextsPersos", msg, "Peace And Love :)");
}

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 contacts que vous êtes occupé !</Description>';
        commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}

And the debug box don't appear ^^
RE: Problem in my script ... ( second problem ^^ ) by Spunky on 08-30-2006 at 10:37 PM

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
RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-31-2006 at 11:35 AM

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 ? :/
RE: Problem in my script ... ( second problem ^^ ) by Silentdragon on 08-31-2006 at 02:04 PM

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"

RE: RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-31-2006 at 04:23 PM

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 ?
RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-31-2006 at 04:33 PM

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 :/
RE: Problem in my script ... ( second problem ^^ ) by Silentdragon on 08-31-2006 at 04:44 PM

/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.
RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-31-2006 at 04:58 PM

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 ...


RE: Problem in my script ... ( second problem ^^ ) by Felu on 08-31-2006 at 05:03 PM

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?
RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-31-2006 at 05:15 PM

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.


RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-31-2006 at 09:20 PM

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 ?


RE: Problem in my script ... ( second problem ^^ ) by Silentdragon on 08-31-2006 at 09:23 PM

You need a ScriptInfo.xml file to go with it

Example from the docs

code:
<ScriptInfo>   
    <Information>
        <Name>My First Script</Name>
        <Description>This is my first script.</Description>
        <AboutUrl>http://www.msgpluslive.net</AboutUrl>
    </Information>
</ScriptInfo>


The documentation has more info if you need it.
RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-31-2006 at 10:13 PM

I've the same problem. In my zip, i have: my script as textPersos.js and a xml file: ScriptInfo.xml

And i have an error. Why ? >.<


RE: Problem in my script ... ( second problem ^^ ) by Spunky on 08-31-2006 at 10:15 PM

You may need to check that the ScriptInfo.xml file is saved as unicode (16?)


RE: Problem in my script ... ( second problem ^^ ) by Rekinmalad on 08-31-2006 at 10:27 PM

as unicode ? euh i don't know ...

Ah, that's good now, he was sauved as AINSI ... :)

Thank you very very very very very [ ... ] much :)