view release on metacpan or search on metacpan
- Axmud stores its data file in a default location. The last release added a
';setdatadirectory' command, so that users can set a different location;
this did not work if the location didn't already contain some data files.
Fixed
- Fixed a crash that occured when connecting to Achaea and other IRE worlds.
Fixed a series of warning messages when connecting to Aetolia and some other
IRE worlds
- By default, the 'main' window can contain up to 10000 lines of text. Once this
limit was reached, Axmud started drawing clickable links in the wrong place
(if at all). Fixed several issues and it's now working as intended
- Macros did not recognise (or accept) keypresses like CTRL+F1 or ALT+5.
Modified them so that a wider range of keypresses are acceptable. (Macros
still do not respond to a keypress like 'x', because that would leave the
user unable to type ordinary commands)
- ';toggleshare', which tells Axmud to use a different 'main' window for every
connection (or not), was broken. Fixed it, and you can now change the
setting from the client preference window, if that's more convenient
Minor new features
- In Axmud's source code, the ../share/standalone directory contains a new Perl
script which removes the labels from a world model file without the need to
start Axmud
- Fixed mutliple ECHO issues at worlds where echoing of keyboard input is
permanently turned off (e.g. at MUD1)
- Fixed several problems with basic mapping mode at worlds like MUD1/MUD2
- Temporary directories in Axmud's data folder were not emptied when Axmud
starts, as they should have been. Fixed, which in many cases reduces the
size of the data folder by 33%
- Fixed problems with clickable links that caused a crash when they appeared at
the end of line (in certain situations)
- Fixed automapper error that used the wrong destination room, after a departure
room was moved in a fixed direction (or transferred to a new region)
- Macros created by the Compass task were not destroyed when the task was halted
or reset. Fixed
Minor new features
- Routes (see the help for ';addroute') can now use speedwalk commands like
'.3nw2s', as well as the more conventional 'n;n;n;w;s;s' and
'north;north;north;west;south;south'
- The setup wizard window (visible when you first run Axmud) now offers to use
recommended options for your system, rather than forcing you to click
through several pages of options
- Use ';debugconnection -q' if you want to see a debug message when invalid (or
lib/Games/Axmud/Cage.pm view on Meta::CPAN
##################
# Methods
##################
# Accessors - set
##################
# Accessors - get
}
{ package Games::Axmud::Cage::Macro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(
Games::Axmud::Generic::InterfaceCage Games::Axmud::Generic::Cage
Games::Axmud
lib/Games/Axmud/Client.pm view on Meta::CPAN
'EditCage', 'DeleteCage', 'ListCage', 'SetCageMask', 'EditCageMask',
'@Interfaces',
'EnableActiveInterface', 'DisableActiveInterface', 'MoveActiveInterface',
'EditActiveInterface', 'ListActiveInterface',
'EditInterfaceModel', 'ListInterfaceModel',
'ClearClipboard', 'ListClipboard',
'AddTrigger', 'ModifyTrigger', 'ExportTrigger', 'ImportTrigger',
'DeleteTrigger', 'ListTrigger',
'AddAlias', 'ModifyAlias', 'ExportAlias', 'ImportAlias', 'DeleteAlias',
'ListAlias',
'AddMacro', 'QuickMacro', 'ModifyMacro', 'ExportMacro', 'ImportMacro',
'DeleteMacro', 'ListMacro',
'AddTimer', 'ModifyTimer', 'ExportTimer', 'ImportTimer', 'DeleteTimer',
'ListTimer',
'AddHook', 'ModifyHook', 'ExportHook', 'ImportHook', 'DeleteHook', 'ListHook',
'@Keycodes',
'ListKeycode', 'ListKeycodeAlternative',
'@Task package names',
'AddTaskPackage', 'DeleteTaskPackage', 'ResetTaskPackage', 'ListTaskPackage',
'@Task labels',
'AddTaskLabel', 'DeleteTaskLabel', 'ResetTaskLabel', 'ListTaskLabel',
'@Current tasks',
lib/Games/Axmud/Client.pm view on Meta::CPAN
# Interfaces are triggers, aliases, macros, timers and hooks
# Interface model objects store default values for each of these interfaces
# Registry hash of interface model objects, in the form
# $interfaceModelHash{interface_type} = blessed_reference_to_interface_model_object
interfaceModelHash => {},
# A 'clipboard' into which interfaces can be exported, and from which they can be
# imported. This allows the user to easily copy interfaces from (for example) one
# world to another, when sessions are open for both
# A list of GA::Interface::Trigger, GA::Interface::Alias, GA::Interface::Macro,
# GA::Interface::Timer and/or GA::Interface::Hook objects currently stored in the
# 'clipboard'
interfaceClipboardList => [],
# Macros use keycodes - ways of naming keys on the keyboard (F1, Escape, grave etc)
# Axmud uses a standard set of keycodes that don't vary from system to system. For
# example, on Linux the ALT-GR key produces the keycode 'ISO_Level3_Shift', but on
# MS Windows, it produces the keycode 'Alt_R'. Axmud's standard keycode is 'alt_gr'
# Note that there are no Axmud standard keycodes for ordinary letters/numbers; Axmud
# assumes that these are needed for typing, so they're not available to macros
#
# Constant registry hash of Axmud standard keycode values, and their Linux equivalents.
# Hash in the form
# $constKeycodeHash{standard_value} = linux_value_string
# ...where 'standard_value' is a value used by Axmud to uniquely identify a key or
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
# List aliases
return $self->listInterface(
$session, $inputString, $standardCmd,
'alias',
'aliases',
@args,
);
}
}
{ package Games::Axmud::Cmd::AddMacro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
return $self->addInterface(
$session, $inputString, $standardCmd,
'macro',
'macros',
$axmud::CLIENT->ivShow('interfaceModelHash', 'macro'),
@args,
);
}
}
{ package Games::Axmud::Cmd::QuickMacro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
$prevBufferObj = $session->ivShow('instructBufferHash', $session->instructBufferLast);
if (! $prevBufferObj) {
return $self->error(
$session, $inputString,
'Can\'t create a macro because the instruction buffer is empty',
);
}
}
# Add the macro, pretending to be a call from GA::Cmd::AddMacro->do
return $self->addInterface(
$session, 'addmacro -s' . $arg . ' -p ' . $prevBufferObj->instruct, $standardCmd,
'macro',
'macros',
$axmud::CLIENT->ivShow('interfaceModelHash', 'macro'),
'-s',
$arg,
'-p',
$prevBufferObj->instruct,
);
}
}
{ package Games::Axmud::Cmd::ModifyMacro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
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);
##################
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
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);
##################
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
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);
##################
lib/Games/Axmud/Cmd.pm view on Meta::CPAN
# Delete the macro
return $self->deleteInterface(
$session, $inputString, $standardCmd,
'macro',
'macros',
@args,
);
}
}
{ package Games::Axmud::Cmd::ListMacro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Cmd Games::Axmud);
##################
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
return 1;
}
##################
# Accessors - set
##################
# Accessors - get
}
{ package Games::Axmud::EditWin::Cage::Macro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(
Games::Axmud::EditWin::Generic::InterfaceCage Games::Axmud::EditWin::Generic::Cage
Games::Axmud::Generic::EditWin Games::Axmud::Generic::ConfigWin
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# 1 if the check succeeds
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->checkEditObj', @_);
}
if ($self->editObj && ! $self->editObj->isa('Games::Axmud::Cage::Macro')) {
return undef;
} else {
return 1;
}
}
# sub enableButtons {} # Inherited from GA::Generic::ConfigWin
# sub enableSingleButton {} # Inherited from GA::Generic::ConfigWin
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
$self->ivPoke('singular', 'macro');
$self->ivPoke('plural', 'macros');
$interfaceModelObj = $axmud::CLIENT->ivShow('interfaceModelHash', 'macro');
$self->ivPoke('interfaceModelObj', $interfaceModelObj);
$self->ivPoke('stimulus', $interfaceModelObj->stimulusName); # i.e. 'keycode'
$self->ivPoke('response', $interfaceModelObj->responseName); # i.e. 'instruction'
# Tab setup
# Create a notebook within the main one, so that we have two rows of tabs
my $innerNotebook = $self->addInnerNotebookTabs($self->notebook, '_Macros');
# Add tabs to the inner notebook
$self->interfaces1Tab($innerNotebook);
$self->interfaces2Tab($innerNotebook);
return 1;
}
##################
# Accessors - set
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# sub saveChanges {} # Inherited from GA::Generic::ConfigWin
##################
# Accessors - set
##################
# Accessors - get
}
{ package Games::Axmud::EditWin::Interface::Macro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(
Games::Axmud::EditWin::Generic::Interface Games::Axmud::Generic::EditWin
Games::Axmud::Generic::ConfigWin Games::Axmud::Generic::FreeWin Games::Axmud::Generic::Win
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
# 1 if the check succeeds
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->checkEditObj', @_);
}
if ($self->editObj && ! $self->editObj->isa('Games::Axmud::Interface::Macro')) {
return undef;
} else {
return 1;
}
}
# sub enableButtons {} # Inherited from GA::Generic::ConfigWin
# sub enableSingleButton {} # Inherited from GA::Generic::ConfigWin
lib/Games/Axmud/EditWin.pm view on Meta::CPAN
$self->addCheckButton(
$grid,
'Show additional connection information (requires a larger task window)',
'showInfoFlag',
TRUE,
1, 12, 1, 2);
$self->addCheckButton(
$grid,
'This task create its own macros to switch between sessions',
'useMacrosFlag',
TRUE,
1, 12, 2, 3);
$self->addLabel($grid,'If macros are created, which keycodes to use',
1, 6, 3, 4);
@list = (
'CTRL+1, CTRL+2 ... CTRL+9' => 'default',
'F1, F2 ... F9' => 'simple',
);
lib/Games/Axmud/Generic.pm view on Meta::CPAN
return $self->complete(
$session, $standardCmd,
'End of list (' . scalar @sortedList . ' ' . $category . ' profiles found)',
);
}
}
sub addInterface {
# Called by GA::Cmd::AddTrigger->do, AddAlias->do, AddMacro->do, AddTimer->do and
# AddHook->do
# (For the whole of this function, 'trigger' is taken to mean any of 'trigger', 'alias',
# 'macro', 'timer' or 'hook')
#
# This function adds an independent trigger to a trigger cage in response to the client
# command ';addtrigger'
# Unless there is a superior cage with a trigger of the same name, also adds an active
# trigger interface to the GA::Session's registry of active interfaces. In that case, if
# there is an inferior cage with a trigger of the same name, the corresponding active
# interface (if any) is destroyed. As a result, there will be exactly one active trigger
lib/Games/Axmud/Generic.pm view on Meta::CPAN
return $self->complete(
$session, $standardCmd,
'Inactive ' . $category . ' interface \'' . $newObjName . '\' created',
);
}
}
sub modifyInterface {
# Called by GA::Cmd::ModifyTrigger->do, ModifyAlias->do, ModifyMacro->do,
# ModifyTimer->do and ModifyHook->do
# (For the whole of this function, 'trigger' is taken to mean any of 'trigger', 'alias',
# 'macro', 'timer' or 'hook')
#
# This function modifies the attributes of an independent trigger stored in a trigger
# cage. If there's a corresponding active interface, it is also modified
#
# This function can also be called to modify an active interface directly, without
# changing the corresponding independent trigger stored in a trigger cage (if any)
#
lib/Games/Axmud/Generic.pm view on Meta::CPAN
return $self->complete(
$session, $standardCmd,
'Inactive ' . $category . ' interface \'' . $currentObjName . '\' modified',
);
}
}
}
sub exportInterface {
# Called by GA::Cmd::ExportTrigger->do, ExportAlias->do, ExportMacro->do,
# ExportTimer->do and ExportHook->do
# (For the whole of this function, 'trigger' is taken to mean any of 'trigger', 'alias',
# 'macro', 'timer' or 'hook')
#
# This function adds an inactive trigger, stored in a trigger cage, to Axmud's interface
# clipboard, from where it can 'imported' to a different cage (perhaps in a different
# world, in a different session)
# This function can also be called to export an active interface directly, without
# exporting the corresponding inactive trigger stored in a trigger cage (if any)
#
lib/Games/Axmud/Generic.pm view on Meta::CPAN
return $self->complete(
$session, $standardCmd,
'Inactive ' . $category . ' interface \'' . $currentObjName . '\' exported to the'
. ' interface clipboard',
);
}
}
sub importInterface {
# Called by GA::Cmd::ImportTrigger->do, ImportAlias->do, ImportMacro->do,
# ImportTimer->do and ImportHook->do
# (For the whole of this function, 'trigger' is taken to mean any of 'trigger', 'alias',
# 'macro', 'timer' or 'hook')
#
# This function clones all triggers in Axmud's interface clipboard, moving the copies into
# the specified cage.
#
# Expected arguments
# $session - The calling function's GA::Session
# $inputString - The command actually typed, e.g. 'itr mytrigger'
lib/Games/Axmud/Generic.pm view on Meta::CPAN
return $self->complete(
$session, $standardCmd,
'Import complete, ' . $categoryPlural . ' imported: ' . $successCount . ', failures: '
. $failCount,
);
}
sub deleteInterface {
# Called by GA::Cmd::DeleteTrigger->do, DeleteAlias->do, DeleteMacro->do,
# DeleteTimer->do and DeleteHook->do
# (For the whole of this function, 'trigger' is taken to mean any of 'trigger', 'alias',
# 'macro', 'timer' or 'hook')
#
# This function deletes an independent trigger stored in a trigger cage. If there's a
# corresponding active interface, it is also deleted
#
# This function can also be called to delete an active interface directly, without
# deleting the corresponding independent trigger stored in a trigger cage (if any)
#
lib/Games/Axmud/Generic.pm view on Meta::CPAN
return $self->complete(
$session, $standardCmd,
'Active ' . $category . ' interface \'' . $currentObjName . '\' deleted (and'
. ' no other interface created to replace it)',
);
}
}
sub listInterface {
# Called by GA::Cmd::ListTrigger->do, ListAlias->do, ListMacro->do, ListTimer->do and
# ListHook->do
# (For the whole of this function, 'trigger' is taken to mean any of 'trigger', 'alias',
# 'macro', 'timer' or 'hook')
#
# Lists triggers stored in a trigger cage, or lists active triggers
#
# Expected arguments
# $session - The calling function's GA::Session
# $inputString - The command actually typed, e.g. 'ltr -w'
# $standardCmd - Standard version of the client command, e.g. 'listtrigger'
lib/Games/Axmud/Generic.pm view on Meta::CPAN
$self->useEntryWithIcon($grid, 'cooldown', 'float', 0, undef,
9, 12, 2, 3,
8, 8);
# Tab complete
return 1;
}
sub macroAttributesTab {
# MacroAttributes tab
#
# Expected arguments
# (none besides $self)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->macroAttributesTab', @_);
}
# Tab setup
my $grid = $self->addTab(
$self->notebook,
'_Attributes',
['Macro attributes'],
);
# Macro attributes
$self->addLabel($grid, '<b>Macro attributes</b>',
0, 12, 0, 1);
# Left column
$self->useCheckButton($grid, 'Temporary macro', 'temporary', TRUE,
1, 6, 1, 2);
# Right column
$self->addLabel($grid, 'Cooldown (in seconds)',
7, 9, 1, 2);
$self->useEntryWithIcon($grid, 'cooldown', 'float', 0, undef,
lib/Games/Axmud/Generic.pm view on Meta::CPAN
# Check for improper arguments
if (
! defined $session || ! defined $profName || ! defined $profCategory
|| defined $check
) {
return $axmud::CLIENT->writeImproper($class . '->new', @_);
}
# Is this a trigger, alias, macro, timer or hook cage?
@typeList = ('Trigger', 'Alias', 'Macro', 'Timer', 'Hook');
OUTER: foreach my $item (@typeList) {
if (index ($class, $item) > -1) {
$cageType = lc($item);
last OUTER;
}
}
# Compose the cage's unique name
lib/Games/Axmud/Interface.pm view on Meta::CPAN
# Axmud interfaces are triggers, aliases, macros, timers and hooks. Depending on which
# profiles are current ones, and how many current profiles have interfaces with the same
# name, an interface can be 'active' or 'inactive' and 'independent' or 'dependent'
#
# 'Independent' interfaces are normally created by the user, and stored in a cage associated
# with a particular profile
# When a profile becomes a current profile, and provided that there are no other superior
# profile which have an interface with the same ->name, each of its interfaces becomes
# 'active'
# When an interface becomes active, GA::Session creates this object, copying into it the
# attributes from the parent GA::Interface::Trigger / ::Alias / ::Macro / ::Timer
# / ::Hook object
# When the interface becomes inactive again, this object gets destroyed (but the parent
# interface continues to exist)
#
# 'Dependent' interfaces are normally created by parts of the Axmud code immediately before
# this object is created. As soon as this object becomes inactive, the parent
# dependent interface is destroyed, as well.
#
# Expected arguments
# $session - The GA::Session which created this object
lib/Games/Axmud/Interface.pm view on Meta::CPAN
$self->_objClass . '->cloneToInactiveInterface',
@_,
);
}
if ($category eq 'trigger') {
$class = 'Games::Axmud::Interface::Trigger';
} elsif ($category eq 'alias') {
$class = 'Games::Axmud::Interface::Alias';
} elsif ($category eq 'macro') {
$class = 'Games::Axmud::Interface::Macro';
} elsif ($category eq 'timer') {
$class = 'Games::Axmud::Interface::Timer';
} elsif ($category eq 'hook') {
$class = 'Games::Axmud::Interface::Hook';
} else {
return undef;
}
if ($self->assocProf) {
lib/Games/Axmud/Interface.pm view on Meta::CPAN
sub attribHash
{ my $self = shift; return %{$self->{attribHash}}; }
sub beforeHash
{ my $self = shift; return %{$self->{beforeHash}}; }
sub afterHash
{ my $self = shift; return %{$self->{afterHash}}; }
}
{ package Games::Axmud::Interface::Macro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::Interface Games::Axmud);
##################
lib/Games/Axmud/Interface.pm view on Meta::CPAN
category => 'macro', # Shortcut to $self->_objClass
# Standard interface attributes
# -----------------------------
name => $name, # Max 32 chars
stimulus => $stimulus, # An Axmud standard keycode
response => $response, # An instruction
enabledFlag => $flag,
# Macro attributes
# ----------------
# Current values for each macro attribute (initially set to defaults)
attribHash => {
'temporary' => FALSE,
'cooldown' => 0,
},
# Ordering
# --------
lib/Games/Axmud/Interface.pm view on Meta::CPAN
category => $self->category,
# Standard interface attributes
# -----------------------------
name => $self->name,
stimulus => $self->stimulus,
response => $self->response,
enabledFlag => $self->enabledFlag,
# Macro attributes
# ----------------
attribHash => {$self->attribHash},
# Ordering
# --------
beforeHash => {$self->beforeHash},
afterHash => {$self->afterHash},
};
lib/Games/Axmud/InterfaceModel.pm view on Meta::CPAN
##################
# Methods
##################
# Accessors - set
##################
# Accessors - get
}
{ package Games::Axmud::InterfaceModel::Macro;
use strict;
use warnings;
# use diagnostics;
use Glib qw(TRUE FALSE);
our @ISA = qw(Games::Axmud::Generic::InterfaceModel Games::Axmud);
##################
lib/Games/Axmud/InterfaceModel.pm view on Meta::CPAN
_objClass => $class,
_parentFile => undef, # No parent file object
_parentWorld => undef, # No parent file object
_privFlag => TRUE, # All IVs are private
# Interface category
# ------------------
category => 'macro', # Shortcut to $self->_objClass
# Macro attributes
# ----------------
stimulusName => 'keycode',
responseName => 'instruction',
# Default values for each macro attribute
optionalAttribHash => {
'temporary' => FALSE,
},
# Acceptable values for all attributes (standard interface and macro)
attribTypeHash => {
# Standard
'name' => 'string',
'stimulus' => 'keycode',
'response' => 'instruction',
'enabled' => 'boolean',
# Macro
'temporary' => 'boolean',
'cooldown' => 'number',
},
# Switches used in client commands
compulsorySwitchHash => {
'stimulus' => 's',
'response' => 'p',
},
lib/Games/Axmud/Obj/File.pm view on Meta::CPAN
if ($class =~ m/Route$/) {
$hashRef = $obj->{routeHash};
foreach my $key (keys %$hashRef) {
$$hashRef{$key} = $self->update_obj_route($$hashRef{$key});
}
$obj->{routeHash} = $hashRef;
} elsif ($class =~ m/(Trigger|Alias|Macro|Timer|Hook)$/) {
$hashRef = $obj->{interfaceHash};
foreach my $key (keys %$hashRef) {
$$hashRef{$key} = $self->update_interface_all($$hashRef{$key});
}
$obj->{interfaceHash} = $hashRef;
}
lib/Games/Axmud/Obj/Telnet.pm view on Meta::CPAN
sub TELOPT_NAOP () {9}; # Output Page Size
sub TELOPT_NAOCRD () {10}; # Output Carriage-Return Disposition
sub TELOPT_NAOHTS () {11}; # Output Horizontal Tab Stops
sub TELOPT_NAOHTD () {12}; # Output Horizontal Tab Disposition
sub TELOPT_NAOFFD () {13}; # Output Formfeed Disposition
sub TELOPT_NAOVTS () {14}; # Output Vertical Tabstops
sub TELOPT_NAOVTD () {15}; # Output Vertical Tab Disposition
sub TELOPT_NAOLFD () {16}; # Output Linefeed Disposition
sub TELOPT_XASCII () {17}; # Extended ASCII
sub TELOPT_LOGOUT () {18}; # Logout
sub TELOPT_BM () {19}; # Byte Macro
sub TELOPT_DET () {20}; # Data Entry Terminal
sub TELOPT_SUPDUP () {21}; # SUPDUP
sub TELOPT_SUPDUPOUTPUT () {22}; # SUPDUP Output
sub TELOPT_SNDLOC () {23}; # Send Location
sub TELOPT_TTYPE () {24}; # Terminal Type
sub TELOPT_EOR () {25}; # End of Record
sub TELOPT_TUID () {26}; # TACACS User Identification
sub TELOPT_OUTMRK () {27}; # Output Marking
sub TELOPT_TTYLOC () {28}; # Terminal Location Number
sub TELOPT_3270REGIME () {29}; # Telnet 3270 Regime
lib/Games/Axmud/OtherWin.pm view on Meta::CPAN
return $axmud::CLIENT->writeImproper($self->_objClass . '->activeInterfaceHeader', @_);
}
# Prepare the list of tabs
$tabListRef = [
'All' => 'A_ll',
'Dependent' => '_Dependent',
'Independent' => 'I_ndependent',
'Trigger' => '_Trigger',
'Alias' => '_Alias',
'Macro' => '_Macro',
'Timer' => 'T_imer',
'Hook' => '_Hook',
];
@shortTabList = (
'All', 'Dependent', 'Independent',
'Trigger', 'Alias', 'Macro', 'Timer', 'Hook',
);
# Prepare the list of column headings
$columnListRef = [
'#' => 'int',
'Enab.' => 'bool',
'Indep.' => 'bool',
'Cat.' => 'text',
'Name' => 'text',
];
lib/Games/Axmud/PrefWin.pm view on Meta::CPAN
# Prepare a list of combo items. The keys are the combo items themselves, the corresponding
# values are arguments to send to $self->interfaces1Tab_refreshList
@list = (
'Numerically' => 'all',
'Alphabetically' => 'alpha',
'Dependent only' => 'dependent',
'Independent only' => 'independent',
'Triggers only' => 'trigger',
'Aliases only' => 'alias',
'Macros only' => 'macro',
'Timers only' => 'timer',
'Hooks only' => 'hook',
);
do {
my $key = shift @list;
my $value = shift @list;
push (@comboList, $key);
lib/Games/Axmud/Session.pm view on Meta::CPAN
# available to those programes as the variable $_hookVar
perlCmdDataHash => {
# All interfaces
'_interface' => undef,
# Trigger interfaces
'_line' => undef,
'_stripLine' => undef,
'_modLine' => undef,
# Alias interfaces
'_originalCmd' => undef,
# Macro response
'_keycode' => undef,
# Timer response
'_timerExpect' => undef,
'_timerTime' => undef,
# Hook response
'_hookEvent' => undef,
'_hookVar' => undef,
'_hookVal' => undef,
},
# Parallel hash used by trigger interfaces which stores escape sequences (converted into
lib/Games/Axmud/Session.pm view on Meta::CPAN
return $returnValue; # If 'undef', no command is sent to the world
} else {
# Return the original command (or the modified instruction, if any alias has fired)
return $cmd;
}
}
sub checkMacros {
# Called by ->signal_connect in GA::Win::Internal->setKeyPressEvent
# Checks every active macro interface. Fires every macro that should be fired in response to
# a keypress
#
# Expected arguments
# $keycode - The standard keycode, e.g. 'f5' (or keycode string, e.g. 'ctrl shift f5')
# representing the keypress
#
# Return values
lib/Games/Axmud/Session.pm view on Meta::CPAN
# Local variables
my (
$fireFlag,
@deleteList,
%hash,
);
# Check for improper arguments
if (! defined $keycode || defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->checkMacros', @_);
}
# Import the active macro registry for quick lookup
%hash = $self->macroHash;
# Check every active macro interface, in the correct order, to see if it is due to fire
$fireFlag = FALSE;
OUTER: foreach my $number ($self->macroOrderList) {
my ($obj, $class, $method);
if ($hash{$number} eq $keycode) {
# The macro keycode matches. Check the interface number is valid
if (! $self->ivExists('interfaceNumHash', $number)) {
$self->writeError(
'Invalid active macro interface #' . $number,
$self->_objClass . '->checkMacros',
);
# Avoid multiple error messages by stopping checking macros now
last OUTER;
} else {
$obj = $self->ivShow('interfaceNumHash', $number);
}
lib/Games/Axmud/Session.pm view on Meta::CPAN
# Alias interfaces
local our $_originalCmd;
if (defined $hash{'_originalCmd'}) {
$_originalCmd = $hash{'_originalCmd'};
} else {
$_originalCmd = '';
}
$compart->share('$_originalCmd');
# Macro interfaces
local our $_keycode;
if (defined $hash{'_keycode'}) {
$_keycode = $hash{'_keycode'};
} else {
$_keycode = '';
}
$compart->share('$_keycode');
# Timer interfaces
lib/Games/Axmud/Strip.pm view on Meta::CPAN
# (Requires a visible session whose status is 'connected' or 'offline', and a current
# character)
$self->ivAdd('menuItemHash', 'char_aliases', $menuItem_charAliases);
my $menuItem_showAliases = Gtk3::MenuItem->new('_Aliases');
$menuItem_showAliases->set_submenu($subMenu_showAliases);
$menuColumn_interfaces->append($menuItem_showAliases);
# (Requires a visible session whose status is 'connected' or 'offline')
$self->ivAdd('menuItemHash', 'show_aliases', $menuItem_showAliases);
# 'Macros' submenu
my $subMenu_showMacros = Gtk3::Menu->new();
my $menuItem_worldMacros = Gtk3::MenuItem->new('_World macros...');
$menuItem_worldMacros->signal_connect('activate' => sub {
# Open the cage window on the notebook's second page, so the user can see the list
# of macros immediately
$self->winObj->visibleSession->pseudoCmd('editcage -m', $mode);
});
$subMenu_showMacros->append($menuItem_worldMacros);
my $menuItem_guildMacros = Gtk3::MenuItem->new('_Guild macros...');
$menuItem_guildMacros->signal_connect('activate' => sub {
$self->winObj->visibleSession->pseudoCmd(
'editcage macro_guild_' . $self->winObj->visibleSession->currentGuild->name,
$mode,
);
});
$subMenu_showMacros->append($menuItem_guildMacros);
# (Requires a visible session whose status is 'connected' or 'offline', and a current
# guild)
$self->ivAdd('menuItemHash', 'guild_macros', $menuItem_guildMacros);
my $menuItem_raceMacros = Gtk3::MenuItem->new('_Race macros...');
$menuItem_raceMacros->signal_connect('activate' => sub {
$self->winObj->visibleSession->pseudoCmd(
'editcage macro_race_' . $self->winObj->visibleSession->currentRace->name,
$mode,
);
});
$subMenu_showMacros->append($menuItem_raceMacros);
# (Requires a visible session whose status is 'connected' or 'offline', and a current
# race)
$self->ivAdd('menuItemHash', 'race_macros', $menuItem_raceMacros);
my $menuItem_charMacros = Gtk3::MenuItem->new('_Character macros...');
$menuItem_charMacros->signal_connect('activate' => sub {
$self->winObj->visibleSession->pseudoCmd(
'editcage macro_char_' . $self->winObj->visibleSession->currentChar->name,
$mode,
);
});
$subMenu_showMacros->append($menuItem_charMacros);
# (Requires a visible session whose status is 'connected' or 'offline', and a current
# character)
$self->ivAdd('menuItemHash', 'char_macros', $menuItem_charMacros);
my $menuItem_showMacros = Gtk3::MenuItem->new('_Macros');
$menuItem_showMacros->set_submenu($subMenu_showMacros);
$menuColumn_interfaces->append($menuItem_showMacros);
# (Requires a visible session whose status is 'connected' or 'offline')
$self->ivAdd('menuItemHash', 'show_macros', $menuItem_showMacros);
# 'Timers' submenu
my $subMenu_showTimers = Gtk3::Menu->new();
my $menuItem_worldTimers = Gtk3::MenuItem->new('_World timers...');
$menuItem_worldTimers->signal_connect('activate' => sub {
# Open the cage window on the notebook's second page, so the user can see the list
# of timers immediately
$self->winObj->visibleSession->pseudoCmd('editcage -i', $mode);
lib/Games/Axmud/Task.pm view on Meta::CPAN
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->doInit', @_);
}
# Set up the keyboard macros
$self->resetMacros();
# If the task has recently been updated, quickest way to update the window is to remove all
# the current table objects, before creating new ones
if ($self->hasResetFlag) {
if (! defined $self->winObj->tableStripObj->removeAllTableObjs()) {
# Operation failed; task must close
$self->ivPoke('shutdownFlag', TRUE);
return 1;
lib/Games/Axmud/Task.pm view on Meta::CPAN
# 1 otherwise
my ($self, $check) = @_;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->doShutdown', @_);
}
# Remove macros, ready for $self->resetMacros to be called to create new ones
foreach my $interfaceObj ($self->macroList) {
# The TRUE argument means 'don't show an error message if the interface doesn't exist'
$self->session->deleteInterface($interfaceObj->name, TRUE);
}
return 1;
}
sub doReset {
lib/Games/Axmud/Task.pm view on Meta::CPAN
# 1 otherwise
my ($self, $newTaskObj, $check) = @_;
# Check for improper arguments
if (! defined $newTaskObj || defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->doReset', @_);
}
# Remove macros, ready for $self->resetMacros to be called to create new ones
foreach my $interfaceObj ($self->macroList) {
# The TRUE argument means 'don't show an error message if the interface doesn't exist'
$self->session->deleteInterface($interfaceObj->name, TRUE);
}
return 1;
}
sub resetMacros {
# Called by $self->doInit to set up macros that fire when the user presses one of the keys
# on their keypad
#
# Expected arguments
# (none)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
lib/Games/Axmud/Task.pm view on Meta::CPAN
# Local variables
my (
$dictObj,
@macroList,
%dirHash, %cmdHash, %macroHash,
);
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->resetMacros', @_);
}
# Import the hash of standard directions (for quick lookup)
%dirHash = $self->keypadDirHash;
# Import the hash of keyboard commands (for quick lookup)
%cmdHash = $self->keypadCmdHash;
# Import the current dictionary
$dictObj = $self->session->currentDict;
# Create one macro (initially disabled) for each standard primary direction
lib/Games/Axmud/Task.pm view on Meta::CPAN
$dictObj->ivShow('primaryDirHash', $standardDir), # Response
'enabled',
0,
);
if (! $interfaceObj) {
$self->writeWarning(
'Couldn\'t create macro for the standard keycode \'' . $standardKeycode
. '\'',
$self->_objClass . '->resetMacros',
);
last OUTER;
} else {
push (@macroList, $interfaceObj);
}
}
}
lib/Games/Axmud/Task.pm view on Meta::CPAN
$cmd, # Response
'enabled',
0,
);
if (! $interfaceObj) {
$self->writeWarning(
'Couldn\'t create macro for the standard keycode \'' . $standardKeycode
. '\'',
$self->_objClass . '->resetMacros',
);
last OUTER;
} else {
push (@macroList, $interfaceObj);
$macroHash{$standardKeycode} = $interfaceObj;
}
}
lib/Games/Axmud/Task.pm view on Meta::CPAN
$self->{status} = 'wait_init';
# $self->{activeFlag} = TRUE; # Task can't be activated/disactivated
# Task parameters
# Flag set to TRUE if the connection/idle times for each session should be shown, FALSE if
# not
$self->{showInfoFlag} = FALSE;
# This task creates macros to intercept CTRL+1, CTRL+2 ... CTRL+9 (or an equivalent set of
# keypresses). If this flag is TRUE, the macros are created enabled; if FALSE, they are
# created disabled
$self->{useMacrosFlag} = TRUE;
# Which set of keypresses to use:
# 'default' - CTRL+1, CTRL+2 ... CTRL+9
# 'simple' - F1, F2 ... F9
$self->{macroMode} = 'default';
# A list of macros created
$self->{macroList} = [];
# Bless task
bless $self, $class;
lib/Games/Axmud/Task.pm view on Meta::CPAN
# Create the new task, using default settings and parameters
my $clone = $self->_objClass->new($session, $taskType, $profName, $profCategory);
# Most of the cloned task's settings have default values, but a few are copied from the
# original
$self->cloneTaskSettings($clone);
# Give the new (cloned) task the same initial parameters as the original one
$clone->{showInfoFlag} = $self->showInfoFlag;
$clone->{useMacrosFlag} = {$self->useMacrosFlag};
$clone->{macroMode} = {$self->macroMode};
# Cloning complete
return $clone;
}
sub preserve {
# Called by $self->main whenever this task is reset, in order to preserve some if its task
# parameters (but not necessarily all of them)
lib/Games/Axmud/Task.pm view on Meta::CPAN
'\'' . $self->uniqueName . '\' task missing from the current tasklist',
$self->_objClass . '->preserve',
);
}
# Preserve some task parameters (the others are left with their default settings, some of
# which will be re-initialised in stage 2)
# Preserve the command lists
$newTask->ivPoke('showInfoFlag', $self->showInfoFlag);
$newTask->ivPoke('useMacrosFlag', $self->useMacrosFlag);
$newTask->ivPoke('macroMode', $self->macroMode);
return 1;
}
# sub setParentFileObj {} # Inherited from generic task
# sub updateTaskLists {} # Inherited from generic task
# sub ttsReadAttrib {} # Inherited from generic task
lib/Games/Axmud/Task.pm view on Meta::CPAN
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->doStage', @_);
}
if ($self->stage == 2) {
# Create macros to intercept CTRL+1, CTRL+2 ... CTRL+9
if (! $self->resetMacros()) {
$self->writeError(
'Could not create macros for the ' . $self->prettyName . ' task, so halting',
$self->_objClass . '->doStage',
);
# Mark the task to be shutdown
$self->ivPoke('shutdownFlag', TRUE);
return undef;
lib/Games/Axmud/Task.pm view on Meta::CPAN
# Repeat this stage indefinitely
return $self->ivPoke('stage', 3);
} else {
# The task stage has somehow been set to an invalid value
return $self->invalidStage();
}
}
sub resetMacros {
# Called by $self->doStage at stage 2 to set up macros to intercept CTRL+1, CTRL+2 ...
# CTRL+9 (or equivalents)
#
# Expected arguments
# (none)
#
# Return values
# 'undef' on improper arguments
# 1 otherwise
my ($self, $check) = @_;
# Local variables
my @macroList;
# Check for improper arguments
if (defined $check) {
return $axmud::CLIENT->writeImproper($self->_objClass . '->resetMacros', @_);
}
# Create one macro (initially disabled) for each keycode string between 1-9
for (my $count = 1; $count <= 9; $count++) {
my ($interfaceObj, $keycodeString);
if ($self->macroMode eq 'simple') {
$keycodeString = 'f' . $count; # e.g. 'f1'
} else {
$keycodeString = 'ctrl ' . $count; # e.g. 'ctrl 1';
}
# Create the dependent macro interface
$interfaceObj = $self->session->createDependentInterface(
'macro',
$keycodeString,
$self,
'macroSeen',
'enabled',
$self->useMacrosFlag,
);
if (! $interfaceObj) {
# If there's an error creating any macros, remove any macros already created
$self->session->tidyInterfaces($self);
return undef;
} else {
lib/Games/Axmud/Task.pm view on Meta::CPAN
$self->ivPoke('macroList', @macroList);
return 1;
}
##################
# Response methods
sub macroSeen {
# Called by GA::Session->checkMacros
#
# This task's ->resetMacros function creates some macros to capture CTRL+1, CTRL+2 ...
# CTRL+9 (or equivalents)
#
# If the number corresponds to a session, that session is made the visible one
#
# The trigger interfaces have the following properties in ->propertyHash:
# number - A number between 1 and 9
#
# Expected arguments (standard args from GA::Session->checkTriggers)
# $session - The calling function's GA::Session
# $interfaceNum - The number of the active trigger interface that fired
lib/Games/Axmud/Task.pm view on Meta::CPAN
##################
# Accessors - task settings - get
# The accessors for task settings are inherited from the generic task
##################
# Accessors - task parameters - get
sub showInfoFlag
{ $_[0]->{showInfoFlag} }
sub useMacrosFlag
{ $_[0]->{useMacrosFlag} }
sub macroMode
{ $_[0]->{macroMode} }
sub macroList
{ my $self = shift; return @{$self->{macroList}}; }
}
{ package Games::Axmud::Task::Countdown;
use strict;
use warnings;
lib/Games/Axmud/Task.pm view on Meta::CPAN
return 1;
}
##################
# Response methods
sub interfaceWaitSeen {
# Called by GA::Session->processLineSegment, after that function has called ->checkTriggers;
# or by GA::Session->checkAliases, ->checkMacros (etc)
#
# The Axbasic statement WAITTRIG causes the script to create a trigger to wait for a
# particular pattern in the text received from the world
# e.g. The door swings open!
#
# When the pattern is found, the script resumes. WAITALIAS, WAITMACRO, WAITTIMER and
# WAITHOOK behave in similar ways
# This function updates IVs and resumes this task, which should be paused. Group substrings
# (for triggers/aliases) and additional data (for timers/hooks) are ignored
#
lib/Games/Axmud/Task.pm view on Meta::CPAN
# No second script to run. Notify the Axbasic programme that one of its dependent
# aliases has fired
$self->scriptObj->interfaceNotification($obj, $worldCmd, @groupStringList);
}
return 1;
}
sub macroNotifySeen {
# Called by GA::Session->checkMacros
#
# The Axbasic statement SETMACRO causes the script to create a macro to notice a keypress or
# a combination of keypresses
# e.g. 'ctrl f1'
#
# If SETMACRO specified a second script to run, this function runs it. Otherwise, this
# function notifies the script that the keycode string was processed (and only the script
# will do something in response)
#
# The macro interface has the following properties in ->propertyHash:
# new_script - The name of the second script to run (only used in calls to
# $self->macroExecSeen, 'undef' in calls to this function)
#
# Expected arguments (standard args from GA::Session->checkMacros)
# $session - The calling function's GA::Session
# $interfaceNum - The number of the active macro interface that fired
# $keycodeString - The keycode string for keypress(es) that caused the macro to fire
#
# Return values
# 'undef' on improper arguments, or if $session is the wrong session or if the interface
# object can't be found
# 1 otherwise
my ($self, $session, $interfaceNum, $keycodeString, $check) = @_;
lib/Games/Axmud/Win/Internal.pm view on Meta::CPAN
$self->visibleSession->put(
$axmud::CLIENT->ivShow('constDirectSpecialKeysHash', $string),
)
) {
# Return 1 to show that we have interfered with this keypress
return 1;
}
}
}
# We don't want to call GA::Session->checkMacros for every keypress (that would be
# inefficient)
# Instead, call it if this is a 'main' window, and if this keycode string is being used
# by any macro in any session (not perfectly efficient, but better)
if (
$self->visibleSession
&& $axmud::CLIENT->ivExists('activeKeycodeHash', $string)
&& $self->visibleSession->checkMacros($string)
) {
# Return 1 to show that we have interfered with this keypress (by firing a macro)
return 1;
}
# If no macro fired as a result of the keypress, then we can process some special keys
# The first pane object in the entry strip object's ->paneObjList is the one to which
# keypresses are applied
if ($stripObj) {
lib/Language/Axbasic/Statement.pm view on Meta::CPAN
# Prepare the client command
$string = 'addmacro -s <' . $stimulus . '> -p <' . $response . '> -d ' . $profile;
if ($name) {
$string .= ' -n <' . $name . '>';
}
# Send the command
if ($self->scriptObj->session->pseudoCmd($string, $self->scriptObj->pseudoCmdMode)) {
# Macro created successfully. Update the LA::Script IVs
if (! $name) {
# GA::Generic::Cmd->addInterface uses the stimulus as a name, if no name is
# specified
$name = $stimulus;
}
$self->scriptObj->push_indepInterfaceList($name, $profile, 'macro');
$self->scriptObj->set_indepInterfaceName($name);
share/docs/guide/ch05.html view on Meta::CPAN
<p><strong>Splitter triggers</strong> are a special kind of trigger that split a line into two or more separate lines. Like rewriter triggers, splitter triggers don't send a world command.</p>
<ul>
<li>For example, <em>Imperian: Sundered Heavens</em> usually puts a room's verbose description and its exit list on two separate lines, but occasionally they appear on the same line</li>
<li>The pre-configured world profile for <em>Imperian</em> moves the exit list onto a separate line, so that the Automapper doesn't get confused</li>
</ul>
<p><strong>Aliases</strong> respond to world commands, before they are sent to the world.</p>
<ul>
<li>You can create an alias to look out for the world command <strong>gcc</strong></li>
<li>This alias replaces the command with <strong>get coins from corpse</strong>, just before it is sent to the world</li>
</ul>
<p><strong>Macros</strong> respond when you press a certain key (or a combination of keys).</p>
<ul>
<li>For example, you can create a macro that responds when you press the F1 key</li>
<li>When you press the key, we say the macro <em>fires</em></li>
<li>When the macro fires, it can send a world command in response</li>
<li>You might create a macro to send <strong>get coins from corpse</strong> every time you press F1</li>
</ul>
<p><strong>Timers</strong> do something repeatedly, or wait for a period of time before doing something.</p>
<ul>
<li>For example, you can create a timer that fires every 60 seconds</li>
<li>When the timer fires, it might send the world command <strong>inventory</strong></li>
share/docs/guide/ch05.mkd view on Meta::CPAN
**Splitter triggers** are a special kind of trigger that split a line into two or more separate lines. Like rewriter triggers, splitter triggers don't send a world command.
* For example, *Imperian: Sundered Heavens* usually puts a room's verbose description and its exit list on two separate lines, but occasionally they appear on the same line
* The pre-configured world profile for *Imperian* moves the exit list onto a separate line, so that the Automapper doesn't get confused
**Aliases** respond to world commands, before they are sent to the world.
* You can create an alias to look out for the world command **gcc**
* This alias replaces the command with **get coins from corpse**, just before it is sent to the world
**Macros** respond when you press a certain key (or a combination of keys).
* For example, you can create a macro that responds when you press the F1 key
* When you press the key, we say the macro *fires*
* When the macro fires, it can send a world command in response
* You might create a macro to send **get coins from corpse** every time you press F1
**Timers** do something repeatedly, or wait for a period of time before doing something.
* For example, you can create a timer that fires every 60 seconds
* When the timer fires, it might send the world command **inventory**
share/docs/guide/ch07.html view on Meta::CPAN
</ul>
</li>
<li><a href="#7.2">7.2 Aliases</a><ul>
<li><a href="#7.2.1">7.2.1 Adding aliases</a></li>
<li><a href="#7.2.2">7.2.2 Safer aliases</a></li>
<li><a href="#7.2.3">7.2.3 Editing aliases</a></li>
<li><a href="#7.2.4">7.2.4 Alias attributes</a></li>
<li><a href="#7.2.5">7.2.5 Substrings in aliases</a></li>
</ul>
</li>
<li><a href="#7.3">7.3 Macros</a><ul>
<li><a href="#7.3.1">7.3.1 Axmud keycodes</a></li>
<li><a href="#7.3.2">7.3.2 Adding macros</a></li>
<li><a href="#7.3.3">7.3.3 Editing macros</a></li>
<li><a href="#7.3.3">7.3.4 Macro attributes</a></li>
</ul>
</li>
<li><a href="#7.4">7.4 Timers</a><ul>
<li><a href="#7.4.1">7.4.1 Adding timers</a></li>
<li><a href="#7.4.2">7.4.2 Editing timers</a></li>
<li><a href="#7.4.3">7.4.3 Timer attributes</a></li>
</ul>
</li>
<li><a href="#7.5">7.5 Hooks</a><ul>
<li><a href="#7.5.1">7.5.1 Hook events</a></li>
share/docs/guide/ch07.html view on Meta::CPAN
<li>This instruction would look something like <strong>give $1 to Gandalf</strong></li>
</ul>
</li>
</ul>
</li>
<li>If you <em>actually</em> want a backslash <em>anywhere</em> in the instruction, use must use two of them<ul>
<li>e.g. <strong>apples and\\or oranges</strong></li>
</ul>
</li>
</ul>
<h2><a name="7.3">7.3 Macros</a></h2>
<p>Macros wait for you to press a key like F1, and then do something in response.</p>
<p>Like all interfaces, Axmud macros have a <em>stimulus</em> and a <em>response</em>. The stimulus is a <em>keycode</em> that represents one of the keys on your keyboard. When you press the key, we say that the macro <em>fires</em>.</p>
<p>The response can be any kind of instruction. It's usually a world command like <strong>get coins from corpse</strong>, but it could be a client command like <strong>;openautomapper</strong> or any other kind of instruction (see <a href="ch04.html#...
<h3><a name="7.3.1">7.3.1 Axmud keycodes</a></h3>
<p>A key part of Axmud's design is <em>platform independence</em>. If you install Axmud on one computer with Linux and on another computer with MS Windows, the data you save on one can be transferred to the without problems.</p>
<p>For this reason, Axmud uses a set of standard keycodes - short strings corresponding to every key on the keyboard. The keycode for each key is the same, regardless of which operating system you're using.</p>
<p>Axmud's keycodes - always in lower-case - are:</p>
<pre><code> shift alt alt_gr ctrl num_lock
escape pause break insert delete return backspace space tab
home page_up page_down end
up down left right
share/docs/guide/ch07.html view on Meta::CPAN
</code></pre>
<p>There are also a set of keycodes for the keypad (the keys, normally on the right side of the keyboard, which are laid out like a calculator):</p>
<pre><code> kp_0 kp_1 kp_2 kp_3 kp_4 kp_5 kp_6 kp_7 kp_8 kp_9
kp_add kp_subtract kp_multiply kp_divide kp_enter kp_full_stop
</code></pre>
<p>The keycodes 'full_stop' and 'kp_full_stop' represent the full stop/period keys. Axmud supports a number of alternatives to the standard keycodes, including 'period'. (Type <strong>;listkeycodealternative</strong> for a list of alternative keycode...
<p>Keycodes can be combined when two or more keys are pressed together. For example, CTRL + F1 corresponds to the keycode string "ctrl f1" (a string containing two words separated by a single space character).</p>
<p>Note that, for technical reasons, Axmud cannot use SHIFT or ALT-GR in macros (although ALT + SHIFT + some other key is acceptable). Therefore, if you try to add a macro that fires when you press SHIFT + F1, it won't work.</p>
<h3><a name="7.3.2">7.3.2 Adding macros</a></h3>
<ul>
<li>From the main window menu, click <strong>Interfaces > Macros > World macros</strong></li>
<li>In the <strong>Macro stimulus</strong> box, enter the keycode <strong>f1</strong><ul>
<li>Axmud standard keycodes are always in lower-case characters</li>
</ul>
</li>
<li>In the <strong>Macro response</strong> box, enter the command <strong>get coins from corpses</strong></li>
<li>In the <strong>Name</strong> box, enter the name <strong>mymacro</strong></li>
<li>Click the <strong>Add</strong> button to create the macro</li>
</ul>
<h3><a name="7.3.3">7.3.3 Editing macros</a></h3>
<p>Like triggers and aliases, macros are customisable. Select <strong>mymacro</strong> by clicking on it, and then click the <strong>Edit</strong> button.</p>
<p>The new edit window contains three tabs. The <strong>Name</strong> tab allows you to change the stimulus and response, and also allows you to enable or disable the macro.</p>
<p>The <strong>Attributes</strong> tab allows you to customise the macro - for example, to disable the macro automatically after the first matching keypress.</p>
<p>When Axmud is testing macros against a keypress, it checks the macros in the same order every time. Sometimes the order is important, so the <strong>Before / after</strong> tab allows you to name the macros that should be checked before or after t...
<h3><a name="7.3.4">7.3.4 Macro attributes</a></h3>
<p>Click on the <strong>Attributes</strong> tab. There are two attributes which can be customised.</p>
<p><strong>Temporary macro</strong></p>
<p>If the checkbutton is selected, the macro only fires once. After that, the active macro becomes an inactive macro - it will be available again, the next time you connect to the world, but it will not be available again during this session.</p>
<p><strong>Cooldown (in seconds)</strong></p>
<p>You can prevent a macro from firing too often by setting a cooldown period. For example, if you set the cooldown to 10, after firing the macro won't be able to fire again for another 10 seconds. The default value is 0, meaning no cooldown period i...
<h2><a name="7.4">7.4 Timers</a></h2>
<p>Timers allow you to execute an instruction repeatedly at regular intervals. They can also be used to execute an instruction once, after a certain period of time. They can even be used to execute an instruction once a day, at the same time each day...
<p>Like all interfaces, Axmud timers have a <em>stimulus</em> and a <em>response</em>. The stimulus is usually a time interval, expressed in seconds. The minimum value is 0.1 seconds. When this interval has passed, we say that the timer <em>fires</e...
<p>The stimulus can also a 24-hour clock time in the form HH:MM (for example, 00:00 for midnight, 12:00 for midday, 13:30 for half past one in the afternoon). If you use a clock time, the timer fires at the time, once a day.</p>
<p>Axmud recognises special clock times in the form 99:MM. For example, a timer whose stimulus is 99:00 will fire once an hour, on the hour. A timer whose stimulus is 99:15 will fire once an hour, at a quarter past the hour.</p>
share/docs/guide/ch07.mkd view on Meta::CPAN
* [7.1.6 Substrings in other triggers](#7.1.6)
* [7.1.7 Splitter triggers](#7.1.7)
* [7.1.8 Simple splitter triggers](#7.1.8)
* [7.1.9 Advanced splitter triggers](#7.1.9)
* [7.2 Aliases](#7.2)
* [7.2.1 Adding aliases](#7.2.1)
* [7.2.2 Safer aliases](#7.2.2)
* [7.2.3 Editing aliases](#7.2.3)
* [7.2.4 Alias attributes](#7.2.4)
* [7.2.5 Substrings in aliases](#7.2.5)
* [7.3 Macros](#7.3)
* [7.3.1 Axmud keycodes](#7.3.1)
* [7.3.2 Adding macros](#7.3.2)
* [7.3.3 Editing macros](#7.3.3)
* [7.3.4 Macro attributes](#7.3.3)
* [7.4 Timers](#7.4)
* [7.4.1 Adding timers](#7.4.1)
* [7.4.2 Editing timers](#7.4.2)
* [7.4.3 Timer attributes](#7.4.3)
* [7.5 Hooks](#7.5)
* [7.5.1 Hook events](#7.5.1)
* [7.5.2 Hook data](#7.5.2)
* [7.5.3 Adding hooks](#7.5.3)
* [7.5.4 Editing hooks](#7.5.4)
* [7.5.5 Hook attributes](#7.5.5)
share/docs/guide/ch07.mkd view on Meta::CPAN
* e.g. **"give $1 gold coins to $2"**
* This is no longer necessary (but your old aliases will continue to work)
* If you *actually* want the intruction to begin and end with double quotes, you must use two of them
* e.g. **""give $1 gold coins to $2""**
* If you want the instruction to contain a literal **$1**, precede it with a backslash
* e.g. **give \$1 to $1**
* This instruction would look something like **give $1 to Gandalf**
* If you *actually* want a backslash *anywhere* in the instruction, use must use two of them
* e.g. **apples and\\\\or oranges**
##<a name="7.3">7.3 Macros</a>
Macros wait for you to press a key like F1, and then do something in response.
Like all interfaces, Axmud macros have a *stimulus* and a *response*. The stimulus is a *keycode* that represents one of the keys on your keyboard. When you press the key, we say that the macro *fires*.
The response can be any kind of instruction. It's usually a world command like **get coins from corpse**, but it could be a client command like **;openautomapper** or any other kind of instruction (see [Section 4.4](ch04.html#4.4)).
###<a name="7.3.1">7.3.1 Axmud keycodes</a>
A key part of Axmud's design is *platform independence*. If you install Axmud on one computer with Linux and on another computer with MS Windows, the data you save on one can be transferred to the without problems.
For this reason, Axmud uses a set of standard keycodes - short strings corresponding to every key on the keyboard. The keycode for each key is the same, regardless of which operating system you're using.
share/docs/guide/ch07.mkd view on Meta::CPAN
kp_add kp_subtract kp_multiply kp_divide kp_enter kp_full_stop
The keycodes 'full_stop' and 'kp_full_stop' represent the full stop/period keys. Axmud supports a number of alternatives to the standard keycodes, including 'period'. (Type **;listkeycodealternative** for a list of alternative keycodes.)
Keycodes can be combined when two or more keys are pressed together. For example, CTRL + F1 corresponds to the keycode string "ctrl f1" (a string containing two words separated by a single space character).
Note that, for technical reasons, Axmud cannot use SHIFT or ALT-GR in macros (although ALT + SHIFT + some other key is acceptable). Therefore, if you try to add a macro that fires when you press SHIFT + F1, it won't work.
###<a name="7.3.2">7.3.2 Adding macros</a>
* From the main window menu, click **Interfaces > Macros > World macros**
* In the **Macro stimulus** box, enter the keycode **f1**
* Axmud standard keycodes are always in lower-case characters
* In the **Macro response** box, enter the command **get coins from corpses**
* In the **Name** box, enter the name **mymacro**
* Click the **Add** button to create the macro
###<a name="7.3.3">7.3.3 Editing macros</a>
Like triggers and aliases, macros are customisable. Select **mymacro** by clicking on it, and then click the **Edit** button.
The new edit window contains three tabs. The **Name** tab allows you to change the stimulus and response, and also allows you to enable or disable the macro.
The **Attributes** tab allows you to customise the macro - for example, to disable the macro automatically after the first matching keypress.
When Axmud is testing macros against a keypress, it checks the macros in the same order every time. Sometimes the order is important, so the **Before / after** tab allows you to name the macros that should be checked before or after this one.
###<a name="7.3.4">7.3.4 Macro attributes</a>
Click on the **Attributes** tab. There are two attributes which can be customised.
**Temporary macro**
If the checkbutton is selected, the macro only fires once. After that, the active macro becomes an inactive macro - it will be available again, the next time you connect to the world, but it will not be available again during this session.
**Cooldown (in seconds)**
You can prevent a macro from firing too often by setting a cooldown period. For example, if you set the cooldown to 10, after firing the macro won't be able to fire again for another 10 seconds. The default value is 0, meaning no cooldown period is u...
share/help/axbasic/keyword/addmacro view on Meta::CPAN
ADDMACRO "stimulus", "response", "name"
CLIENT "addmacro -s stimulus -p response -n name"
If Axmud can't create the new macro, execution of the Axbasic script
continues as normal. No error message is generated.
All macros created by this statement are 'inactive' timers, and are
assigned to a cage belonging to the current world (unless an earlier
PROFILE statement specified a different profile). If there are no
higher-priority macros with the same name, the corresponding 'active'
macro will be created automatically.
Macros created with this statement are automatically deleted when the
script terminates (unless you use an OPTION PERSIST statement somewhere
in the code).
Examples:
ADDMACRO "f5", "kill orc", "attackmacro"
ADDMACRO "f10", "inventory"
share/help/cmd/addmacro view on Meta::CPAN
ama / addmacro Adds a macro
Format:
;ama <switches> Adds a macro
Notes:
Macros are one of five types of Axmud interface (the others being
triggers, aliases, timers and hooks).
Macros allow you to specify instructions to be executed automatically when
a certain key (or combination of keys) is pressed.
This command creates a macro interface that's 'inactive' - it's associated
with a particular profile (actually, stored in a 'cage' object
associated with that profile). When that profile becomes a current
profile - and only if there isn't another macro with the same name,
attached to a higher-priority profile - then an 'active' macro is
created with the same attributes.
The macro created is also 'independent', meaning that it doesn't call some
part of the Axmud code directly.
share/help/cmd/addmacro view on Meta::CPAN
Axmud standard keycodes.)
'response' - The instruction to execute when the macro fires. Includes
world commands, forced world commands (starting with
',,'), client commands (starting ';'), echo commands
(starting '"'), Perl commands (starting '/'), script
commands (starting '&') and multi commands (starting
':')
'enabled' - A flag set to 1 (default) or 0. When set to 1, the active
macro is enabled (does something). When set to 0, it
is disabled (temporarily does nothing)
Macros also have the following non-standard attributes:
'temporary' - A flag set to 1 or 0 (default). When set to 1, the active
interface is destroyed after the macro fires for the
first time. When set to 0, the interface can fire
indefinitely
'cooldown' - A number, in seconds; 0 (default) or above (can be
fractional). If 0, no cooldown period applies after
the macro fires. If above 0, the macro can't fire
again until the cooldown period has expired
<switches> allows you to define which attributes the macro will have and
share/help/cmd/deletemacro view on Meta::CPAN
dma / deletemacro Deletes a macro
Format:
;dma <switches> Deletes a macro
Notes:
Macros are one of five types of Axmud interface (the others being
triggers, aliases, timers and hooks).
Macros allow you to specify instructions to be executed automatically when
a certain key (or combination of keys) is pressed.
This command deletes an existing 'inactive' macro (one associated with a
particular profile) and its corresponding 'active' macro, if there is
one.
It's not possible to delete an active macro directly; enable or disable
the hook using ';modifymacro' to set its 'enabled' attribute instead.
To delete the inactive macro (and the active macro based on it, if there
is one), one of the following (group 1) switch options must be used:
<name> - Deletes macro belonging to the current world
share/help/cmd/exportmacro view on Meta::CPAN
xma / exportmacro Exports a macro to the interface clipboard
Format:
;xma <switches> Exports a macro
Notes:
Macros are one of five types of Axmud interface (the others being
triggers, aliases, timers and hooks).
Macros allow you to specify instructions to be executed automatically when
a certain key (or combination of keys) is pressed.
This command provides a simple way to copy macros from one profile/cage
to another (perhaps even in a different world, in a different session).
It 'exports' the macro to Axmud's interface clipboard, from where it
can be 'imported'.
Note that the contents of the clipboard are not saved, when Axmud saves
its files. Note also that the macro's attributes might change while
stored in the clipboard. In other words, it's up to you to perform the
export, then the import, before doing anything else.
You can repeat this command as often as you like, to add multiple macros
share/help/cmd/importmacro view on Meta::CPAN
ima / importmacro Imports macro(s) from the interface clipboard
Format:
;ima <name> <switches> Imports the macro called <name>
;ima <switches> Imports all clipboard macros
Notes:
Macros are one of five types of Axmud interface (the others being
triggers, aliases, timers and hooks).
Macros allow you to specify instructions to be executed automatically when
a certain key (or combination of keys) is pressed.
This command provides a simple way to copy macros from one profile/cage
to another (perhaps even in a different world, in a different session).
Having 'exported' the macro to Axmud's interface clipboard using the
';importmacro' command, that macro can then be 'imported'.
Note that the contents of the clipboard are not saved. Note also that the
macro's attributes might change while stored in the clipboard. In other
words, it's up to you to perform the export, then the import, before
doing anything else.
If an active macro was exported, an inactive macro is imported. The
share/help/cmd/modifymacro view on Meta::CPAN
mma / modifymacro Modifies a macro
Format:
;mma <switches> Modifies a macro
Notes:
Macros are one of five types of Axmud interface (the others being
triggers, aliases, timers and hooks).
Macros allow you to specify instructions to be executed automatically when
a certain key (or combination of keys) is pressed.
This command modifies the attributes of an existing 'inactive' macro (one
associated with a particular profile) and its corresponding 'active'
macro, if there is one.
It's also possibly to modify the active macro directly, in which case, the
the changes won't apply to the parent inactive macro (and will only
last for the session, or until the active macro is deleted).
<switches> allows you to define which macro (and which of its attributes)
should be modified.
share/help/cmd/quickmacro view on Meta::CPAN
qm / quickmacro Creates a macro using the previous command
Format:
;qm <keycode> Creates a macro
Notes:
Macros are one of five types of Axmud interface (the others being
triggers, aliases, timers and hooks).
Macros allow you to specify instructions to be executed automatically when
a certain key (or combination of keys) is pressed.
This command behaves much like the ';addmacro' command, remembering
whichever command you typed just before this one.
You only need to specify which combination of keys causes the macro to
'fire', executing that same command again.
See the help ';addmacro', which gives some examples of a valid <keycode>,
such as 'f5' or 'shift up'.
User commands:
share/items/mudlist/mudlist.txt view on Meta::CPAN
0
English
MacMUCK
macmuck
sandwich.net
4201
1
English
Macross: New Horizon
macross
macross.genesismuds.com
2050
0
English
MaDDness
maddness
maddness.dune.net
6000