Games-Axmud
view release on metacpan or search on metacpan
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
foreach my $item (@sortedList) {
$session->writeText(
' ' . $item . ' (type \'' . $obj->ivShow('attribTypeHash', $item)
. '\', switch: -' . $obj->ivShow('optionalSwitchHash', $item) . ')',
);
}
} else {
$session->writeText(' Non-standard attributes: <none>');
}
}
# Display footer
if (@list == 1) {
return $self->complete(
$session, $standardCmd,
'End of list (1 interface model displayed)',
);
} else {
return $self->complete(
$session, $standardCmd,
'End of list (' . scalar @list . ' interface models displayed)',
);
}
}
}
{ package Games::Axmud::Cmd::ClearClipboard;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('clearclipboard', TRUE, TRUE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['ccb', 'clearclipboard'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Clears the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
$check,
) = @_;
# Check for improper arguments
if (defined $check) {
return $self->improper($session, $inputString);
}
$axmud::CLIENT->reset_interfaceClipboardList();
return $self->complete($session, $standardCmd, 'The interface clipboard has been cleared');
}
}
{ package Games::Axmud::Cmd::ListClipboard;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('listclipboard', TRUE, TRUE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['lcb', 'listclipboard'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Lists the contents of the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
$check,
) = @_;
# Local variables
my $count;
# Check for improper arguments
if (defined $check) {
return $self->improper($session, $inputString);
}
if (! $axmud::CLIENT->interfaceClipboardList) {
return $self->complete($session, $standardCmd, 'The interface clipboard is empty');
}
# Display header
$session->writeText(
'Interface clipboard (* = enabled, A = active, D = dependent, I = independent)',
);
$session->writeText(
' Interface name Category Profile',
);
# Display list
foreach my $obj ($axmud::CLIENT->interfaceClipboardList) {
my ($string, $name, $extra);
if ($obj->enabledFlag) {
$string = '*'; # Enabled
} else {
$string = ' '; # Disabled
}
if ($obj->isa('Games::Axmud::Interface::Active')) {
if ($obj->indepFlag) {
$string .= 'AI '; # Independent interface
} else {
$string .= 'AD '; # Dependent interface
}
if (! defined $obj->assocProf) {
$extra = '';
} else {
$extra = ' ' . $obj->assocProf;
}
} else {
$string .= ' ';
$extra = ' ' . $obj->_parentWorld;
}
# Although interface names can be up to 64 characters, we'll show only the first 48
$name = $obj->name;
if (length $name > 48) {
$name = substr($name, 0, 45) . '...';
}
$session->writeText(
$string . sprintf(
'%-48.48s %-8.8s',
$obj->name,
$obj->category,
) . $extra,
);
}
# Display footer
$count = scalar $axmud::CLIENT->interfaceClipboardList;
if ($count == 1) {
return $self->complete(
$session, $standardCmd,
'End of list (1 interface found)',
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Modify the trigger
return $self->modifyInterface(
$session, $inputString, $standardCmd,
'trigger',
'triggers',
$axmud::CLIENT->ivShow('interfaceModelHash', 'trigger'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ExportTrigger;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('exporttrigger', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = [
'xtr',
'exptrig',
'exptrigger',
'exporttrig',
'exporttrigger',
];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Exports a trigger to the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Export the trigger
return $self->exportInterface(
$session, $inputString, $standardCmd,
'trigger',
'triggers',
$axmud::CLIENT->ivShow('interfaceModelHash', 'trigger'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ImportTrigger;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('importtrigger', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = [
'itr',
'imptrig',
'imptrigger',
'importtrig',
'importtrigger',
];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Imports trigger(s) from the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# (No improper arguments to check)
# Import the trigger(s)
return $self->importInterface(
$session, $inputString, $standardCmd,
'trigger',
'triggers',
$axmud::CLIENT->ivShow('interfaceModelHash', 'trigger'),
@args,
);
}
}
{ package Games::Axmud::Cmd::DeleteTrigger;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('deletetrigger', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = [
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Modify the alias
return $self->modifyInterface(
$session, $inputString, $standardCmd,
'alias',
'aliases',
$axmud::CLIENT->ivShow('interfaceModelHash', 'alias'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ExportAlias;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('exportalias', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['xal', 'expal', 'expalias', 'exportal', 'exportalias'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Exports an alias to the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Export the alias
return $self->exportInterface(
$session, $inputString, $standardCmd,
'alias',
'aliases',
$axmud::CLIENT->ivShow('interfaceModelHash', 'alias'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ImportAlias;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('importalias', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['ial', 'impal', 'impalias', 'importal', 'importalias'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Imports alias(es) from the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# (No improper arguments to check)
# Import the alias(es)
return $self->importInterface(
$session, $inputString, $standardCmd,
'alias',
'aliases',
$axmud::CLIENT->ivShow('interfaceModelHash', 'alias'),
@args,
);
}
}
{ package Games::Axmud::Cmd::DeleteAlias;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('deletealias', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['dal', 'delal', 'delalias', 'deleteal', 'deletealias'];
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Modify the macro
return $self->modifyInterface(
$session, $inputString, $standardCmd,
'macro',
'macros',
$axmud::CLIENT->ivShow('interfaceModelHash', 'macro'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ExportMacro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('exportmacro', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['xma', 'expma', 'expmacro', 'exportmac', 'exportmacro'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Exports a macro to the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Export the macro
return $self->exportInterface(
$session, $inputString, $standardCmd,
'macro',
'macros',
$axmud::CLIENT->ivShow('interfaceModelHash', 'macro'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ImportMacro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('importmacro', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['ima', 'impma', 'impmacro', 'importma', 'importmacro'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Imports macro(s) from the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# (No improper arguments to check)
# Import the macro(s)
return $self->importInterface(
$session, $inputString, $standardCmd,
'macro',
'macros',
$axmud::CLIENT->ivShow('interfaceModelHash', 'macro'),
@args,
);
}
}
{ package Games::Axmud::Cmd::DeleteMacro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('deletemacro', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['dma', 'delma', 'delmacro', 'deletema', 'deletemacro'];
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Modify the timer
return $self->modifyInterface(
$session, $inputString, $standardCmd,
'timer',
'timers',
$axmud::CLIENT->ivShow('interfaceModelHash', 'timer'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ExportTimer;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('exporttimer', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['xti', 'expti', 'exptimer', 'exportti', 'exporttimer'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Exports a timer to the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Export the timer
return $self->exportInterface(
$session, $inputString, $standardCmd,
'timer',
'timers',
$axmud::CLIENT->ivShow('interfaceModelHash', 'timer'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ImportTimer;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('importtimer', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['iti', 'impti', 'imptimer', 'importti', 'importtimer'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Imports timer(s) from the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# (No improper arguments to check)
# Import the timer(s)
return $self->importInterface(
$session, $inputString, $standardCmd,
'timer',
'timers',
$axmud::CLIENT->ivShow('interfaceModelHash', 'timer'),
@args,
);
}
}
{ package Games::Axmud::Cmd::DeleteTimer;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('deletetimer', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['dti', 'delti', 'deltimer', 'deleteti', 'deletetimer'];
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Modify the hook
return $self->modifyInterface(
$session, $inputString, $standardCmd,
'hook',
'hooks',
$axmud::CLIENT->ivShow('interfaceModelHash', 'hook'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ExportHook;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('exporthook', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['xhk', 'exphk', 'exphook', 'exporthk', 'exporthook'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Exports a hook to the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# Check for improper arguments
if (! @args) {
return $self->improper($session, $inputString);
}
# Export the hook
return $self->exportInterface(
$session, $inputString, $standardCmd,
'hook',
'hooks',
$axmud::CLIENT->ivShow('interfaceModelHash', 'hook'),
@args,
);
}
}
{ package Games::Axmud::Cmd::ImportHook;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('importhook', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['ihk', 'imphk', 'imphook', 'importhk', 'importhook'];
$self->{userCmdList} = \@{$self->{defaultUserCmdList}};
$self->{descrip} = 'Imports hook(s) from the interface clipboard';
# Bless the object into existence
bless $self, $class;
return $self;
}
##################
# Methods
sub do {
my (
$self, $session, $inputString, $userCmd, $standardCmd,
@args,
) = @_;
# (No improper arguments to check)
# Import the hook(s)
return $self->importInterface(
$session, $inputString, $standardCmd,
'hook',
'hooks',
$axmud::CLIENT->ivShow('interfaceModelHash', 'hook'),
@args,
);
}
}
{ package Games::Axmud::Cmd::DeleteHook;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
# Constructors
sub new {
# Create a new instance of this command object (there should only be one)
#
# Expected arguments
# (none besides $class)
#
# Return values
# 'undef' if GA::Generic::Cmd->new reports an error
# Blessed reference to the new object on success
my ($class, $check) = @_;
# Setup
my $self = Games::Axmud::Generic::Cmd->new('deletehook', TRUE, FALSE);
if (! $self) {return undef}
$self->{defaultUserCmdList} = ['dhk', 'delhk', 'delhook', 'deletehk', 'deletehook'];
( run in 1.644 second using v1.01-cache-2.11-cpan-84e82930d8c )