Shoutbox

Script :Need Some 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: Script :Need Some Help (/showthread.php?tid=74795)

Script :Need Some Help by shadetoll on 05-28-2007 at 07:39 PM

Hi,

I want to create a script which allow:

1) When someone new speak to me and his/her Window is closed open one.
2) The first sending message will be said by a Ms Agent.


Per Example: Higter signs in   and speaks to me "Hi"  Ms Agent said "Hi"  but not "How Are You ??"  Blablabla.

Like this I Heard him and speak with him.


Because i've mananged to do  A script that tell everytime message from my friend.


code:
function OnEvent_ChatWndCreated (Chatwndtest){
OnEvent_ChatWndReceiveMessage(ChatWndtest,Origin,Message,MessageKind);
if (Origin != Messenger.Myname)
    {
        if (MessageKind = 1)
        {
         merlin.Show(); // Shows Merlin
         sayMessage = Origin + " says: " + Message;
            saythat = MsgPlus.RemoveFormatCodes(saymessage);
         merlin.Speak (saythat); // Makes Merlin say the string, "saythat"
        }
    }

}



Ty for your help
RE: Script :Need Some Help by roflmao456 on 05-28-2007 at 07:55 PM

code:
var talk = false;
function OnEvent_ChatWndCreated(Chatwndtest){
talk = true;
}

function OnEvent_ChatWndReceiveMessage(ChatWndtest,Origin,Message,MessageKind){
if (Origin != Messenger.MyName && MessageKind == 1 && talk == true)
{
     merlin.Show(); // Shows Merlin
     sayMessage = Origin + " says: " + Message;
     sayMessage = MsgPlus.RemoveFormatCodes(sayMessage);
     merlin.Speak (sayMessage); // Makes Merlin say the variable
     talk = false;
     }
}

should work
RE: RE: Script :Need Some Help by Volv on 05-29-2007 at 09:52 AM

quote:
Originally posted by roflmao456
code:
var talk = false;
function OnEvent_ChatWndCreated(Chatwndtest){
talk = true;
}

function OnEvent_ChatWndReceiveMessage(ChatWndtest,Origin,Message,MessageKind){
if (Origin != Messenger.MyName && MessageKind == 1 && talk == true)
{
     merlin.Show(); // Shows Merlin
     sayMessage = Origin + " says: " + Message;
     sayMessage = MsgPlus.RemoveFormatCodes(sayMessage);
     merlin.Speak (sayMessage); // Makes Merlin say the variable
     talk = false;
     }
}

should work

That's not a very good method and in fact will not work in the following scenario:
Person A opens a conversation with you
Person B opens a conversation with you
Person A messages you <-- MSagent will appear as planned
Person B messages you <-- Nothing will happen.

What you would probably need is for the variable talk to be replaced with an array which can be indexed with the window handle or something - that way the Agent will appear for the first message in every conversation window.