Lab+I

Lab I: Create a ChatBot Using VBScript
You can easily create a simple ChatBot using a basic text editor (such as Notepad on a Windows PC). The ChatBot below is written in the VBScript language (short for Visual Basic, Scripting Edition). VBScript only runs on Windows. However, the program below is easily adapted to other programming environments. Here's what to do on a Windows PC:

A. First, open Notepad.

B. Next, key in the following text. Be sure to key this text in very carefully, __exactly__ as shown. Generally speaking, the code in a compiter programs must be letter perfect!--In other words, if even one character is incorrect, the program will malfunction severely or not work at all!


 * dim n, q**
 * n=inputbox("Whoa! Was it you who woke me up? What's your name?")**
 * q=inputbox("Heya, " & n & ". Thank you for activating me!")**
 * q=inputbox("So wassup?..Am just chatting!")**
 * q=inputbox("Yups. What's your favorite food?")**
 * q=inputbox("Hmm...I never ate much " & q & ". But I totally** **DIG** **pizza!")**
 * q=inputbox("Yay! Aww, gotta go, " & n & ". Cya soon, I hope? :P")**

C. Carefully check each line, once all is keyed in, to be sure it's correct. If all looks OK, do the following:


 * 1) On the NotePad menu, choose File / Save As ...
 * 2) In the drop-down box that says Save as type:, choose All Files.
 * 3) Click the Desktop icon in the left margin of the window, to save your file to the Desktop.
 * 4) Key in the name **bot.vbs**, then click the Save button to finish saving.

D. With your bot saved as a .vbs file, you're ready to try your bot out! Do the following:
 * 1) Double-click the bot's "script" (.vbs) icon to start the bot running.
 * 2) A window will pop up. If not, you will see an error message that tells which line of your program contains an error. Correct the error (or ask your instructor for help, if you're not sure what to do). Then double-click again to see if everything works as expected.
 * 3) Key in some response for everything the ChatBot says. Don't worry about saying the "right" thing--just type anything that comes into mind. Finally, click the OK button.
 * 4) Keep chatting until the Bot says goodbye.
 * 5) Yay! When it works, show your instructor.

E. Finally, briefly copy the following questions to your Class Notebook and respond to them. Or, you may email your answers to your instructor.
 * 1) Do you think this bot could pass the Turing Test? Why or why not?
 * 2) How much time would the average human need, in your opinion, to determine whether or not a chat buddy is real or a bot? Explain.

Go on to the next Lab.