okay I came up with this
yet to be debugged code:
PHP Code:
<?php
if (!strstr($message, 'TypingUser'))
{
$catch = array (
'1',
'2',
'fuck you',
'fuck me',
'im not fat sorry',
'lol'
);
$response = array (
'M3GA@stoned.com, johnny10561@hotmail.com',
'HotelunderSeige',
'you punji',
'not your fat ass',
'and im human',
'go back to thailand commi, nothing is funny there'
);
$default = array (
'speak english you dumb cunt',
"I can't understand a word you're saying.."
);
if(eregi('hey',$mesg)>0)
{
return $last;
}
else if(strlen($mesg)>0)
{
for($i=0;$i<count($catch);$i++)
{
if(eregi($catch[$i],$mesg)>0)
{
return $response[$i];
}
}
}
return $default[rand(0,1)]; //default message incase we can't find a match
}
?>
Hope you like :)
update: Now, if the arrays were stored in a database of some sort, we'd be able to grab, insert, & update a limitless amount of messages which connect to responses. With the talktomebot, it actually had multiple responses for multiple messages (related of course), so that if you said hi, hey, hello, or hai, it might give you the same response, or a different one in return.
I feel that gave the bot a little bit more life. The important thing to keep in mind is to keep it simple, and keep it dynamic. Later we can talk about giving users the power to add responses & such.