Dim AgentX, CharID, otherAgent Dim Request Sub LoadChar(Name) On Error Resume Next SetStatus "Loading " & Name & " from disk ..." AgentControl.Characters.Load Name, Name & ".acs" If (Err.Number <> 0) Then On Error Resume Next AgentControl.Characters.Load Name, _ "C:\Program Files\Microsoft Agent\Characters\" & Name & ".acs" If (Err.Number <> 0) Then On Error Resume Next AgentControl.Characters.Load Name, _ "C:\Programme\Microsoft Agent\Characters\" & Name & ".acs" End If End If CheckDiskLoad Err.Number, Name End Sub Sub CheckDiskLoad(Number, Name) On Error Resume Next If (Number <> 0) Then SetStatus "Loading " & Name & " from disk failed." MsgBox "This Presentation requires the character" & Chr(13) & "Otto.", 64 navigate "../..agents.htm" Else SetStatus "Successfully loaded " & Name & " from disk." End If End Sub Sub AgentControl_Click (ByVal CharacterID, ByVal Button, ByVal Shift, ByVal X, ByVal Y) On Error Resume Next Set AgentX = AgentControl.Characters(CharacterID) If Button=1 then AgentX.Stop AgentX.Play "GetAttention" AgentX.Speak "Quit poking me, that tickles. Right-Click me, instead | Right-Click, Not Left-Click | Don't Click me, Right-Click me!" AgentX.Play "GetAttentionReturn" End If End Sub Sub SetStatus(Text) On Error Resume Next Status = Text End Sub Dim centerTop, centerLeft, notCentered centerTop = ((screen.availHeight/2) - 64) centerLeft = ((screen.availWidth/2) - 64) Sub CenterAgent (ByVal CharacterID) On Error Resume Next Set AgentX = AgentControl.Characters(CharacterID) notCentered = false if AgentX.Left <> centerLeft then notCentered = true if AgentX.Top <> centerTop then notCentered = true if notCentered then AgentX.MoveTo centerLeft,centerTop End Sub '************************Date and Time Functions************************ Function TimeOfDay() On Error Resume Next Dim greeting, thisHour thisHour = Hour(Now()) If thisHour < 12 then greeting = "Good morning!" ElseIf thisHour < 17 then greeting = "Good afternoon!" Else greeting = "Good evening!" End If TimeOfDay = greeting End Function Function CurrentTime() On Error Resume Next CurrentTime= "It is now " & Time() & "." End Function Function DayOfWeek() On Error Resume Next Dim WDay(8) WDay(0)= " " WDay(1)= "Sunday" WDay(2)= "Monday" WDay(3)= "Tuesday" WDay(4)= "Wednesday" WDay(5)= "Thursday" WDay(6)= "Friday" WDay(7)= "Saturday" DayOfWeek = " Today is " & WDay(WeekDay(Now())) & "." End Function Function CurrentDate() On Error Resume Next Dim carl, carla Dim Mnth(13) Mnth(0)= " " Mnth(1)= "January" Mnth(2)= "February" Mnth(3)= "March" Mnth(4)= "April" Mnth(5)= "May" Mnth(6)= "June" Mnth(7)= "July" Mnth(8)= "August" Mnth(9)= "September" Mnth(10)= "October" Mnth(11)= "November" Mnth(12)= "December" carl = Day(Now()) carla = Month(Now()) Carlb = Year(Now()) CurrentDate = " " & Mnth(Month(Now())) &" " & carl & " " & carlb End Function