home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD8811892000.psc / VB / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-08-08  |  17.5 KB  |  569 lines

  1. VERSION 5.00
  2. Object = "{F5BE8BC2-7DE6-11D0-91FE-00C04FD701A5}#2.0#0"; "AGENTCTL.DLL"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "How to use MS Agent and make a seequens with it (By Paw Jershauge)"
  6.    ClientHeight    =   5025
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   7215
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   5025
  14.    ScaleWidth      =   7215
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CheckBox Check1 
  17.       Caption         =   "View intro when program starts"
  18.       Height          =   495
  19.       Left            =   2640
  20.       TabIndex        =   10
  21.       Top             =   4440
  22.       Width           =   1815
  23.    End
  24.    Begin VB.ListBox Infolist 
  25.       Height          =   450
  26.       ItemData        =   "Form1.frx":0000
  27.       Left            =   6960
  28.       List            =   "Form1.frx":00E8
  29.       TabIndex        =   9
  30.       Top             =   120
  31.       Visible         =   0   'False
  32.       Width           =   1215
  33.    End
  34.    Begin VB.Frame Frame2 
  35.       Caption         =   "Animation names"
  36.       Height          =   4815
  37.       Left            =   4560
  38.       TabIndex        =   7
  39.       Top             =   120
  40.       Width           =   2535
  41.       Begin VB.ListBox List2 
  42.          Height          =   4350
  43.          ItemData        =   "Form1.frx":0807
  44.          Left            =   120
  45.          List            =   "Form1.frx":08EF
  46.          TabIndex        =   8
  47.          Top             =   360
  48.          Width           =   2295
  49.       End
  50.    End
  51.    Begin VB.Frame Frame1 
  52.       Caption         =   "Program a Seequens"
  53.       Height          =   4815
  54.       Left            =   120
  55.       TabIndex        =   0
  56.       Top             =   120
  57.       Width           =   2415
  58.       Begin VB.ListBox List1 
  59.          Height          =   2010
  60.          Left            =   120
  61.          TabIndex        =   6
  62.          Top             =   1200
  63.          Width           =   2175
  64.       End
  65.       Begin VB.CommandButton Command5 
  66.          Caption         =   "Play"
  67.          Height          =   375
  68.          Left            =   120
  69.          TabIndex        =   5
  70.          Top             =   4320
  71.          Width           =   2175
  72.       End
  73.       Begin VB.CommandButton Command4 
  74.          Caption         =   "Remove all from list"
  75.          Height          =   375
  76.          Left            =   120
  77.          TabIndex        =   4
  78.          Top             =   3840
  79.          Width           =   2175
  80.       End
  81.       Begin VB.CommandButton Command3 
  82.          Caption         =   "Remove from list"
  83.          Height          =   375
  84.          Left            =   120
  85.          TabIndex        =   3
  86.          Top             =   3360
  87.          Width           =   2175
  88.       End
  89.       Begin VB.CommandButton Command2 
  90.          Caption         =   "Add animation"
  91.          Height          =   375
  92.          Left            =   120
  93.          TabIndex        =   2
  94.          Top             =   720
  95.          Width           =   2175
  96.       End
  97.       Begin VB.CommandButton Command1 
  98.          Caption         =   "Add talk"
  99.          Height          =   375
  100.          Left            =   120
  101.          TabIndex        =   1
  102.          Top             =   240
  103.          Width           =   2175
  104.       End
  105.    End
  106.    Begin AgentObjectsCtl.Agent Agent1 
  107.       Left            =   2640
  108.       Top             =   240
  109.       _cx             =   847
  110.       _cy             =   847
  111.    End
  112.    Begin VB.Menu REG 
  113.       Caption         =   ""
  114.       Visible         =   0   'False
  115.       Begin VB.Menu mnuEdit 
  116.          Caption         =   "&Edit"
  117.       End
  118.       Begin VB.Menu mnuCopy 
  119.          Caption         =   "&Copy"
  120.       End
  121.    End
  122.    Begin VB.Menu Ani 
  123.       Caption         =   ""
  124.       Visible         =   0   'False
  125.       Begin VB.Menu L1 
  126.          Caption         =   ""
  127.          Index           =   0
  128.       End
  129.       Begin VB.Menu L1 
  130.          Caption         =   ""
  131.          Index           =   1
  132.       End
  133.       Begin VB.Menu L1 
  134.          Caption         =   ""
  135.          Index           =   2
  136.       End
  137.       Begin VB.Menu L1 
  138.          Caption         =   ""
  139.          Index           =   3
  140.       End
  141.       Begin VB.Menu L1 
  142.          Caption         =   ""
  143.          Index           =   4
  144.       End
  145.       Begin VB.Menu L1 
  146.          Caption         =   ""
  147.          Index           =   5
  148.       End
  149.       Begin VB.Menu L1 
  150.          Caption         =   ""
  151.          Index           =   6
  152.       End
  153.       Begin VB.Menu L1 
  154.          Caption         =   ""
  155.          Index           =   7
  156.       End
  157.       Begin VB.Menu L1 
  158.          Caption         =   ""
  159.          Index           =   8
  160.       End
  161.       Begin VB.Menu L1 
  162.          Caption         =   ""
  163.          Index           =   9
  164.       End
  165.       Begin VB.Menu L1 
  166.          Caption         =   ""
  167.          Index           =   10
  168.       End
  169.       Begin VB.Menu L1 
  170.          Caption         =   ""
  171.          Index           =   11
  172.       End
  173.       Begin VB.Menu L1 
  174.          Caption         =   ""
  175.          Index           =   12
  176.       End
  177.       Begin VB.Menu L1 
  178.          Caption         =   ""
  179.          Index           =   13
  180.       End
  181.       Begin VB.Menu L1 
  182.          Caption         =   ""
  183.          Index           =   14
  184.       End
  185.       Begin VB.Menu L1 
  186.          Caption         =   ""
  187.          Index           =   15
  188.       End
  189.       Begin VB.Menu L1 
  190.          Caption         =   ""
  191.          Index           =   16
  192.       End
  193.       Begin VB.Menu L1 
  194.          Caption         =   ""
  195.          Index           =   17
  196.       End
  197.       Begin VB.Menu L1 
  198.          Caption         =   ""
  199.          Index           =   18
  200.       End
  201.       Begin VB.Menu L1 
  202.          Caption         =   ""
  203.          Index           =   19
  204.       End
  205.       Begin VB.Menu L1 
  206.          Caption         =   ""
  207.          Index           =   20
  208.       End
  209.       Begin VB.Menu L1 
  210.          Caption         =   ""
  211.          Index           =   21
  212.       End
  213.       Begin VB.Menu L1 
  214.          Caption         =   ""
  215.          Index           =   22
  216.       End
  217.       Begin VB.Menu L1 
  218.          Caption         =   ""
  219.          Index           =   23
  220.       End
  221.       Begin VB.Menu L1 
  222.          Caption         =   ""
  223.          Index           =   24
  224.       End
  225.       Begin VB.Menu L1 
  226.          Caption         =   ""
  227.          Index           =   25
  228.       End
  229.       Begin VB.Menu L1 
  230.          Caption         =   ""
  231.          Index           =   26
  232.       End
  233.       Begin VB.Menu L1 
  234.          Caption         =   ""
  235.          Index           =   27
  236.       End
  237.       Begin VB.Menu L1 
  238.          Caption         =   ""
  239.          Index           =   28
  240.       End
  241.       Begin VB.Menu L1 
  242.          Caption         =   ""
  243.          Index           =   29
  244.       End
  245.       Begin VB.Menu L1 
  246.          Caption         =   ""
  247.          Index           =   30
  248.       End
  249.       Begin VB.Menu L1 
  250.          Caption         =   ""
  251.          Index           =   31
  252.       End
  253.       Begin VB.Menu L1 
  254.          Caption         =   ""
  255.          Index           =   32
  256.       End
  257.       Begin VB.Menu L1 
  258.          Caption         =   ""
  259.          Index           =   33
  260.       End
  261.       Begin VB.Menu L1 
  262.          Caption         =   ""
  263.          Index           =   34
  264.       End
  265.       Begin VB.Menu L1 
  266.          Caption         =   ""
  267.          Index           =   35
  268.       End
  269.       Begin VB.Menu L1 
  270.          Caption         =   ""
  271.          Index           =   36
  272.       End
  273.       Begin VB.Menu L1 
  274.          Caption         =   ""
  275.          Index           =   37
  276.       End
  277.       Begin VB.Menu L1 
  278.          Caption         =   ""
  279.          Index           =   38
  280.       End
  281.       Begin VB.Menu L1 
  282.          Caption         =   ""
  283.          Index           =   39
  284.       End
  285.       Begin VB.Menu L1 
  286.          Caption         =   ""
  287.          Index           =   40
  288.       End
  289.       Begin VB.Menu L1 
  290.          Caption         =   ""
  291.          Index           =   41
  292.       End
  293.       Begin VB.Menu L1 
  294.          Caption         =   ""
  295.          Index           =   42
  296.       End
  297.       Begin VB.Menu L1 
  298.          Caption         =   ""
  299.          Index           =   43
  300.       End
  301.       Begin VB.Menu L1 
  302.          Caption         =   ""
  303.          Index           =   44
  304.       End
  305.       Begin VB.Menu L1 
  306.          Caption         =   ""
  307.          Index           =   45
  308.       End
  309.       Begin VB.Menu L1 
  310.          Caption         =   ""
  311.          Index           =   46
  312.       End
  313.       Begin VB.Menu L1 
  314.          Caption         =   ""
  315.          Index           =   47
  316.       End
  317.       Begin VB.Menu L1 
  318.          Caption         =   ""
  319.          Index           =   48
  320.       End
  321.       Begin VB.Menu L1 
  322.          Caption         =   ""
  323.          Index           =   49
  324.       End
  325.       Begin VB.Menu L1 
  326.          Caption         =   ""
  327.          Index           =   50
  328.       End
  329.       Begin VB.Menu L1 
  330.          Caption         =   ""
  331.          Index           =   51
  332.       End
  333.       Begin VB.Menu L1 
  334.          Caption         =   ""
  335.          Index           =   52
  336.       End
  337.       Begin VB.Menu L1 
  338.          Caption         =   ""
  339.          Index           =   53
  340.       End
  341.       Begin VB.Menu L1 
  342.          Caption         =   ""
  343.          Index           =   54
  344.       End
  345.       Begin VB.Menu L1 
  346.          Caption         =   ""
  347.          Index           =   55
  348.       End
  349.       Begin VB.Menu L1 
  350.          Caption         =   ""
  351.          Index           =   56
  352.       End
  353.       Begin VB.Menu L1 
  354.          Caption         =   ""
  355.          Index           =   57
  356.       End
  357.       Begin VB.Menu L1 
  358.          Caption         =   ""
  359.          Index           =   58
  360.       End
  361.       Begin VB.Menu L1 
  362.          Caption         =   ""
  363.          Index           =   59
  364.       End
  365.       Begin VB.Menu L1 
  366.          Caption         =   ""
  367.          Index           =   60
  368.       End
  369.       Begin VB.Menu L1 
  370.          Caption         =   ""
  371.          Index           =   61
  372.       End
  373.       Begin VB.Menu L1 
  374.          Caption         =   ""
  375.          Index           =   62
  376.       End
  377.       Begin VB.Menu L1 
  378.          Caption         =   ""
  379.          Index           =   63
  380.       End
  381.       Begin VB.Menu L1 
  382.          Caption         =   ""
  383.          Index           =   64
  384.       End
  385.       Begin VB.Menu L1 
  386.          Caption         =   ""
  387.          Index           =   65
  388.       End
  389.       Begin VB.Menu L1 
  390.          Caption         =   ""
  391.          Index           =   66
  392.       End
  393.       Begin VB.Menu L1 
  394.          Caption         =   ""
  395.          Index           =   67
  396.       End
  397.       Begin VB.Menu L1 
  398.          Caption         =   ""
  399.          Index           =   68
  400.       End
  401.       Begin VB.Menu L1 
  402.          Caption         =   ""
  403.          Index           =   69
  404.       End
  405.       Begin VB.Menu L1 
  406.          Caption         =   ""
  407.          Index           =   70
  408.       End
  409.       Begin VB.Menu L1 
  410.          Caption         =   ""
  411.          Index           =   71
  412.       End
  413.       Begin VB.Menu L1 
  414.          Caption         =   ""
  415.          Index           =   72
  416.       End
  417.       Begin VB.Menu L1 
  418.          Caption         =   ""
  419.          Index           =   73
  420.       End
  421.       Begin VB.Menu L1 
  422.          Caption         =   ""
  423.          Index           =   74
  424.       End
  425.       Begin VB.Menu L1 
  426.          Caption         =   ""
  427.          Index           =   75
  428.       End
  429.    End
  430. Attribute VB_Name = "Form1"
  431. Attribute VB_GlobalNameSpace = False
  432. Attribute VB_Creatable = False
  433. Attribute VB_PredeclaredId = True
  434. Attribute VB_Exposed = False
  435. Dim genie As IAgentCtlCharacterEx  ' Make the name "Genie" An Agent Character
  436. Public EditListIndex As Integer
  437. Private Sub Check1_Click()
  438. If Check1.Value = 0 Then
  439. SaveSetting App.EXEName, "Loadintro", "Load", "False"
  440. SaveSetting App.EXEName, "Loadintro", "Load", "True"
  441. End If
  442. End Sub
  443. Private Sub Form_Load()
  444. Dim xload As String
  445. Agent1.Characters.Load "Genie", "Genie.acs" 'Asign the Genie file to the Agent
  446. Set genie = Agent1.Characters("Genie")      'Load the Agent and the Character into the Genie name
  447. genie.LanguageID = &H409                    'Set Language to english = &H409
  448. genie.Show                                  'Show the Character
  449. genie.Play "Greet"
  450. genie.Speak "Hallo, and wellcome, to the, How, to use, MS, Agent. By Paw Jershauge." 'Say something
  451. 'genie.Stop
  452. genie.Left = 500                            'Horizontal plasement
  453. genie.Top = 350                             'Vertical Plasement
  454. 'genie.Hide                                  'Hide the Character (NOT UNLOAD)
  455. xload = GetSetting(App.EXEName, "LoadIntro", "Load", True)
  456. 'A littel intoduction__________________________
  457. Loadintro xload
  458. 'Load animation names into menu
  459. For x = 0 To List2.ListCount - 1
  460. L1(x).Caption = List2.List(x)
  461. Next x
  462. '______________________________
  463. End Sub
  464. Function Loadintro(Load As String)
  465. If Load = "True" Then
  466. Check1.Value = 1
  467. genie.Speak "If you look"
  468. genie.Play "gestureleft"
  469. genie.Speak "To your right, you can see the animation that i can make"
  470. genie.Speak "Try dobble click on one of the animations and i will show them to you"
  471. genie.Speak "But please wait ontill i'm finished"
  472. genie.Play "gestureRight"
  473. genie.Speak "Please look to your left"
  474. genie.Speak "This is where you can make your own seequens with me"
  475. genie.Speak "Just add some speechs and animation and you are on your way"
  476. genie.Play "Greet"
  477. genie.Speak "Good luck"
  478. List1.AddItem "Play: Greet"
  479. List1.AddItem "Talk: Greatings, Maaster. Ahhhh. it is nise, to be free, again"
  480. List1.AddItem "Play: Suggest"
  481. List1.AddItem "Talk: I have an, i dear. Go to. the. Planet Source Code, web page. And"
  482. List1.AddItem "Talk: Take the time, to vote for me. I would be very pleased. Thanks. Your, the best."
  483. List1.AddItem "Play: Pleased"
  484. Check1.Value = 0
  485. End If
  486. End Function
  487. Private Sub List2_Click()
  488. List2.ToolTipText = Infolist.List(List2.ListIndex)
  489. End Sub
  490. Private Sub List2_DblClick()
  491. genie.Stop
  492. genie.Play List2.List(List2.ListIndex)
  493. End Sub
  494. 'Users seequens############################################################################################
  495. Private Sub Command1_Click()
  496. Dim userinput As String
  497. userinput = InputBox("What to say ???", "Add talk")
  498. If userinput <> "" Then 'If user has typed something then add the text
  499. List1.AddItem "Talk: " & userinput
  500. Else 'Else if not then display a message
  501. MsgBox "The Character must say somethink", vbCritical, "Talk error"
  502. End If
  503. End Sub
  504. Private Sub Command2_Click()
  505. Me.PopupMenu Ani 'Show Animation menu
  506. End Sub
  507. Private Sub Command3_Click()
  508. If List1.ListIndex < 0 Then 'Check if there has been select anything, if not then display an message
  509. MsgBox "You must first select somethink to remove", vbInformation, "Nothing to remove"
  510. Else ' else remove it
  511. List1.RemoveItem List1.ListIndex
  512. End If
  513. End Sub
  514. Private Sub Command4_Click()
  515. List1.Clear ' Delete all
  516. End Sub
  517. Private Sub Command5_Click()
  518. For x = 0 To List1.ListCount
  519. If Left(List1.List(x), 5) = "Talk:" Then 'Check if its a speech or a animation (IF SPEECH THEN THIS)
  520. genie.Speak Mid(List1.List(x), 7, Len(List1.List(x))) 'remove (Talk:) and insert only the speech
  521. ElseIf Left(List1.List(x), 5) = "Play:" Then 'Check if its a speech or a animation (IF ANIMATION THEN THIS)
  522. genie.Play Mid(List1.List(x), 7, Len(List1.List(x))) 'remove (Play:) and insert only the animation
  523. End If
  524. Next x
  525. End Sub
  526. Private Sub L1_Click(Index As Integer)
  527. If EditListIndex > 0 Then
  528. List1.List(EditListIndex) = "Play: " & L1(Index).Caption 'Add animation to List
  529. List1.AddItem "Play: " & L1(Index).Caption 'Add animation to List
  530. End If
  531. EditListIndex = -1
  532. End Sub
  533. Private Sub mnuEdit_Click()
  534. Dim userinput
  535. If List1.ListIndex >= 0 Then
  536.     userinput = MsgBox("Do want to edit " & List1.List(List1.ListIndex), vbYesNo, "Edit seequens")
  537.     If userinput = vbYes Then
  538.         If Left(List1.List(List1.ListIndex), 5) = "Talk:" Then  'Check if its a speech or a animation (IF SPEECH THEN THIS)
  539.         userinput = InputBox("What to say ???", "Add talk")
  540.             If userinput <> "" Then 'If user has typed something then add the text
  541.             List1.List(List1.ListIndex) = "Talk: " & userinput
  542.             Else 'Else if not then display a message
  543.             MsgBox "The Character must say somethink", vbCritical, "Talk error"
  544.             End If
  545.         ElseIf Left(List1.List(List1.ListIndex), 5) = "Play:" Then  'Check if its a speech or a animation (IF ANIMATION THEN THIS)
  546.         MsgBox "To change the animation, please click [add animation]" & vbCrLf & "and let the one you want to change be highligthed"
  547.         EditListIndex = List1.ListIndex
  548.         End If
  549.     Else
  550.     'Beep
  551.     End If
  552. End If
  553. End Sub
  554. Private Sub List1_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
  555. Select Case Button
  556. Case 0
  557. MsgBox "0"
  558. Case 1
  559. If Left(List1.List(List1.ListIndex), 5) = "Talk:" Then  'Check if its a speech or a animation (IF SPEECH THEN THIS)
  560. genie.Speak Mid(List1.List(List1.ListIndex), 7, Len(List1.List(List1.ListIndex)))   'remove (Talk:) and insert only the speech
  561. ElseIf Left(List1.List(List1.ListIndex), 5) = "Play:" Then  'Check if its a speech or a animation (IF ANIMATION THEN THIS)
  562. genie.Play Mid(List1.List(List1.ListIndex), 7, Len(List1.List(List1.ListIndex)))   'remove (Play:) and insert only the animation
  563. End If
  564. Case 2
  565. Me.PopupMenu REG
  566. End Select
  567. End Sub
  568. 'Users seequens############################################################################################
  569.