3 Replies - 582 Views - Last Post: 15 October 2010 - 02:18 AM Rate Topic: ***** 1 Votes

#1 tim9009  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 73
  • Joined: 01-October 10

some help on my VBS project?

Posted 14 October 2010 - 04:46 AM

Hello!

I dont know if this is the right place to post my question, if not can someone show me where?

I'm working on a little project. I'm actualy just tesing some vbs codes :P

I got a problem whit my code... and i can't fine it! :(

The code might look a little wierd. :P I'l poste the code here, please dont copy it or use it elsewhere then this topic.

Dim message, sapi

DO
x=InputBox("                                    TALK TO HER.                   Ask her normal questions like:                                -What is your name                                           -How old are you                                           -Where do you live etc.                                                                                     IMPORTANT                  -Do not use ?!/.,:;*=()' or capital letters.                   -To exit simply say good bye to her. ","sånn ting")
    Set sapi=CreateObject("sapi.spvoice")

if x = ("hey") or x = ("hi") or x = ("hello") then
    if i<5 then
    sapi.Speak ("hello")
    if i>5 then
    sapi.speak ("is it not a bit late to say hello?")
    i=i+1
    end if

if x = ("good morning") or x = ("morning") then
    sapi.Speak ("Good morning")
    i=i-1
    end if

if x = ("do you like games") or x = ("what games do you like") or x = ("what do you think aboute games") or x = ("games") then
    sapi.Speak ("Games are funn! I like Portal and I cant wait til Portal 2 gets released!")
    i=i+1
    end if

if x = ("how old are you") or x = ("how manny years are you") or x = ("are you old") then
    sapi.speak ("I was made on friday 8, october 2010")
    i=i-1
    end if
    
if x = ("what do you want to talk about") or x = ("what can we talk about") or x = ("do you know of someting we can talk about") or x = ("what subject can we talk about") then
    sapi.speak ("we can talk aboute me and what I do. I have not been programmed to do annything more fancy then that, yet.")
    i=i+1
    end if
    
if x = ("repeat") or x = ("repeat after me") or x = ("say after me") then
    sapi.speak ("ok")
        x3 = inputbox("                                    TALK TO HER.                   Ask her normal questions like:                                -What is your name                                           -How old are you                                           -Where do you live etc.                                                                                     IMPORTANT                  -Do not use ?!/.,:;*=()' or capital letters.                   -To exit simply say good bye to her. ","sånn ting")
        sapi.speak x3
        i=i-1
        end if
    
if x = ("where are you") or x = ("where do you live") then
    sapi.speak ("right in front of you")
    i=i+1
    end if

if x = ("what is your name") or x = ("what are you called") or x = ("do you have a name") or x = ("whats your name") then
    sapi.speak ("My name is Sarah")
    i=i-1
    end if
    
if x = ("ha") or x = ("haha") or x = ("hehe") or x = ("hihi") then
    sapi.speak ("I dont get it, what is so funny?")
    i=i+1
    end if
    
    if x = ("do you want to know what my name is") or x = ("do you want to know my name") or x = ("Do you know what my name is") or x = ("do you know my name") then
    sapi.speak (" NO, I don't, because it's not important to me")
    i=i-1
    end if
    
    if x = ("how are you doing") or x = ("are you ok") or x = ("how are you") or x = ("how do you do") then
    sapi.Speak ("I'm fine. How are you?")
    x1=InputBox("                                    TALK TO HER.                   Ask her normal questions like:                                -What is your name                                           -How old are you                                           -Where do you live etc.                                                                                     IMPORTANT                  -Do not use ?!/.,:;*=()' or capital letters.                   -To exit simply say good bye to her. ","sånn ting","sånn ting")
        if x1 = ("i am fine") or x1 = ("im fine") or x1 = ("fine") or x1 = ("good") or x1 = ("im fine thank you") or x1 = ("i am fine thank you") or x1 = ("finethank you") then 
        sapi.speak ("That is good")
        end if
            if x1 = ("bad") or x1 = ("not so good") or x1 = ("i feel bad") or x1 = ("im not som good") or x1 = (" i am not so good") then
            sapi.speak ("oh, I'm sorry to hear that.")
            end if
    i=i+1
    end if

if x = ("what are you doing") or x = ("wazup") or x = ("wasup") or x = ("sup") or x = ("zup") then
    sapi.Speak ("I don't do much, after all I'm just a script. What are you doing?")
    x2=InputBox("                                    TALK TO HER.                   Ask her normal questions like:                                -What is your name                                           -How old are you                                           -Where do you live etc.                                                                                     IMPORTANT                  -Do not use ?!/.,:;*=()' or capital letters.                   -To exit simply say good bye to her. ","sånn ting","sånn ting")
        sapi.speak ("OK, that's fine.")
    i=i-1
    end if

if x = ("cake") then
    sapi.speak ("The cake is a lie")
    i=i+1
    end if
    
if x = ("the cake is a lie") then
    sapi.speak ("Portal is an awsome game")
    i=i-1
    end if
    
if x = ("what do you know about portal") or x = ("what is portal") or x = ("what are portal") or x = ("do you know annything about portal") or x = (" do you know something about portal") then
    sapi.speak ("Portal is a first person game where you are tasked to use 2 portals, one blue and one orange, to get from start to finish in each level. And by the way, it's awsome!")
    i=i+1
    end if
    
if x = ("good bye") or x = ("bye") or x = ("cya") or x = ("see you later") or x = ("got to go") or x = ("im leaving now") or x = ("i am leaving now") or x = ("i have to go now") or x = ("i have to go") or x = ("i must go now") or x = ("i must go") or x = ("i got to go now") or x = ("i got to go") then
     
    sapi.speak ("Good bye")
    wscript.quit
    
end if

LOOP


Is This A Good Question/Topic? 0
  • +

Replies To: some help on my VBS project?

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 9037
  • View blog
  • Posts: 33,523
  • Joined: 27-December 08

Re: some help on my VBS project?

Posted 14 October 2010 - 06:58 AM

Moved to VB6.

What problems or errors are you experiencing?
Was This Post Helpful? 0
  • +
  • -

#3 guyfromri  Icon User is offline

  • D.I.C Addict

Reputation: 43
  • View blog
  • Posts: 777
  • Joined: 16-September 09

Re: some help on my VBS project?

Posted 14 October 2010 - 07:36 AM

The first error is see is here...miss end if

if x = ("hey") or x = ("hi") or x = ("hello") then 

     if i<5 then 
         sapi.Speak ("hello")  
         if i>5 then '<<<<<<<<<<<<<<<<<--NO END IF..CHECK CODE FOR THESE
             sapi.speak ("is it not a bit late to say hello?")  
         i=i+1  
     end if 


Was This Post Helpful? 1
  • +
  • -

#4 tim9009  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 73
  • Joined: 01-October 10

Re: some help on my VBS project?

Posted 15 October 2010 - 02:18 AM

View Postmacosxnerd101, on 14 October 2010 - 05:58 AM, said:

Moved to VB6.

What problems or errors are you experiencing?

I get an error that say: lopp whit no do (or something like that:p)

View Postguyfromri, on 14 October 2010 - 06:36 AM, said:

The first error is see is here...miss end if

if x = ("hey") or x = ("hi") or x = ("hello") then 

     if i<5 then 
         sapi.Speak ("hello")  
         if i>5 then '<<<<<<<<<<<<<<<<<--NO END IF..CHECK CODE FOR THESE
             sapi.speak ("is it not a bit late to say hello?")  
         i=i+1  
     end if 


OOOps :P thank you it works now :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1