diff options
| author | 2007-07-26 00:46:31 +0000 | |
|---|---|---|
| committer | 2007-07-26 00:46:31 +0000 | |
| commit | 3790452619828dc2c5d27c13eeec7b67b3fe6eff (patch) | |
| tree | ad2940dfb841c15843e015cd2f80e8bedb5223e6 /modules/actions.pl | |
| parent | 2e39d5b2b95c2e705fd962c9752070f816c1dfec (diff) | |
new commands like ;help, code optimizations, bugfixes, colors in the messages, and more\!
Diffstat (limited to 'modules/actions.pl')
| -rw-r--r-- | modules/actions.pl | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/modules/actions.pl b/modules/actions.pl index 386e51a..08bf1be 100644 --- a/modules/actions.pl +++ b/modules/actions.pl @@ -1,35 +1,57 @@ +package ASM::Actions; use strict; use warnings; -#package Actions; +sub new +{ + my $module = shift; + my $self = {}; + my $tbl = { + "ban" => \&ban, + "kban" => \&kban, + "kick" => \&kick, + "none" => \&none, + "quiet" => \&quiet, + }; + $self->{ftbl} = $tbl; + bless($self); + return $self; +} + +sub do +{ + my $self = shift; + my $item = shift; + return $self->{ftbl}->{$item}->(@_); +} -sub Actions::ban { +sub ban { my ($conn, $event, $chan) = @_; $::oq->o_send( $conn, "mode $chan +b *!*\@$event->{host}" ); return "mode $chan -b *!*\@$event->{host}"; } -sub Actions::kban { +sub kban { my ($conn, $event, $chan) = @_; $::oq->o_send($conn, "mode $chan +b *!*\@$event->{host}"); $::oq->o_send($conn, "kick $chan $event->{nick} :Spamming"); return "mode $chan -b *!*\@$event->{host}"; } -sub Actions::kick { +sub kick { my ($conn, $event, $chan) = @_; $::oq->o_send($conn, "kick $chan $event->{nick} :Spamming"); return ""; } -sub Actions::none { +sub none { return ""; } -sub Actions::quiet { +sub quiet { my ($conn, $event, $chan) = @_; $::oq->o_send( $conn, "mode $chan +b %*!*\@$event->{host}" ); return "mode $chan -b %*!*\@$event->{host}"; } -return 1; +1; |
