Thread replies: 3
Thread images: 1
Anonymous
VBScript Quick Question
2016-06-20 16:53:39 Post No. 143714
[Report]
Image search:
[Google]
VBScript Quick Question
Anonymous
2016-06-20 16:53:39
Post No. 143714
[Report]
Over the summer I have been teaching myself VBScript just to pass the time. Lately I have been working on a simple TTS debug tool. The tool, when run, is supposed to create an input box to ask the user for their name while simultaneously reading out the text on screen. Then, it will display a message box telling the user what the program does, while, again, reading out the message box. If they press Exit, Cancel, or if they enter a blank into the input box, it exits. After that, it runs Defender, network troubleshooter, pings Google, etc.
Or at least I wish.
Instead, everything works fine, except that instead of playing simultaneously, the text is read and then displayed one after the other. I Googled it and looked on MSDN. It says stuff about all of the different ways to do it, using WaitUntilDone and all these other commands. What I really want to know is:
Which one do I use?
What would the code look like?
Is this the best language for me?
Is there any other errors with the code?
dim v
Set v = CreateObject("SAPI.SpVoice")
welcome = "Hello! My name is Rex. I am your complete computer debug tool."&_
" I will try to find and fix internet connections, remove malware, ads, and viruses, and I can help speed up your computer, with just one click of a button! What's your name?"
v.speak welcome
name=inputbox(welcome,"Welcome!")
If name = "" Then
WScript.quit
else
briefing = "Alright " & name & ", I will now guide you step-by-step to use free tools which come with Windows to diagnose and hopefully fix problems on your computer. "&_
"You don't have to download a thing. Is that alright?"
v.speak briefing,
confirmbox = msgbox (briefing,4,"Hello there " & name & "!")
end if
if confirmbox=7 then
WScript.quit
else
msgbox ("placeholder")
end if
Knowing my luck, it's probably an easy fix and I was just being stupid. Or I am getting into something I seriously shouldn't at my level. Any help would be greatly appreciated. Thanks.