diff options
author | Julien Dessaux | 2014-12-04 13:06:56 +0100 |
---|---|---|
committer | Julien Dessaux | 2014-12-04 13:06:56 +0100 |
commit | 7754a0b4b5b25cfc2d6faeb330cead16eb779fc7 (patch) | |
tree | 84522b215fe3edd74716f529642c471085978779 | |
parent | Bootstrapped arthur implementation in perl (diff) | |
download | avalon-arthur-7754a0b4b5b25cfc2d6faeb330cead16eb779fc7.tar.gz avalon-arthur-7754a0b4b5b25cfc2d6faeb330cead16eb779fc7.tar.bz2 avalon-arthur-7754a0b4b5b25cfc2d6faeb330cead16eb779fc7.zip |
Updated bot configuration
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Avalon.pm | 10 | ||||
-rw-r--r-- | arthur.cfg.example | 4 | ||||
-rwxr-xr-x | arthur.pl | 7 |
4 files changed, 16 insertions, 6 deletions
@@ -1,2 +1,3 @@ *.swp arthur.cfg +Session.vim @@ -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" @@ -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'}; |