Skip to main content

A Small HTML file using Microsoft Agent

<Html>
<Head>
 <Title>X-Mas Greetings ...Designed and Developed by M. Vadivel </Title>
</Head>
<Body bgcolor=black>
<!--
Sets or retrieves the URL of the component. If the value for version is set as -1 the component is downloaded from the server if the release date is later than the installation date on the client computer. If the compnent is installed on the client computer and the release date is the same or earlier than the installation date only an HTTP header transaction occurs.

The below line would take care of installing the agent control and the TTS engine if it is not already present in the end
user PC
-->

<OBJECT ID="AgentControl" width=0 height=0 CLASSID="CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F" CODEBASE="#VERSION=2,0,0,0">
</OBJECT>

<OBJECT ID="TruVoice" width=0 height=0 CLASSID="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575" CODEBASE="#VERSION=6,0,0,0">
</OBJECT>

<Script language=VBScript>
Dim Genie
Sub window_OnLoad
  AgentControl.Connected = True ' needed for IE3
  AgentControl.Characters.Load "Genie", "http://agent.microsoft.com/agent2/chars/genie/genie.acf"
  Set Genie = AgentControl.Characters("Genie")
  Genie.LanguageID = &H0409 ' needed under some conditions (English)
  Genie.Get "state", "Showing, Speaking"
  Genie.Get "animation", "DoMagic2, DoMagic2Return"
  Genie.Show
  Genie.Get "state", "Hiding"

  Genie.Play "DoMagic2"
  Genie.Speak "Dear friends Merry Chrismas."
End Sub
</Script>

</Body>
</Html>

Till the above line save it as a HTML file. On firing that HTML you could see the Genie in action :)

There are lots of animation effects which comes along with Genie (BTW there are lots of other character as well like Merlin, Robbie, Peddy etc., You know what? we can create our own Character as well). Some of the other animations which I used while preparing a diwali greetings are as follows:

1. "Announce, AnnounceReturn"
2. "Explain, ExplainReturn"
3. "Pleased, PleasedReturn"
4. "Suggest, SuggestReturn"
5. "Think, ThinkReturn"
6. "Process, ProcessReturn"
7. "DoMagic1, DoMagic1Return"
8. "Wave, WaveReturn"

The complete list of possible animations of Genie is here. For creating your own character check this.

But when I was developing the application I wasn't aware about these links, so I downloaded the Character (Genie) and referenced it in a Visual Basic application and from it I got all the animation effects :) If anyone needs that diwali greetings which I developed using this Agent control do get in touch with me.

Comments

Popular posts from this blog

Registry manipulation from SQL

Registry Manupulation from SQL Server is pretty easy. There are 4 extended stored procedure in SQL Server 2000 for the purpose of manupulating the server registry. They are: 1) xp_regwrite 2) xp_regread 3) xp_regdeletekey 4) xp_regdeletevalue Let us see each one of them in detail! About xp_regwrite This extended stored procedure helps us to create data item in the (server’s) registry and we could also create a new key. Usage: We must specify the root key with the @rootkey parameter and an individual key with the @key parameter. Please note that if the key doesn’t exist (without any warnnig) it would be created in the registry. The @value_name parameter designates the data item and the @type the type of the data item. Valid data item types include REG_SZ and REG_DWORD . The last parameter is the @value parameter, which assigns a value to the data item. Let us now see an example which would add a new key called " TestKey ", and a new data item under it called TestKeyValue :

Screen scraping using XmlHttp and Vbscript ...

I wrote a small program for screen scraping any sites using XmlHttp object and VBScript. I know I haven't done any rocket science :) still I thought of sharing the code with you all. XmlHttp -- E x tensible M arkup L anguage H ypertext T ransfer P rotocol An advantage is that - the XmlHttp object queries the server and retrieve the latest information without reloading the page. Source code: < html > < head > < script language ="vbscript"> Dim objXmlHttp Set objXmlHttp = CreateObject("Msxml2.XMLHttp") Function ScreenScrapping() URL == "UR site URL comes here" objXmlHttp.Open "POST", url, False objXmlHttp.onreadystatechange = getref("HandleStateChange") objXmlHttp.Send End Function Function HandleStateChange() If (ObjXmlHttp.readyState = 4) Then msgbox "Screenscrapping completed .." divShowContent.innerHtml = objXmlHttp.responseText End If End Function </ script > < head > < body > &l

Script table as - ALTER TO is greyed out - SQL SERVER

One of my office colleague recently asked me why we are not able to generate ALTER Table script from SSMS. If we right click on the table and choose "Script Table As"  ALTER To option would be disabled or Greyed out. Is it a bug? No it isn't a bug. ALTER To is there to be used for generating modified script of Stored Procedure, Functions, Views, Triggers etc., and NOT for Tables. For generating ALTER Table script there is an work around. Right click on the table, choose "Modify" and enter into the design mode. Make what ever changes you want to make and WITHOUT saving it right click anywhere on the top half of the window (above Column properties) and choose "Generate Change Script". Please be advised that SQL Server would drop actually create a new table with modifications, move the data from the old table into it and then drop the old table. Sounds simple but assume you have a very large table for which you want to do this! Then it woul