Games-Axmud

 view release on metacpan or  search on metacpan

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


Suppose we want to intercept all shout messages like this:

       Bilbo shouts, 'I'm the greatest!'

...and to redirect the text into a channel called **boasting**. This is how to do it.

* Open the edit window with the **;editworld** command
* Click on **Channels > Page 1** tab
* Enter a pattern like **shouts**
    * A better pattern would be **^\w+ shouts,**
* Enter the channel name **boasting**
* If you want the message to appear only in the task window, and not the main window too, check the box
* Click the **Add** button
* The change is applied to any Channels/Divert tasks as soon as you click the **Save** or **OK** buttons

You might want to see messages like **Gandalf tells you...** and **Bilbo tells you...**, but not **The shopkeeper tells you...**

For this, you can specify *ignore patterns*. When some text is received from the world, if it matches a channel pattern AND an ignore pattern, it isn't redirected to the task window.

* Open the edit window with the **;editworld** command
* Click on the **Channels > Page 1** tab
* Add the channel pattern **tells you**, as described above
* Now click on **Page 2**
* Add the ignore pattern **shopkeeper tells you**
* The changes are applied to any Channels/Divert tasks as soon as you click the **Save** or **OK** buttons

###<a name="11.6.2">11.6.2 The Channels task</a>

![Channels task window](img/ch11/channels_task.png)

The Channels task is fairly self-explanatory.  When it first starts, tabs for three channels are created.  If you've specified any more channels, extra tabs are added as soon as they are needed.

You can modify some aspects of the task's behaviour.

* Open the task's edit window with the **;edittask channels** command
* Click on the **Parameters - Page 1** tab
* In the **Summary tab** section, click the 'multi' button
* In the **Display options** section, click the button **Tabs in the task window have a close button**
* Now click on **Page 2**
* Modify the initial channel list
* When you're ready, click the **Save** or **OK** buttons
* Reset the task to apply your changes, using **;resettask channels**

That will modify the current task; in [Section 12](ch12.html), we'll discuss how to make those changes permanent.

![Channels task window](img/ch11/channels_task_2.png)

###<a name="11.6.3">11.6.3 The Divert task</a>

The Divert task is the (much) older brother of the Channels task.

Divert task windows doesn't have multiple tabs; instead, when some text is intercepted, the background colour changes temporarily.  In this case, it has turned yellow signifying that the text is in the **tell** channel.

![Divert task window](img/ch11/divert_task.png)

Traditionally, the Divert task used just four channels - one for **social** messages, one for **tell** messages, a **warning** channel and a **custom** channel for everything else.

The task can now use any channel.  The four channels above each have their own colour; any other channel you might create is displayed using a fifth colour (magenta by default).

For your convenience, the window provides a command entry box. Any type of instruction, including client commands and speedwalk commands, can be typed in this box. This is useful if you're connected to a world, but busy doing something else; as long ...

If you're connected to several worlds at the same time, you might also find the Watch task useful. Everything displayed in Channels, Chat and Divert task windows, in any session, is copied into any Watch task window that's open.

##<a name="11.7">11.7 The Chat task</a>

The Chat task is an instant messenger service. It is an almost complete implementation of the MudMaster and zChat protocols (only encryption has not yet been implemented).

Several popular MUD clients implement these protocols, so your friends don't need to be using Axmud; they only need to be using a compatible MUD client.

There are some issues of security to consider, so we recommend you read the whole of this Section before using the task.

You can get started by listening out for incoming calls.

        ;chatlisten
        ;listen

When you receive an incoming call, you can either accept or decline it.

![Incoming chat popup](img/ch11/incoming_chat.png)

For outgoing calls you'll need to know your friend's IP address and the port they're using for chat sessions.

Calls can be made with either protocol. The zChat protocol is slightly more powerful, so let's use that.

        ;chatzcall 159.200.36.251 4050
        ;zcall 159.200.36.251 4050

Most MUD clients use the port 4050, so it's normally safe to omit it.

        ;chatzcall 159.200.36.251
        ;zcall 159.200.36.251

You can also call someone using the main window menu.

* To listen for incoming calls, click on **Tasks > Chat task > Listen for incoming calls**
* To make an outgoing call, click on **Tasks > Chat task > Chat using zChat...**

###<a name="11.7.1">11.7.1 Chat task commands</a>

Once a connection is established, a task window will appear.

![Chat task window](img/ch11/chat_task.png)

There are about thirty client commands used with the Chat task, all of which are typed in the main window. For a list of them, type:

        ;taskhelp chat
        ;th chat

There is a *separate* list of commands used in the task's own window. All of these commands begin with the usual semicolon ( ; ) character. To see this list, type **;help** in the task window.

###<a name="11.7.2">11.7.2 Chatting and emoting</a>

To chat with someone, just type into the window.

![Chat task window](img/ch11/chat_task_2.png)

You can also send emotes. In the main window, you would type:

        ;emote grins



( run in 1.043 second using v1.01-cache-2.11-cpan-39bf76dae61 )