User Control Panel
Advertisements

HELP US, HELP YOU!

If_____Reply______

 
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions
View unanswered posts
Author Message
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Wed Jun 15, 2005 3:47 pm    Post subject: If_____Reply______ Reply with quote

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
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Wed Jun 15, 2005 11:01 pm    Post subject: Reply with quote

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
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Wed Jun 15, 2005 11:05 pm    Post subject: Reply with quote

How would I have it do that
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Thu Jun 16, 2005 12:59 pm    Post subject: Reply with quote

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
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Thu Jun 16, 2005 1:05 pm    Post subject: Reply with quote

And I would put that in the brain.pl file, right?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group