summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.gitignore1
-rw-r--r--Avalon.pm10
-rw-r--r--arthur.cfg.example4
-rwxr-xr-xarthur.pl7
4 files changed, 16 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 38b9ef8..1034fa6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*.swp
arthur.cfg
+Session.vim
diff --git a/Avalon.pm b/Avalon.pm
index 3bf30b2..6940c01 100644
--- a/Avalon.pm
+++ b/Avalon.pm
@@ -1,4 +1,7 @@
package Bot::BasicBot::Pluggable::Module::Avalon;
+{
+ $Avalon::Arthur::VERSION = '0.01';
+};
use strict;
use warnings;
@@ -7,12 +10,19 @@ use experimental qw(switch);
use base qw(Bot::BasicBot::Pluggable::Module);
+sub init {
+ my $self = shift;
+ $self->{avalon} = {};
+ $self->{avalon}->{config} = $self->bot->{store_object}->{store}->{cfg}->{cfg};
+}
+
sub help {
return "The avalon game simulator : https://github.com/adyxax/avalon-arthur";
}
sub told {
my ( $self, $mess ) = @_;
+ my $who = $mess->{who};
my $body = $mess->{body};
my $ispriv = defined $mess->{address};
diff --git a/arthur.cfg.example b/arthur.cfg.example
index ad80555..d31813e 100644
--- a/arthur.cfg.example
+++ b/arthur.cfg.example
@@ -7,5 +7,7 @@ ircname = Arthur the Avalon Game Master
server = example.org
port = 6667
password =
-channel = "#avalon"
ssl = 1
+
+[game]
+channel = "#avalon"
diff --git a/arthur.pl b/arthur.pl
index f2d0ec1..b1c29f7 100755
--- a/arthur.pl
+++ b/arthur.pl
@@ -4,9 +4,6 @@ use warnings;
use strict;
package Avalon::Arthur;
-{
- $Avalon::Arthur::VERSION = '0.01';
-}
use Bot::BasicBot::Pluggable;
use Config::Simple;
@@ -21,10 +18,10 @@ my $bot = Bot::BasicBot::Pluggable->new(
port => $cfg{'irc.port'},
password => $cfg{'irc.password'},
ssl => $cfg{'irc.ssl'},
- channels => ($cfg{'irc.channel'}),
+ channels => ($cfg{'game.channel'}),
store => Bot::BasicBot::Pluggable::Store->new(),
);
-$bot->{cfg} = \%cfg;
+$bot->{store_object}->{store}->{cfg}->{cfg} = \%cfg;
$bot->load("Auth");
$bot->{store_object}->{store}->{Auth}->{password_admin} = $cfg{'admin.password'};