Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by chriscc17

  1. chriscc17

    Javascript Chat Bot

    Ok, that makes sense and it works. Thanks, I appreciate your time and your responses.
  2. chriscc17

    Javascript Chat Bot

    It's working in the sense if you type "food" 5 or 6 straight times it will start with message[0] and loop accordingly. However, if I type another response then go back to it the sequence is off. Here is a real small demo I'm testing it on. Not sure where my problem is...
  3. chriscc17

    Javascript Chat Bot

    I guess I don't understand how to combine the two to get it to work. I need to place this outside the below? var num = 0; Then something like this? if (input.search("zfood")!= -1) { message[0] = "Pizza!"; message[1] = "Sub sandwich."; message[2] = "Tacos."; message[3] = "Cheeseburger"...
  4. chriscc17

    Javascript Chat Bot

    I have a pattern matching chatbot where I use the following to select at random the various responses. if (input.search("favorite food")!= -1) { message[0] = "Pizza!"; message[1] = "Sub sandwich."; message[2] = "Tacos."; message[3] = "Cheeseburger"; num = [Math.floor(Math.random()*4)]...

Part and Inventory Search

Back
Top