To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic .NET

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Mar 7th, 2006, 02:36 PM   #1
kwei
New Member
 
Join Date: Mar 06
Posts: 2
kwei is an unknown quantity at this point (<10)
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
kwei is offline   Reply With Quote
Old Mar 7th, 2006, 03:31 PM   #2
sevenhalo
Banned
 
Join Date: Nov 05
Posts: 2,367
sevenhalo is a jewel in the rough (300+)sevenhalo is a jewel in the rough (300+)sevenhalo is a jewel in the rough (300+)sevenhalo is a jewel in the rough (300+)
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?
sevenhalo is offline   Reply With Quote
Old Mar 7th, 2006, 10:51 PM   #3
kwei
New Member
 
Join Date: Mar 06
Posts: 2
kwei is an unknown quantity at this point (<10)
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
kwei is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic .NET


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:55 AM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.