Creates an underlined hyperlink that the player can click on to carry out
some action.
The default behaviour is for the action to be sent to the MUD (eg. "go
north"), however if PROMPT is specified the action is placed in the
client's command window for modification before sending (eg. "tell Nick
...").
This is a very powerful feature, which allows MUDs to provide hyperlinks
for clicking on, rather than players having to memorise lots of commands.
Send without arguments
In the simple case, <send> without arguments merely sends whatever
is between <send> and </send> to the MUD. eg.
<send>West</send>
In the above case, clicking on the hyperlink sends "West" to the
MUD.
Send with HREF
You can send different text to what the player sees by using HREF. eg.
<send href=West>West - The Second Floor Landing</send>
In this case, the player sees "West - The Second Floor Landing"
as a hyperlink, however if they click on it the word "West" is
merely sent to the MUD.
Send with HINT
You can set up a "mouse-over" hint that appears if the player moves the mouse
over the hyperlink. eg.
<send href=West hint="Go to the second floor landing">West - The
Second Floor Landing</send>
In this case, the player sees "Go to the second floor landing"
in a little popup window if they move the mouse over the hyperlink.
Creating a popup menu
You can also create a pop-up menu that appears if the player right
-mouse clicks on the link. You do that by separating the various possible
words to be sent to the MUD by the vertical bar character - "|".
If the player left-mouse clicks the first item on the list (the default)
is automatically sent. This will also appear in bold in the menu if you right-mouse
click.
By using HINT you can also specify the text of each item in the menu. If
you also want a mouse-over hint then you need to provide that first. For
all this to work properly, the number of hint items should be equal to, or
one greater-than, the number of commands to be sent. eg.
<send "help shop|buy bread|buy meat|buy fish" hint="RH
click for items to purchase|Help|Bread - $20|Meat - $30|Fish - $15">Click
here to shop</send>
There is currently a limit of 30 items that you can put into the menu. Additional
ones will be ignored.
Send with PROMPT
By using the keyword PROMPT you can cause the text to be not sent immediately,
but rather to be put into the client's command buffer. This would be useful
for things like player names, where you might want to send them a "tell"
or similar.
<send "tell &text; |mail &text;|whisper &text; " hint="RH
click to contact &text;|Tell &text; something|Send mail to &text;|Whisper
to &text;" PROMPT>Gweonnyn</send>
This example also illustrates use of the special entity "&text;".
If you use that inside an element's arguments, the word "&text;"
is replaced by the text between <send> and </send>.
What this means is that if the player clicks on the menu link with the right-mouse
button they would see (in this example):
- Tell Gweonnyn something
- Send mail to Gweonnyn
- Whisper to Gweonnyn
Making your own elements with SEND in them
Because the player's name is not inside the definition itself, then you can
simplify life for yourself by defining your own element, like this:
<!ELEMENT player '<send "tell &text; |mail &text;|whisper
&text; " hint="RH click to contact &text;|Tell &text;
something|Send mail to &text;|Whisper to &text;" PROMPT>'>
The element definition only needs to be sent once, at the start of the session.
Now, all you have to do (for example, in a WHO list), is use the newly defined
tag "player" like this:
<player>Gweonnyn</player>
This is short and simple. You could do similar things with items in shops,
inventories, and so on. |