locked
MSAgents in SB - SBAgents RRS feed

  • General discussion

  • @LitDev

    Here's german xml for LitDev_v1-0-0-102

    (No typos discovered :-),  Added in De.xml for:
    .IncludeCS - paramname=assemblies  -> ""  for auto reference/load    and
    .IncludeVB - paramname=assemblies  -> ""  for auto reference/load.

    MSAgent for SB:

    MSAgents (although little outdated) were the burner in the 00's, but kids love them and, I must admit, me too.
    So I'm messin' around quite a few weeks to bring them to live in SB (eg. via LDInline).
    Found a lot of infos and samples for MSAgent in C# (COM) eg:

    Creating-Cool-Agent-User-Interfaces    (and lots more on CodeProject)

    about same article on MSDN  and .. Request on CP

    Programming-Microsoft-Agent-in-Windows-Forms (same on JustLikeAMagic  and  CodeGain)How-to-use-Microsoft-Agent-in-C

    UsingMicrosoftAgentwithCSharp  (and some more on CSharpCorner)

    UsingMSAgentinCSharpPartI , UsingMSAgentinCSharpPartII  , UsingMSAgentinCSharpPartIII  , MSAgent-in-windows-forms

    Further: MSSpeech Agent MSAgentPage1

    MSDN MSAgent  (like in msagent.chm from Platform SDK).

    and finally from mea alma mater H.Mössenböck's book C# to the Point  (but could not find out about what's 'AgentNET' class).

    PS: a very small collection of character files here :-) (~370 MB): ACS Files  , MSAgent basic files.

    Lots of Agent sites are down but their sites and downloads are to find in the Archives.

    Unfortunaltely i could not find a single example in extension for Extension Method.

    I don't know if its possible for SB extension at all. The other methods (Speak, GoTo etc) should not be too hard,
    but my ultimate problem is to initialisize the agent at first.

    Refering to first upper side Creating-Cool-Agent-User-Interfaces:

    which compiles and runs fine (needs AgentObjects.dll and AxAgentObjects.dll in same directory, created from %ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\AxImp.exe %windir%\msagent\agentctl.dll)
    this is the main excerpt of my SBAgent.cs so long:

    using System;
    using System.IO;
    using AgentObjects;
    using Microsoft.SmallBasic.Library;

    namespace SBTools
    {
        // http://www.codeproject.com/Articles/1138/Creating-Cool-Agent-User-Interfaces
        /// <summary>Funktions for MSAgents.</summary>
        [SmallBasicType]
        public static class SBAgent
        {
            private const string AgentPath = @"C:\Windows\MSAgent\chars\";
            private static AxAgentObjects.AxAgent AxAgent;
            private static IAgentCtlCharacterEx Character;
            
            /// <summary>Gets names of all characters in MSAgent\chars folder.</summary>
            /// <returns>The names of all available MSAgent charakters als Array.</returns>
            public static Primitive GetChars()
            {
                Primitive files = new Primitive();
                foreach(string file in Directory.GetFiles(AgentPath, "*.acs"))
                files[files.GetItemCount() + 1] = Path.GetFileNameWithoutExtension(file);
                return files;
            }
            
            /// <summary>Show the specified MSAgent charakter.</summary>
            /// <param name="Name">The name of the charakter.</param>
            /// <returns>The Name of the character.</returns>
            public static Primitive Show(Primitive Name)
            {
                //try { AxAgent.Characters.Unload("CharacterID"); }
                //catch { }

                AxAgent.Characters.Load("CharacterID", (object)AgentPath + Name + ".acs");
                Character = AxAgent.Characters["CharacterID"];
                // Character.LanguageID = 0x407;
                Character.Show(null);
                return Character.Name;
                // TextToSpeak.Enabled = true;
            }
            
        }
    }

    The sample compiles with  SBAgent.cs(15,41): warning CS0649: "The Field "SBTools.SBAgent.AxAgent" is never assigned something, and it always has its default value of "null", and causes exception in SB: "Object reference not set to an object instance".
    I tried lots of different C# failures but i'm too dumb and my CSharp skills are still too low to initialize (WinForms) a single character or let one appear.

    So i hope for 'a little help of my friends' to show, how to make a character initially show up in SB, if that's possible at all (initialize WinForms) !?

    Thanks



    Sunday, March 23, 2014 8:55 PM
    Answerer

All replies

  • Thanks for de xml.

    I don't know much about agents - remember a strange paper clip guy in excel.

    It looks like this is something MS abandoned, but still could be fun in SB.

    Sunday, March 23, 2014 10:30 PM
  • Yeah,

    i guess that's ol ClippIt.

    PS: Just found what's AgentNET from upper BookSample (Mössenböck). Here COM Interoperability Demo  (under Applications).

    code.zip contains Interop.AgentObjects.dll  and a sample i'll try this week.

    Maybe interesting for gungan37 could be Compiler Construction Course

    And maybe interesting for Nonki would be With this Go-Editor you can play Go against a human or computer opponent

    Sunday, March 23, 2014 10:58 PM
    Answerer
  • Pappa Lapub, interesting idea!  I loved a dolphin agent "Kairu" in Office 2000.

    Nonki Takahashi

    Monday, March 24, 2014 1:53 AM
  • Hi Nonki,

    got it and html source contains link to dolphin.EXE. But unfortunately:

    1998-05-04 15:51:10 ....A       890749               dolphin.act  !!!

    Native language versions provided extra representations such as Kairu the dolphin in Japanese
    Kairu the Dolphin (available for East Asian editions, downloadable for Office 97). Kairu is only available in Office 97. Closest to Kairu there is Sharky



    Monday, March 24, 2014 2:44 AM
    Answerer
  • So, it's makeable in SB!!

    SBAgent_EN.zip

    contains all that's needed. But its only a first feasibility Demo of an extension, to see if its possible at all. And it WORKS.But i'm absolutely not sure if it also works without installed MSAgents core components and TTS speech engine.

    Can't test because all machines i have access to (XP-32,W7 32/64) have installed them. So, if someone, who has'nt installed MSAgents will try it, i would be interested in a FB. Nonetheless Merlin.acs is neccessary at any rate (in C:\Windows\MSAgent\chars). Links included.

    Merlin Demo will abort on keypress, mousemove/-click. Don't know why??

    Tuesday, March 25, 2014 6:52 PM
    Answerer
  • It fails for me (W7 64) without installing MSAgents core.  Included Merlin.acs and Interop.AgentObjects.dll as described.

    Tuesday, March 25, 2014 8:40 PM
  • Ok, thanks LitDev.

    That's what i expected. If Merlin doesn't even show up silent w/o sound or balloon, the component files are required.

    Thx

    Tuesday, March 25, 2014 9:58 PM
    Answerer
  • This is hilarious! So what were thinking, Pappa? An extension in Small Basic that runs over Small Basic and gives you advice? Not sure if that's possible, but it's hilarious!!!

    Ed Price, Power BI & SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Wednesday, March 26, 2014 11:32 PM
  • Oh! Hi Ed, Please excuse my late reply.
    After i have asserted that's possible to make a digital pictureframe/-viewer, change pics by click(s) forw/back and let an MSAgent character announce current imagename in SB i had to prove that it's not only warm air.
    I'm rather sure its possible (Agent already shows up, speaks w balloon and animates)
    Not the way you know it from old office versions, but it's possible to eg. read text, clipboard content, announce time or audio track, show as a reminder or simply perform screenplays etc, aso....
    MsAgent & TTS engine run in it's own COM environment, which can be accessed via an extension (eg. search 'MSAgent in csharp' gives lots of links) from SB.
    So SB's only a kind of IO-frontend to the MSAgent COM. (like eg.Agent Screen Saver Script Generator on Microsoft Agent Software and lots of similar sites 'n tools. So i hope  to try on (as far as limited CS skills and available time allows). Maybe find some time around easter. Happy eggs bumpin'.

    Tuesday, April 15, 2014 8:07 PM
    Answerer