Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

adding an array to a bot script

Name: Anonymous 2010-06-13 21:53

How can I make an array so I can give the same answer for multiple questions? Heres the original below is what I mean.
<?php

// Chat bot messages
if(stristr($text, 'help me'))
      {
// KEYWORDS TRIGGER START
    $this->insertChatBotMessage(
                    $this->getPrivateMessageID(),
"\nHow may I help you?\n" //This is what the chatbot says when the visitor enters help me anywhere in a sentence!
 );
}
?>


>Example of what I mean:
<?php

// Chat bot messages
if(stristr($text, 'help me, admin i need u, admin i need you, i am confused'))
      {
// KEYWORDS TRIGGER START
    $this->insertChatBotMessage(
                    $this->getPrivateMessageID(),
"\nHow may I help you?\n" //This is what the chatbot says when the visitor enters help me anywhere in a sentence!
 );
}

Name: Anonymous 2010-06-13 21:55

oh god

Name: Anonymous 2010-06-13 22:27

It's people like you that make PHP advocates like myself look bad.

This question is not appropriate for /prog/. You should be considering the design of your system: what your bot is actually looking for. The data types will follow.

Use [code][/code] tags.

Read SICP.

Name: Anonymous 2010-06-13 22:33

>>3
Martin, is that you?

Name: Anonymous 2010-06-13 22:33

// Chat bot messages
if(stristr($text, 'help me'))
      {
// KEYWORDS TRIGGER START
    $this->insertChatBotMessage(
                    $this->getPrivateMessageID(),
"\nHow may I help you?\n" //This is what the chatbot says when the visitor enters help me anywhere in a sentence!
 );
}

Name: Anonymous 2010-06-13 22:38

Hey OP, you might wanna try /pr/, you'll fit in much better there

Name: Anonymous 2010-06-13 22:40

>>1
derp

Name: Anonymous 2010-06-13 23:46

WEBDESIGNER QUALITY

but I'll bite it: write a routine that takes the input message and an array of strings to check against as arguments.

Don't change these.
Name: Email:
Entire Thread Thread List