|
| Author |
Message |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Wed Jun 15, 2005 3:47 pm Post subject: If_____Reply______ |
|
|
Is there a way I could keep my nexusbot as a learning bot, but have a file that looks like this:
If client says_______then bot replies with_________
Pretty much when the bot receives an IM, it searches that document. If the clients IM appears there, the bot uses the response specified. If the IM is not there, it uses it's learning brain to come up with a reply. I *might* be able to figure out the coding, but where would I put it? and how would I let it know to search for the reply there before using it's learning brain? |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Wed Jun 15, 2005 11:01 pm Post subject: |
|
|
You would probably put it in brain.pl after it does the checks for things such as "i am (.*?) years old"
And the coding would be something along the lines of, open file full of replies, each line would have the input and response (with a separator of course) check if message contains input, if yes give the response. |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Wed Jun 15, 2005 11:05 pm Post subject: |
|
|
| How would I have it do that |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Thu Jun 16, 2005 12:59 pm Post subject: |
|
|
The abbreviated version:
Open reply file, put into array, close file
Foreach line in the array:
- Split the trigger and reply apart
- If $msg =~ /^$trigger$/i
- Send the reply part back to the human.
End foreach |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Thu Jun 16, 2005 1:05 pm Post subject: |
|
|
| And I would put that in the brain.pl file, right? |
|
| Back to top |
|
 |
|