| |
dannyrb
Posts: 1
Score: 0
Joined: 8/9/2005
Status: offline
|
Using MSAgent & VBScript I want to turn Peedy into a link to a program I use a lot by sending Alt + T as a keystroke when I left click on him one time. Until I left click on him to launch the program he can be playing around the screen and then continue playing after the program is lauched untill I right click to hide him. I know how to make him show and play. I just need a kickstart with the part above. I have been looking at: sendkeys & Sub AgentControl_Click(ByVal CharacterID, ByVal Button, ByVal Shift, ByVal X, ByVal Y) End Sub In all the documentation I've downloaded I can't seem to find a decent explanation of the click method. I need an example of how to make this work. Can anyone Help Please. And yes I'm a newbie with MS Agent. Here is what I have but it doesn't see the mouse click: 'To change The character,change the strAgentName strAgentName = "Peedy" strAgentPath = "c:\windows\msagent\chars\" & strAgentName & ".acs" Set objAgent = CreateObject("Agent.Control.2") objAgent.Connected = TRUE objAgent.Characters.Load strAgentName, strAgentPath Set objCharacter = objAgent.Characters.Character(strAgentName) objCharacter.Show 'The above seven lines can be used as a template for all msagent charactors Sub AgentControl_Click (ByVal CharacterID, ByVal Button, ByVal Shift, ByVal X, ByVal Y) '-- If the user clicks the character with button 1 (left mouse button), '-- make him say something amusing WScript.Sleep 20000 If Button = 1 Then objCharacter.speak "No. It says the right mouse button!|Ha! Try your other right!" end if If Button = 2 Then 'The right mouse button objCharacter.Stop objCharacter.Play "Surprised" objCharacter.Speak "Hey, that tickles!|Be careful with that pointer!" End If End Sub objCharacter.Speak "I don't feel good" Do While objCharacter.Visible = True Wscript.Sleep 250 Loop
< Message edited by dannyrb -- 8/9/2005 4:29:32 PM >
|
|