Games-Axmud

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

    many of the less useful tabs by default. If you want to see all tabs, open
    either window and click the button at the top, or click 'Edit >
    Axmud preferences... > Windows > Page 1' and de-select the 'Hide less
    useful tabs...' button
- You can now export triggers, aliases, macros, timers and hooks from one
    profile to another. For example, you could connect to two worlds
    simultaneously (in online or offline mode). In the first, click
    'Interfaces > Triggers > World triggers', click one or more triggers to
    select them, then click the Export button. In the second, click
    'Interfaces > Triggers > World triggers', and click the Import button.
    Export/import works using a clipboard, so it's much like using copy and
    paste in a text editor
- Export/import can also be done with the new client commands, ;exporttrigger
    and ;importtrigger (etc). See also the new commands ;listclipboard and
    ;clearclipboard
- Character profiles now have a nickname that's the same as the profile name by
    default. However, whereas profiles names cannot contain spaces, the nickname
    can contain any characters (including spaces). The nickname is the one now
    used in automatic logins (Git #17)
- The Axmud Guide and Axbasic tutorial have been updated with several new
    chapters

Minor new features
- In the automapper window, regions can be marked as 'finished': click
    'Regions > Current region > Set finished region'. This is merely an

MANIFEST  view on Meta::CPAN

share/help/cmd/chatsetgroup
share/help/cmd/chatseticon
share/help/cmd/chatsetname
share/help/cmd/chatsetsmiley
share/help/cmd/chatsnoop
share/help/cmd/chatstopfile
share/help/cmd/chatsubmit
share/help/cmd/chatzcall
share/help/cmd/checkscript
share/help/cmd/circuit
share/help/cmd/clearclipboard
share/help/cmd/clearhistory
share/help/cmd/cleartextview
share/help/cmd/clearwindowstorage
share/help/cmd/clientcommand
share/help/cmd/clonechar
share/help/cmd/cloneconfig
share/help/cmd/clonecustomprofile
share/help/cmd/clonedictionary
share/help/cmd/cloneguild
share/help/cmd/clonemission

MANIFEST  view on Meta::CPAN

share/help/cmd/listadvance
share/help/cmd/listadvancehistory
share/help/cmd/listalias
share/help/cmd/listattribute
share/help/cmd/listautosecondary
share/help/cmd/listautoworld
share/help/cmd/listbasicworld
share/help/cmd/listcage
share/help/cmd/listchannelpattern
share/help/cmd/listchar
share/help/cmd/listclipboard
share/help/cmd/listcolour
share/help/cmd/listcolourscheme
share/help/cmd/listconfig
share/help/cmd/listcontact
share/help/cmd/listcontentslines
share/help/cmd/listcustomprofile
share/help/cmd/listcustomtask
share/help/cmd/listdatadirectory
share/help/cmd/listdictionary
share/help/cmd/listdirection

lib/Games/Axmud/Client.pm  view on Meta::CPAN


            # Interfaces
            # ----------

            # 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.

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        # 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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

            $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);

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        # 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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        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);

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        #   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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        #   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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        #   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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        #   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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        #   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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        #   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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        #   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 {

lib/Games/Axmud/Cmd.pm  view on Meta::CPAN

        #   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 {

lib/Games/Axmud/EditWin.pm  view on Meta::CPAN

                    # Refresh (both) lists
                    $self->interfaces1Tab_refreshList();
                    $self->interfaces2Tab_refreshList();
                }
            }
        });

        my $button4 = $self->addButton(
            $grid,
            'Export',
            'Export selected ' . $self->plural . ' to the interface clipboard',
            undef,
            4, 6, 11, 12,
            TRUE,               # Irreversible
        );
        $button4->signal_connect('clicked' => sub {

            my (
                $profName,
                @interfaceList,
            );

            @interfaceList = $self->getSimpleListData($slWidget, 0);
            $profName = $self->editObj->profName;

            if (@interfaceList && defined $profName) {

                # Empty the clipboard
                $self->session->pseudoCmd(
                    'clearclipboard',
                    $self->pseudoCmdMode,
                );

                # Export the selected interfaces
                foreach my $interfaceName (@interfaceList) {

                    $self->session->pseudoCmd(
                        'export' . $self->singular . ' ' . $interfaceName . ' -d ' . $profName,
                        $self->pseudoCmdMode,
                    );

lib/Games/Axmud/EditWin.pm  view on Meta::CPAN


                # Refresh (both) lists
                $self->interfaces1Tab_refreshList();
                $self->interfaces2Tab_refreshList();
            }
        });

        my $button5 = $self->addButton(
            $grid,
            'Import',
            'Import all ' . $self->plural . ' from the interface clipboard',
            undef,
            6, 8, 11, 12,
            TRUE,               # Irreversible
        );
        $button5->signal_connect('clicked' => sub {

            my $profName = $self->editObj->profName;

            if (defined $profName) {

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

    }

    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)
        #
        # Expected arguments
        #   $session        - The calling function's GA::Session
        #   $inputString    - The command actually typed, e.g. 'etr mytrigger'
        #   $standardCmd    - Standard version of the client command, e.g. 'exporttrigger'
        #   $category       - 'trigger', 'alias', 'macro', 'timer', 'hook'
        #   $categoryPlural - e.g. 'triggers'

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

            }

            $interfaceObj = $session->ivShow('interfaceHash', $interface);

            # Export the interface
            $axmud::CLIENT->add_interfaceClipboardList($interfaceObj);

            return $self->complete(
                $session, $standardCmd,
                'Active ' . $category . ' interface \'' . $interface . '\' exported to the'
                . ' interface clipboard',
            );

        # Otherwise, if a group 1 switch was specified, export the specified interface stored in the
        #   cage
        } else {

            # 0 or 1 associated profiles can be specified, but no more
            if ($profCount > 1) {

                return $self->error(

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

                    );
                }
            }

            # Export the interface
            $axmud::CLIENT->add_interfaceClipboardList($currentObj);

            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'
        #   $standardCmd    - Standard version of the client command, e.g. 'importtrigger'
        #   $category       - 'trigger', 'alias', 'macro', 'timer', 'hook'
        #   $categoryPlural - e.g. 'triggers'
        #   $modelObj       - The interface model object corresponding to $category
        #

lib/Games/Axmud/Generic.pm  view on Meta::CPAN

                if ($interfaceObj->name eq $args[0]) {

                    push (@interfaceList, $interfaceObj);
                }
            }

            if (! @interfaceList) {

                return $self->error(
                    $inputString,
                    'No interface named \'' . $args[0] . '\' found in the interface clipboard',
                );
            }
        }

        # Find the cage matching the specified profile
        $cage = $session->findCage($category, $profName);
        if (! $cage) {

            return $self->error(
                $inputString,

lib/Games/Axmud/Interface.pm  view on Meta::CPAN

        };

        # Bless the object into existence
        bless $self, $class;
        return $self;
    }

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

lib/Games/Axmud/Interface.pm  view on Meta::CPAN

        };

        # Bless the object into existence
        bless $self, $class;
        return $self;
    }

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

lib/Games/Axmud/Interface.pm  view on Meta::CPAN

        };

        # Bless the object into existence
        bless $self, $class;
        return $self;
    }

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

lib/Games/Axmud/Interface.pm  view on Meta::CPAN

        };

        # Bless the object into existence
        bless $self, $class;
        return $self;
    }

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

lib/Games/Axmud/Interface.pm  view on Meta::CPAN

        };

        # Bless the object into existence
        bless $self, $class;
        return $self;
    }

    sub clone {

        # Creates a clone of an existing interface; only used when the parent cage is cloned, or
        #   when interfaces are exported to the GA::Client's interface clipboard
        #
        # Expected arguments
        #   $profName       - The parent profile's name (e.g. matches the object's ->name)
        #
        # Return values
        #   'undef' on improper arguments
        #   Blessed reference to the newly-created object on success

        my ($self, $profName, $check) = @_;

lib/Games/Axmud/PrefWin.pm  view on Meta::CPAN

                # Refresh the simple list for the corresponding tab
                $self->interfaces1Tab_refreshList(
                    $self->ivShow('editConfigHash', 'interface_list_' . $interfaceObj->category),
                    scalar (@columnList / 2),
                    $interfaceObj->category,
                );
            }
        });

        my $button2 = $self->addButton($grid,
            'Export', 'Export selected interfaces to the interface clipboard', undef,
            3, 5, 10, 11);
        $button2->signal_connect('clicked' => sub {

            my (
                $interfaceObj,
                @interfaceList,
            );

            @interfaceList = $self->getSimpleListData($slWidget, 0);
            if (@interfaceList) {

                # Empty the clipboard
                $self->session->pseudoCmd(
                    'clearclipboard',
                    $self->pseudoCmdMode,
                );

                # Export the selected interfaces
                foreach my $number (@interfaceList) {

                    $interfaceObj = $self->session->ivShow('interfaceNumHash', $number);

                    $self->session->pseudoCmd(
                        'export' . $interfaceObj->category . ' -i ' . $number,

lib/Games/Axmud/PrefWin.pm  view on Meta::CPAN

                        FALSE,                          # Not temporary
                    );
                }

                # Refresh the simple list
                $self->interfaces1Tab_refreshList($slWidget, scalar (@columnList / 2), $category);
            }
        });

        my $button2 = $self->addButton($grid,
            'Export', 'Export selected interfaces to the interface clipboard', undef,
            3, 5, 10, 11);
        $button2->signal_connect('clicked' => sub {

            my (
                $interfaceObj, $comboBox,
                @interfaceList,
            );

            @interfaceList = $self->getSimpleListData($slWidget, 0);
            if (@interfaceList) {

                # Empty the clipboard
                $self->session->pseudoCmd(
                    'clearclipboard',
                    $self->pseudoCmdMode,
                );

                # Export the selected interfaces
                foreach my $number (@interfaceList) {

                    $interfaceObj = $self->session->ivShow('interfaceNumHash', $number);

                    $self->session->pseudoCmd(
                        'export' . $interfaceObj->category . ' -i ' . $number,

lib/Games/Axmud/Task.pm  view on Meta::CPAN

            'list_ref'      => \@comboList,
        );

        # Add buttons - one to empty the textview of notes, another to restore the displayed notes
        #   to what they were, when the task started (or was last reset)
        $self->winObj->tableStripObj->addTableObj(
            'Games::Axmud::Table::Button',
            30, 39, 58, 59,
            undef,
            # Init settings
            'func'          => $self->getMethodRef('clipboardCallback'),
            'text'          => 'Paste',
            'tooltips'      => 'Insert any selected text in the session\'s default tab',
        );

        $self->winObj->tableStripObj->addTableObj(
            'Games::Axmud::Table::Button',
            40, 49, 58, 59,
            undef,
            # Init settings
            'func'          => $self->getMethodRef('emptyCallback'),

lib/Games/Axmud/Task.pm  view on Meta::CPAN


        # Update the textview
        if ($profObj) {

            $self->textTableObj->set_text(join("\n", $profObj->notepadList));
        }

        return 1;
    }

    sub clipboardCallback {

        # Called by a ->signal_connect in a GA::Table::Button object when the user clicks on the
        #   'Empty notes' button
        # Pastes the contents of the clipboard into the textview
        #
        # Expected arguments
        #   $tableObj   - The GA::Table::Button object for the button
        #   $button     - The actual Gtk3::Button clicked
        #   $id         - The callback ID; in this case, a keycode
        #
        # Return values
        #   'undef' on improper arguments
        #   1 otherwise

        my ($self, $tableObj, $button, $id, $check) = @_;

        # Local variables
        my ($textViewObj, $startIter, $endIter, $slice);

        # Check for improper arguments
        if (! defined $tableObj || ! defined $button || ! defined $id || defined $check) {

            return $axmud::CLIENT->writeImproper($self->_objClass . '->clipboardCallback', @_);
        }

        $textViewObj = $self->session->defaultTabObj->textViewObj;
        ($startIter, $endIter) = $textViewObj->buffer->get_selection_bounds();
        if (defined $endIter) {

            $slice = $textViewObj->buffer->get_slice($startIter, $endIter, FALSE);

            if (defined $slice && $slice ne '') {

lib/Games/Axmud/Win/Internal.pm  view on Meta::CPAN

             return $axmud::CLIENT->writeImproper($self->_objClass . '->setKeyPressEvent', @_);
        }

        $self->winBox->signal_connect('key-press-event' => sub {

            my ($widget, $event) = @_;

            # Local variables
            my (
                $keycode, $standard, $string, $directFlag, $stripObj, $paneObj, $tabObj,
                $splitScreenMode, $textView, $slice, $clipboard, $vAdjust, $high, $length,
                $modValue, $entryText, $bufferObj, $startIter, $endIter,
                @list,
            );

            # Get the system keycode for this keypress
            $keycode = Gtk3::Gdk::keyval_name($event->keyval);
            # Translate it into a standard Axmud keycode
            $standard = $axmud::CLIENT->reverseKeycode($keycode);

            # If it's a CTRL, SHIFT, ALT or ALT-GR keypress, set IVs

lib/Games/Axmud/Win/Internal.pm  view on Meta::CPAN

            # The CTRL+C combination tends to be CTRL+SHIFT+C in Gtk, which is very inconvenient.
            #   Implement a quick-and-dirty CTRL+C instead
            if ($string eq 'ctrl c' && $tabObj) {

                ($startIter, $endIter) = $tabObj->textViewObj->buffer->get_selection_bounds();
                if (defined $endIter) {

                    $slice = $tabObj->textViewObj->buffer->get_slice($startIter, $endIter, FALSE);
                    if (defined $slice && $slice ne '') {

                        $clipboard = Gtk3::Clipboard::get(Gtk3::Gdk::Atom::intern('CLIPBOARD', 0));
                        if ($clipboard) {

                            $clipboard->set_text($slice);

                            # Return 1 to show that we have interfered with this keypress
                            return 1;
                        }
                    }
                }

            # If the page up/page down/home/end keys have been pressed, scroll the vertical
            #   scrollbar containing the textview object
            } elsif (

share/docs/guide/ch07.html  view on Meta::CPAN

<ul>
<li>From the main window menu, click on <strong>Interfaces &gt; Triggers &gt; World triggers</strong></li>
<li>Enable (or disable) one of the triggers you created earlier</li>
<li>Now, from the main window menu, click on <strong>Interfaces &gt; Active interfaces</strong></li>
<li>Find the corresponding trigger in the list. It will also be enabled (or disabled)</li>
</ul>
<p>However, if you modify the copy (the active interface), <em>no changes are made to the original</em> (the inactive interface). Any changes are therefore <em>temporary</em> and will disappear at the end of the session.</p>
<h2><a name="7.7">7.7 Exporting/importing interfaces</a></h2>
<p>Everyone reading his guide will be familiar with copying and pasting.</p>
<p>In a text editor, you can highlight some text and press CTRL + C, before pressing CTRL + V to copy it to somewhere else. In between, the text is stored in some secret place in the computer's memory.</p>
<p>Axmud interfaces can also be copied from one profile to another, or even from one world to another. Axmud has a not-so secret <em>clipboard</em> which stores the interfaces waiting to be copied. This single clipboard is available to any session th...
<p>Instead of copying and pasting, we talk about <em>exporting</em> to the clipboard and <em>importing</em> from it.</p>
<ul>
<li>Connect to two worlds (in online or offline mode)</li>
<li>Click on the first world's tab, to make it visible</li>
<li>From the main window menu, click on <strong>Interfaces &gt; Triggers &gt; World triggers</strong></li>
<li>Create a trigger with a memorable name</li>
<li>Click on the trigger to select it, then click the <strong>Export</strong> button</li>
<li>Now click the second world's tab to make it visible</li>
<li>From the main window menu, click on <strong>Interfaces &gt; Triggers &gt; World triggers</strong></li>
<li>Click the <strong>Import button</strong></li>
<li>The second world receives a copy of the first world's trigger</li>

share/docs/guide/ch07.mkd  view on Meta::CPAN

* Find the corresponding trigger in the list. It will also be enabled (or disabled)

However, if you modify the copy (the active interface), *no changes are made to the original* (the inactive interface). Any changes are therefore *temporary* and will disappear at the end of the session.

##<a name="7.7">7.7 Exporting/importing interfaces</a>

Everyone reading his guide will be familiar with copying and pasting.

In a text editor, you can highlight some text and press CTRL + C, before pressing CTRL + V to copy it to somewhere else. In between, the text is stored in some secret place in the computer's memory.

Axmud interfaces can also be copied from one profile to another, or even from one world to another. Axmud has a not-so secret *clipboard* which stores the interfaces waiting to be copied. This single clipboard is available to any session that's open ...

Instead of copying and pasting, we talk about *exporting* to the clipboard and *importing* from it.

* Connect to two worlds (in online or offline mode)
* Click on the first world's tab, to make it visible
* From the main window menu, click on **Interfaces > Triggers > World triggers**
* Create a trigger with a memorable name
* Click on the trigger to select it, then click the **Export** button
* Now click the second world's tab to make it visible
* From the main window menu, click on **Interfaces > Triggers > World triggers**
* Click the **Import button**
* The second world receives a copy of the first world's trigger

share/help/cmd/clearclipboard  view on Meta::CPAN

ccb / clearclipboard          Clears the interface clipboard

   Format:
      ;ccb <switches>         Clears the clipboard

   Notes:
      Axmud interfaces are triggers, aliases, macros, timers and hooks.
      Interfaces can be exported and imported between profiles (for example,
         between two different world profiles).
      When exporting (for example, using ';exporttrigger', the interfaces are
         stored temporarily in Axmud's own interface clipboard. This command
         empties the clipboard.
      See also the help for ';listclipboard'.

   User commands:
      ccb / clearclipboard

share/help/cmd/exportalias  view on Meta::CPAN

xal / exportalias             Exports an alias to the interface clipboard

   Format:
      ;xal <switches>         Exports an alias

   Notes:
      Aliases are one of five types of Axmud interface (the others being
         triggers, macros, timers and hooks).
      Aliases allow you to define shortcuts for world commands and to have those
         commands modified before being sent to the world.
      This command provides a simple way to copy aliases from one profile/cage
         to another (perhaps even in a different world, in a different session).
         It 'exports' the alias 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 alias'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 aliases
         to the clipboard, before importing them all together with
         ';importalias'. Use ';emptyclipboard' when you want to start afresh.
         Note that 'Export' buttons in preference/edit windows empty the
         clipboard, before adding one or interfaces to it.
      Both active and inactive aliases can be exported.

      <switches> allows you to define which alias (and which of its attributes)
         should be exported.

      To export an active alias directly, one of the following (group 0) switch
         options must be used:
         -i <name>            - Exports the active alias <name>
         -i <number>          - Exports the active alias <number>
      However, to export an inactive alias, one of the following (group 1)

share/help/cmd/exporthook  view on Meta::CPAN

xhk / exporthook              Exports a hook to the interface clipboard

   Format:
      ;xhk <switches>         Exports a hook

   Notes:
      Hooks are one of five types of Axmud interface (the others being triggers,
         aliases, macros and timers).
      Hooks allow you to specify instructions to be executed automatically when
         certain events happen.
      This command provides a simple way to copy hooks from one profile/cage to
         another (perhaps even in a different world, in a different session). It
         'exports' the hook 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 hook'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 hook
         to the clipboard, before importing them all together with
         ';importhook'. Use ';emptyclipboard' when you want to start afresh.
         Note that 'Export' buttons in preference/edit windows empty the
         clipboard, before adding one or interfaces to it.
      Both active and inactive hooks can be exported.

      <switches> allows you to define which hook (and which of its attributes)
         should be exported.

      To export an active hook directly, one of the following (group 0) switch
         options must be used:
         -i <name>            - Exports the active hook <name>
         -i <number>          - Exports the active hook <number>
      However, to export an inactive hook, one of the following (group 1)

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
         to the clipboard, before importing them all together with
         ';importmacro'. Use ';emptyclipboard' when you want to start afresh.
         Note that 'Export' buttons in preference/edit windows empty the
         clipboard, before adding one or interfaces to it.
      Both active and inactive macros can be exported.

      <switches> allows you to define which macro (and which of its attributes)
         should be exported.

      To export an active macro directly, one of the following (group 0) switch
         options must be used:
         -i <name>            - Exports the active macro <name>
         -i <number>          - Exports the active macro <number>
      However, to export an inactive macro, one of the following (group 1)

share/help/cmd/exporttimer  view on Meta::CPAN

xti / exporttimer             Exports a timer to the interface clipboard

   Format:
      ;xti <switches>         Exports a timer

   Notes:
      Timers are one of five types of Axmud interface (the others being
         triggers, aliases, macros and hooks).
      Timers allow you to execute an instruction repeatedly at fixed intervals,
         and also to specify an instruction to be executed later.
      This command provides a simple way to copy timers from one profile/cage
         to another (perhaps even in a different world, in a different session).
         It 'exports' the timer 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 timer'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 timers
         to the clipboard, before importing them all together with
         ';importtimer'. Use ';emptyclipboard' when you want to start afresh.
         Note that 'Export' buttons in preference/edit windows empty the
         clipboard, before adding one or interfaces to it.
      Both active and inactive timers can be exported.

      <switches> allows you to define which timer (and which of its attributes)
         should be exported.

      To export an active timer directly, one of the following (group 0) switch
         options must be used:
         -i <name>            - Exports the active timer <name>
         -i <number>          - Exports the active timer <number>
      However, to export an inactive timer, one of the following (group 1)

share/help/cmd/exporttrigger  view on Meta::CPAN

xtr / exporttrigger           Exports a trigger to the interface clipboard

   Format:
      ;xtr <switches>         Exports a trigger

   Notes:
      Triggers are one of five types of Axmud interface (the others being
         aliases, macros, timers and hooks).
      Triggers allow you to react automatically to text received from the world.
         The reaction can have one of three forms: the trigger can execute an
         instruction (including world commands, forced world commands, client
         commands, echo commands, Perl commands, script commands and multi
         commands) or it can split a line into two (a 'splitter' trigger), or it
         can change the way the received text is displayed in the 'main' window
         (a 'rewriter' trigger).
      This command provides a simple way to copy triggers from one profile/cage
         to another (perhaps even in a different world, in a different session).
         It 'exports' the trigger 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 trigger'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 triggers
         to the clipboard, before importing them all together with
         ';importtrigger'. Use ';emptyclipboard' when you want to start afresh.
         Note that 'Export' buttons in preference/edit windows empty the
         clipboard, before adding one or interfaces to it.
      Both active and inactive triggers can be exported.

      <switches> allows you to define which trigger (and which of its
         attributes) should be exported.

      To export an active trigger directly, one of the following (group 0)
         switch options must be used:
         -i <name>            - Exports the active trigger <name>
         -i <number>          - Exports the active trigger <number>
      However, to export an inactive trigger, one of the following (group 1)

share/help/cmd/importalias  view on Meta::CPAN

ial / importalias             Imports alias(es) from the interface clipboard

   Format:
      ;ial <name> <switches>  Imports the alias called <name>
      ;ial <switches>         Imports all clipboard aliases

   Notes:
      Aliases are one of five types of Axmud interface (the others being
         triggers, macros, timers and hooks).
      Aliases allow you to define shortcuts for world commands and to have those
         commands modified before being sent to the world.
      This command provides a simple way to copy aliases from one profile/cage
         to another (perhaps even in a different world, in a different session).
         Having 'exported' the alias to Axmud's interface clipboard using the
         ';importalias' command, that alias can then be 'imported'.
      Note that the contents of the clipboard are not saved. Note also that the
         alias'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 alias was exported, an inactive alias is imported. The
         imported alias will not replace an existing alias with the same name.

      <switches> allows you to specify which profile's alias cage should
         receive the imported aliases. One of the following (group 1) switches
         may be specified:
         (no switch)   - Imports alias(es) to the current world
         -w            - Imports alias(es) to the current world

share/help/cmd/importhook  view on Meta::CPAN

ihk / importhook              Imports hook(s) from the interface clipboard

   Format:
      ;ihk <name> <switches>  Imports the hook called <name>
      ;ihk <switches>         Imports all clipboard hooks

   Notes:
      Hooks are one of five types of Axmud interface (the others being triggers,
         aliases, macros and timers).
      Hooks allow you to specify instructions to be executed automatically when
         certain events happen.
      This command provides a simple way to copy hooks from one profile/cage to
         another (perhaps even in a different world, in a different session).
         Having 'exported' the hook to Axmud's interface clipboard using the
         ';importhook' command, that hook can then be 'imported'.
      Note that the contents of the clipboard are not saved. Note also that the
         hook'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 hook was exported, an inactive hook is imported. The imported
         hook will not replace an existing hook with the same name.

      <switches> allows you to specify which profile's hook cage should receive
         the imported hooks. One of the following (group 1) switches
         may be specified:
         (no switch)   - Imports hook(s) to the current world
         -w            - Imports hook(s) to the current world

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
         imported macro will not replace an existing macro with the same name.

      <switches> allows you to specify which profile's macro cage should
         receive the imported macros. One of the following (group 1) switches
         may be specified:
         (no switch)   - Imports macro(s) to the current world
         -w            - Imports macro(s) to the current world

share/help/cmd/importtimer  view on Meta::CPAN

iti / importtimer             Imports timer(s) from the interface clipboard

   Format:
      ;iti <name> <switches>  Imports the timer called <name>
      ;iti <switches>         Imports all clipboard timers

   Notes:
      Timers are one of five types of Axmud interface (the others being
         triggers, aliases, macros and hooks).
      Timers allow you to execute an instruction repeatedly at fixed intervals,
         and also to specify an instruction to be executed later.
      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
         timer'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 timer was exported, an inactive timer is imported. The
         imported timer will not replace an existing timer with the same name.

      <switches> allows you to specify which profile's timer cage should
         receive the imported timers. One of the following (group 1) switches
         may be specified:
         (no switch)   - Imports timer(s) to the current world
         -w            - Imports timer(s) to the current world

share/help/cmd/importtrigger  view on Meta::CPAN

itr / importtrigger           Imports trigger(s) from the interface clipboard

   Format:
      ;itr <name> <switches>  Imports the trigger called <name>
      ;itr <switches>         Imports all clipboard triggers

   Notes:
      Triggers are one of five types of Axmud interface (the others being
         aliases, macros, timers and hooks).
      Triggers allow you to react automatically to text received from the world.
         The reaction can have one of three forms: the trigger can execute an
         instruction (including world commands, forced world commands, client
         commands, echo commands, Perl commands, script commands and multi
         commands) or it can split a line into two (a 'splitter' trigger), or it
         can change the way the received text is displayed in the 'main' window
         (a 'rewriter' trigger).
      This command provides a simple way to copy triggers from one profile/cage
         to another (perhaps even in a different world, in a different session).
         Having 'exported' the trigger to Axmud's interface clipboard using the
         ';importtrigger' command, that trigger can then be 'imported'.
      Note that the contents of the clipboard are not saved. Note also that the
         trigger'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 trigger was exported, an inactive trigger is imported. The
         imported trigger will not replace an existing trigger with the same
         name.

      <switches> allows you to specify which profile's trigger cage should
         receive the imported triggers. One of the following (group 1) switches
         may be specified:
         (no switch)   - Imports trigger(s) to the current world

share/help/cmd/listclipboard  view on Meta::CPAN

lcb / listclipboard           Lists the contents of the interface clipboard

   Format:
      ;lcb <switches>         Lists the clipboard

   Notes:
      Axmud interfaces are triggers, aliases, macros, timers and hooks.
      Interfaces can be exported and imported between profiles (for example,
         between two different world profiles).
      When exporting (for example, using ';exporttrigger', the interfaces are
         stored temporarily in Axmud's own interface clipboard. This command
         displays the contents of the clipboard.
      See also the help for ';clearclipboard'.

   User commands:
      lcb / listclipboard



( run in 2.239 seconds using v1.01-cache-2.11-cpan-84e82930d8c )