User Control Panel
Advertisements

HELP US, HELP YOU!

Creating a New Brain

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
TapperTom
Newbie
Newbie


Joined: 03 Aug 2005
Posts: 4

Reputation: 10.6

PostPosted: Wed Jun 14, 2006 4:42 pm    Post subject: Creating a New Brain Reply with quote

Hey!

I was wondering if someone could help me, I was curious as to whether or not I could make another Brain for my White Warrior.

I made a copy of "Trigger" Brain and created a new txt file with some new responses and put it in the same folder as all the other responses.

When I edited the New Trigger brain to all the specific info. and edited the Commands such as !usebrain/!talk and !brain. Then I tell the bot to use my new brain (The copy of Trigger) but it never seems to work.

It registers the new brain but never responds..

Hope you can help.. Thanks, Tom
Back to top
patrick
Newbie
Newbie


Joined: 17 Apr 2006
Posts: 42
Location: Arnhem, the Netherlands
Reputation: 5.3Reputation: 5.3Reputation: 5.3Reputation: 5.3Reputation: 5.3
votes: 1

PostPosted: Wed Jun 14, 2006 7:37 pm    Post subject: Reply with quote

If you change the file name or the path you need to change the part that loads the module also.

the normal code to use the module was:
Code:
use Trigger;
my $trigger = new Trigger();


but when you changed the file name or path you need to edit the part that loads the module.
If it is in you lib:
Code:
use ModuleName;
my $trigger = new Trigger();

if it is in lib/brain
Code:
use FolderName::ModuleName;
my $trigger = new Trigger();
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Wed Jun 14, 2006 8:04 pm    Post subject: Reply with quote

If you just want a new text file, use:

use Trigger;
my $trigger = new Trigger(filename=> 'new_file.txt');

This'll save the use of another module Smile

_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
TapperTom
Newbie
Newbie


Joined: 03 Aug 2005
Posts: 4

Reputation: 10.6

PostPosted: Thu Jun 15, 2006 10:09 am    Post subject: Reply with quote

Thanks guys!

Patrick - where is that bit of code coming from? What command? So I know where to find it.

What I am trying to do is to create another Brain with a different set of responses which can reply just like Trigger.

By typing !usebrain NewBrain I can then use this brain with the new responses.txt

I will again try this afternoon.. Got an exam soon but its my last one soo Cool

Ill get back to you Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help 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