|
| Author |
Message |
TapperTom Newbie

Joined: 03 Aug 2005 Posts: 4
 
|
Posted: Wed Jun 14, 2006 4:42 pm Post subject: Creating a New Brain |
|
|
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

Joined: 17 Apr 2006 Posts: 42 Location: Arnhem, the Netherlands
      votes: 1
|
Posted: Wed Jun 14, 2006 7:37 pm Post subject: |
|
|
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

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Wed Jun 14, 2006 8:04 pm Post subject: |
|
|
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  _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
TapperTom Newbie

Joined: 03 Aug 2005 Posts: 4
 
|
Posted: Thu Jun 15, 2006 10:09 am Post subject: |
|
|
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
Ill get back to you  |
|
| Back to top |
|
 |
|