What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » MS Agent

MS Agent
Author: Message:
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
O.P. MS Agent
So, I'm just making me a little agent which will sit on top of all my Windows and read my MSN messages (I've disabled TTS, that was annoying! but I like the balloon). It works great, except... the balloon displays each word individually... and that's really annoying.

I got the PropertySheet up (that was a nuisance!) but there doesn't seem to be an option for this, only for disabling the balloon completely. Not what I want obviously.

Anyone know a way for it just to show the full message?
Ta.

PS: For those interested, in VB .NET you can add a reference to the MS Agent Server 2.0 thing, and use this code:
code:
Dim server As AgentServerObjects.AgentServer = New AgentServerObjects.AgentServer
Dim tv As AgentServerObjects.IAgentPropertySheet = server
tv.SetVisible(True)
To show the property pages.
[Image: AndrewsStyle.png]
10-28-2008 12:03 AM
Profile E-Mail PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: MS Agent
well, what's your code to make it talk?
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
10-28-2008 03:26 AM
Profile PM Web Find Quote Report
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
O.P. RE: MS Agent
code:
var AgentServer;
var AgentChar;

function OnEvent_Initialize(MessengerStart)
{
    AgentServer = new ActiveXObject("agent.control.2");
    AgentServer.Connected = true;
    AgentServer.Characters.Load("Pikachu","C:\\WINDOWS\\msagent\\chars\\Pikachu.acs");
    AgentChar = AgentServer.Characters.Character("Pikachu");
    AgentChar.Show();
}

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind) {
    if(Origin != Messenger.MyName)
        AgentChar.Speak(Origin + ": " + Message);   
}

Basically exactly what -dt- posted in the scripting sticky. :)

This post was edited on 10-28-2008 at 03:08 PM by andrewdodd13.
[Image: AndrewsStyle.png]
10-28-2008 03:06 PM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: MS Agent
quote:
BOOL Speak(CString szSpeakText, BOOL bBalloonEnabled = TRUE, BOOL bBalloonSizeToText = TRUE, BOOL bBalloonAutoPace = TRUE, BOOL bBalloonAutoHide = TRUE);


The specified text is shown in a message box and if a sound card and Text to speech support is installed the given text is spoken out. Setting Auto Pace to FALSE makes the text displayed in the message box appear at once rather than a word at a time.

This post was edited on 10-28-2008 at 07:50 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
10-28-2008 07:48 PM
Profile PM Find Quote Report
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
O.P. RE: MS Agent
Argh, I didn't even think to look at the documentation for the actual function.

Thanks :)

Edit. So that's not Microsoft's documentation nor their function. So I need to wrap the following:
code:
BOOL CMsAgentWrapper::Speak(CString szSpeakText,BOOL bBalloonEnabled,BOOL bBalloonSizeToText,BOOL bBalloonAutoPace,BOOL bBalloonAutoHide)
{
    if(m_bAgentReady == FALSE)
        return TRUE;
    szSpeakText.TrimLeft();
    szSpeakText.TrimRight();
    if(szSpeakText.IsEmpty())
        return FALSE;
    if(m_pszCurCharID == NULL)
        return FALSE;

    CAgentCtlCharacterEx Character;
    COleVariant vEmpty;
    COleVariant vText;
    CString pszText;
    UINT uBalloonFlags;

    uBalloonFlags = 0;

    Character = m_obAgent.GetCharacters().Character(m_pszCurCharID);

    if (bBalloonEnabled)
        uBalloonFlags |= BALLOON_STYLE_BALLOON_ON;

    if (bBalloonSizeToText)
        uBalloonFlags |= BALLOON_STYLE_SIZETOTEXT;

    if (bBalloonAutoPace)
        uBalloonFlags |= BALLOON_STYLE_AUTOPACE;

    if (bBalloonAutoHide)
        uBalloonFlags |= BALLOON_STYLE_AUTOHIDE;

    Character.GetBalloon().SetStyle((long)uBalloonFlags);

    if (m_bStopBeforePlay)
        Character.StopAll(vEmpty);

    vText = szSpeakText;

    Character.Speak(vText, vEmpty);
    return TRUE;
}
But, I can't seem to call Character.GetBalloon() ! :(

(I would imagine all I need to do is set a certain bit and call Character.GetBalloon().SetStyle(my bits);
But like I said, the function doesn't work.:)

This post was edited on 10-28-2008 at 11:43 PM by andrewdodd13.
[Image: AndrewsStyle.png]
10-28-2008 11:23 PM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: MS Agent
You may be able to do something with this...

http://www.codeproject.com/KB/tips/msagentctrl.aspx

The only alternative is using msagent.think(), but I'm guessing you want the tts?
<Eljay> "Problems encountered: shit blew up" :zippy:
10-29-2008 09:40 AM
Profile PM Find Quote Report
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
O.P. RE: MS Agent
The link happens to be where I pulled the source code from. :P

think() does the same thing as speak() for some reason.

Guess I could just code an MFC DLL and export it if I really have to.
[Image: AndrewsStyle.png]
10-29-2008 04:17 PM
Profile E-Mail PM Web Find Quote Report
« 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