' Find an agent you already have installed at %windir%\msagent\chars ' use the filename without the extension strAgentName = "Merlin" ' The full url to your email program, use triple quotes when you have spaces in the path. emailProgramPath = """D:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE""" ' Your internet home page you want webHomePage = "http://www.google.com" '====================================================================== '====================================================================== '====================================================================== ' DON'T CHANGE ANYTHING BELOW HERE '====================================================================== '====================================================================== '====================================================================== on error resume next dim wshshell,windir2 Set wshShell = wscript.CreateObject("Wscript.Shell") Set EnvVar = wshShell.Environment("PROCESS") WinDir = EnvVar.Item("WinDir") Set EnvVar = nothing set wshshell = nothing If IsAgentInstalled() Then ' Agent Installed 'wscript.echo "ready to play" Else ' Agent Not Installed wscript.quit End If strAgentPath = WinDir & "\msagent\chars\" & strAgentName & ".acs" Set objAgent = WScript.CreateObject("Agent.Control.2","MSAgent_") objAgent.Connected = TRUE objAgent.Characters.Load strAgentName, strAgentPath Set objCharacter = objAgent.Characters.Character(strAgentName) objCharacter.Show objCharacter.Play "GetAttention" objCharacter.listen false Dim Cmd1, cmd2 objCharacter.commands.Caption = "Testing Events" objCharacter.commands.voice = "Testing Events" objCharacter.commands.voiceCaption = "Testing Events" objCharacter.commands.visible = true Set Cmd1 = objCharacter.Commands.Add ("Yes", "Yes", "Yes", True, True) Set Cmd2 = objCharacter.Commands.Add ("No", "No","([hold on][no][just one more minute][just another minute][In a few][I can't][I'm not ready to])", True, True) Set Cmd3 = objCharacter.Commands.Add ("Maybe", "Maybe", "Maybe", True, True) Set Cmd4 = objCharacter.Commands.Add ("Maybe Not", "Maybe Not", "Maybe Not", True, True) Set Cmd5 = objCharacter.Commands.Add ("Never", "Never", "Never", True, True) Set CmdPing = objCharacter.Commands.Add ("Ping Google", "Ping Google", "Ping Google", True, True) Set CmdopenWeb = objCharacter.Commands.Add ("Open Internet Explorer", "Open Internet Explorer", "Open Internet Explorer", True, True) Set CmdEmail = objCharacter.Commands.Add ("Open email", "Open email", "Open email", True, True) Set CmdExit = objCharacter.Commands.Add ("Exit", "Exit", "([Exit][quit])", True, True) Wscript.Sleep 3000 quitAnswer = objCharacter.Speak ("Do you want to quit for the day?") 'objCharacter.Wait quitAnswer Wscript.Sleep 5000 objCharacter.listen true 'objCharacter.Play "Restpose" 'objCharacter.Play "Blink" 'objCharacter.Stop 'Wscript.Sleep 10000 Do While objCharacter.Visible = TRUE Wscript.Sleep 30000 objCharacter.Play "Blink" objCharacter.listen true Loop objCharacter.Speak "Well, forget you! I'm leaving!" 'Wscript.Sleep 5000 if askForJob = true then objCharacter.Speak "Well, is there something you need me to do?" Wscript.Sleep 15000 objCharacter.Speak "Well, forget you! I'm leaving!" askForJob = false end if sub MSAgent_Command(cmdobj) 'objCharacter.listen false askForJob = false If cmdobj.Name = "Yes" Then objCharacter.Speak "Adios...fool!" objCharacter.Hide wscript.quit elseIf cmdobj.Name = "No" Then askForJob = true objCharacter.Speak "You said No! -wow" objCharacter.Speak "What the fuck? Do ya ever give up?" Wscript.Sleep 5000 elseIf cmdobj.Name = "Maybe" Then MyRequest = objCharacter.Speak ("You said maybe! Good enough for me.") 'objCharacter.Wait MyRequest 'while MyRequest.status = 4 ' Wscript.Sleep 100 'wscript.echo MyRequest.status 'wend objCharacter.Hide 'Wscript.Sleep 15000 'wscript.quit elseIf cmdobj.Name = "Maybe Not" Then objCharacter.Speak "You said maybe not, sounds like you're not sure." elseIf cmdobj.Name = "Never" Then objCharacter.Speak "Come on! I've got to pick up my dry cleaning!" elseIf cmdobj.Name = "Ping Google" Then objCharacter.think "What the fuck does that mean?" elseIf cmdobj.Name = "Open Internet Explorer" Then objCharacter.think "What the fuck does that mean?" Dim objIEA Set objIEA = CreateObject("InternetExplorer.Application") objIEA.Visible = True objIEA.Navigate webHomePage While objIEA.Busy Wend Set objIEA = Nothing elseIf cmdobj.Name = "Open email" Then objCharacter.think "What the fuck does that mean?" Set oShell2 = CreateObject("WScript.Shell") oShell2.Run emailProgramPath Set oShell2 = nothing 'Wscript.Sleep 5000 elseIf cmdobj.Name = "Exit" Then objCharacter.Hide wscript.quit End If End sub Sub MSAgent_Click (ByVal CharacterID, ByVal Button, ByVal Shift, ByVal X, ByVal Y) '-- If the user clicks the character with button one, '-- make him say something amusing If Button = 1 Then objCharacter.Stop objCharacter.Play "Surprised" objCharacter.Speak "Be careful with that pointer!" End If End Sub Sub MSAgent_Click (CharacterID, Button, Shift, X, Y) if button = 2 then objCharacter.listen false 'wscript.echo "button 2" else 'wscript.echo "button " & button end if end sub Function IsAgentInstalled() ' Purpose: Returns True if Agent 2.0 is installed, else False On Error Resume Next Dim AgentControl If ScriptEngineMajorVersion < 2 Then IsAgentInstalled = False Else Set AgentControl = CreateObject("Agent.Control.2") IsAgentInstalled = IsObject(AgentControl) Set AgentControl = nothing End If End Function