'_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/'_/ Portions generated by MASH - Microsoft Agent Scripting Helper, version 7.3'_/ by BellCraft Technologies, http://www.bellcraft.com/mash'_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/'' TODO: Set a "Reference" in your Visual Basic project to the' Microsoft Agent 2.0 Control (Project > References...).' Please see MASH Online Help for further instructions.
Option Explicit
' * Agent ControlPublic WithEvents AgentControl As Agent
' * Character ObjectsDim Merlin As IAgentCtlCharacter
Private UsedChars As String
Private MerlinID As StringPrivate MerlinACS As StringPrivate MerlinLoaded As BooleanPrivate HideReq As IAgentCtlRequestPrivate Req As IAgentCtlRequest
Private Sub Form_Load() Call AgentMainEnd Sub
Public Function AgentMain() On Error Resume Next
' * Initialize UsedChars = "Merlin"
' * Merlin MerlinID = "Merlin" MerlinACS = "merlin.acs" MerlinLoaded = False
Set AgentControl = New Agent AgentControl.Connected = True
MerlinLoaded = LoadLocalChar(MerlinID, MerlinACS)
If Not MerlinLoaded Then ' Attempt to load default character MerlinLoaded = LoadLocalChar(MerlinID, "") End If
If MerlinLoaded Then Call SetCharObj End If
If MerlinLoaded Then Call AgentIntro Else MsgBox "This Visual Basic program requires the" & vbCrLf & "Microsoft Agent Characters:" & vbCrLf & UsedChars, vbExclamation End IfEnd Function
Private Function LoadLocalChar(ByVal pstrCharID As String, ByVal pstrCharACS As String) As Boolean ' Purpose: Attempt to load the specified character ' Returns: True if successful, False if not On Error Resume Next
If pstrCharACS = "" Then AgentControl.Characters.Load pstrCharID Else AgentControl.Characters.Load pstrCharID, pstrCharACS End If
If Err = 0 Then LoadLocalChar = True Exit Function End IfEnd Function
Private Sub SetCharObj() On Error Resume Next
Set Merlin = AgentControl.Characters(MerlinID) Merlin.LanguageID = &H409End Sub
Private Sub InitAgentCommands() ' Purpose: Initialize the Commands menu On Error Resume Next
Merlin.Commands.RemoveAll Merlin.Commands.Caption = "MASH Menu" Merlin.Commands.Add "ACO", "Advanced Character Options", "Advanced Character Options"
End Sub
Private Sub AgentControl_DblClick(ByVal CharacterID As String, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Integer, ByVal Y As Integer) ' Stop all characters on double-click On Error Resume Next
Merlin.StopAll If Not Merlin.HasOtherClients Then Set HideReq = Merlin.Hide() End IfEnd Sub
Private Sub AgentControl_RequestComplete(ByVal Request As Object) On Error Resume Next
If Request <> HideReq Then Else AgentControl.Characters.Unload MerlinID End IfEnd Sub
Private Sub AgentControl_Command(ByVal UserInput As Object) On Error Resume Next
Const BadConfidence = 10
If (UserInput.Confidence <= -40) Then ' Bad Recognition Exit Sub ElseIf (UserInput.Alt1Name <> "") And Abs(Abs(UserInput.Alt1Confidence) - Abs(UserInput.Confidence)) <> "") And Abs(Abs(UserInput.Alt2Confidence) - Abs(UserInput.Confidence)) < BadConfidence Then ' Bad Confidence - too close to another command Exit Sub Else ' High Confidence ' *** BEGIN MASH USER COMMANDS *** Select Case UserInput.Name Case "ACO" AgentControl.PropertySheet.Visible = True End Select ' *** END MASH USER COMMANDS *** End IfEnd Sub
Private Sub AgentControl_Bookmark(ByVal BookmarkID As Long) On Error Resume Next
End Sub
Private Sub AgentIntro() On Error Resume Next
InitAgentCommands
' *** BEGIN MASH USER SCRIPT ***
Merlin.Show Merlin.Play "Acknowledge" Merlin.Speak "Welcome to the Bakery Trades OH&S Blog." Merlin.Speak "During the course you will be required to add content to this area on a regular basis." Merlin.Speak "It is important that you check the site at least twice a week and follow the instructions as per each posting. This will help you to navigate the content and use the space effectively." Merlin.Speak "Welcome to the Bakery Trades OH&S Blog." Merlin.Speak "During the course you will be required to add content to this area on a regular basis." Merlin.Speak "It is important that you check the site at least twice a week and follow the instructions as per each posting. This will help you to navigate the content and use the space effectively."
' *** END MASH USER SCRIPT ***End Sub'_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
0 Comments:
Post a Comment
<< Home