Results 1 to 3 of 3

Thread: trying to manipulate an automation process

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    2

    Angry trying to manipulate an automation process

    dear all.. my name is Kwei from malaysia m currently doing my final year honors project which is a smart voice enabled english learning tool for visual impaired kids.. using vb.net with microsoft agent to spice up the smartness of the system, i have a problem that i m not able to figure out...my desired output is to make the agent n the loop structure run the whole tutorial without user pressing any keypress to go to the next question. i had tried enabling n disabling the textbox but things just dun go rite... need help or advice my viva is coming real soon below are my code portion for the problem with comments of deisred output n problem faced.

    [Highlight=VB]/*on keypress ENTER key it is suppose to run on its on just like an automation turotrial
    Case "SPACE"
    mSpk2.Stop()
    mSpk2.Speak("Here we go!!!!!")
    Do Until loop_random = 10
    generated_random_number = RandomNumber.Next(1, 26)
    If RandomNumber.Next(1, 26) = 1 Then
    mSpk2.Stop()
    mSpk2.Speak("A is for?")
    If strKeyPress.ToUpper() = "ENTER" And TextBox1.Text = "APPLE" Then/* when compiler reaches here it will straight go to the else result without even lettin me to input text into the textbox..i think this is where the real problem lies..hope anyone at all could give a hand or advice..it will be most appreciated"
    mSpk2.Stop()
    mSpk2.Speak("Bravo! A is for Apple.")
    mSpk2.Speak("A,P,P,L,E Apple.")
    loop_random = loop_random + 1
    Else
    mSpk2.Speak("Oops!! You are wrong!!!")
    mSpk2.Speak("A is for Apple.")
    mSpk2.Speak("A,P,P,L,E Apple.")
    mSpk2.Speak("Next Question is ")
    loop_random = loop_random + 1
    End If
    ElseIf RandomNumber.Next(1, 26) = 2 Then
    mSpk2.Stop()
    mSpk2.Speak("B is for?")
    If strKeyPress.ToUpper() = "ENTER" And TextBox1.Text = "BALL" Then
    mSpk2.Stop()
    mSpk2.Speak("Bravo! B is for Ball.")
    mSpk2.Speak("B,A,L,L Ball.")
    loop_random = loop_random + 1
    Else
    mSpk2.Speak("Oops!! You are wrong!!!")
    mSpk2.Speak("B is for Ball.")
    mSpk2.Speak("B,A,L,L Ball.")
    mSpk2.Speak("Next Question is ")
    loop_random = loop_random + 1
    End If

  2. #2
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: trying to manipulate an automation process

    Welcome to VBF

    Unfortunately, there's alot of important information that your code isn't telling us. FOr instance, how/when do you populate "strKeyPress?" Also, how/when is this snippet being called?

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    2

    Re: trying to manipulate an automation process

    thanks for replyin me sir, sorry silly me .. on form load it will load the agent n blah some instruction. instruction will go like to start doing tutorial pls press the space key n stuff like that..when user acknowledge the instruction they would just press the space button..n would kick the strkeypress = " ENTER" hope to hear from u real soon i will have to show this function to my supervisors tommorow n i m like new in vb.net coz they didnt allow us to use prog langguage which is not so accepted in the market world today sotherefore vb.net is a whole new world.. to me.. pls help n guide me guess i will paste the whole form code to make yer references easier

    regards,
    K

    VB Code:
    1. Private Sub ABClesson_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim voice As SpVoice
    3.         voice = New SpVoice
    4.         AxAgent1.Characters.Load("Vrgirl", "C:\WINDOWS\msagent\chars\Vrgirl.acs")
    5.         mSpk2 = AxAgent1.Characters("Vrgirl")
    6.         mSpk2.Show(0)
    7.         mSpk2.Play("Greet")
    8.         mSpk2.Play("Alert")
    9.         mSpk2.Speak("You choose to do some ABC tutorial with me!")
    10.         mSpk2.Speak("Great!!!")
    11.         mSpk2.Speak("Are you ready to do some ABC tutorial with me?")
    12.         mSpk2.Play("Alert")
    13.         mSpk2.Speak("Choice 1, To begin!,Please, press the Space key to start doing Smart ABC tutorial!")
    14.         mSpk2.Speak("To erase spelling error, please press the Enter key on your keyboard.")
    15.         mSpk2.Speak("Choice 2, To return to main menu please press the Escape key on your keyboard")
    16.         mSpk2.Speak("Choice 3, To repeat instructions please press the Shift key on your keyboard")
    17.         mSpk2.Play("Alert")
    18.     End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width