Introduction
The mailbox is a standalone object (or linked prim? untested) designed to allow client applications to send data to users via notecards, similar to email messages. These notecards may be picked up by the user via a simple menu interface invoked by clicking the object.
Construction
Any construction should work; the script, configuration notecard and any mail messages all inhabit the same prim, which should be clickable.
Communication
The Mailbox uses the same principle of channels, and similar initial handshaking, to the Scoreboard. See that document for an explanation of the principles and execution. The differences are that that Mailbox uses chat channel -6447600, and broadcasts "M" plus the channel name. A similar method of sending data to the mailbox is recommended.
The scoreboard channel is specified as Scoreboard = "<channel>" in configuration notecard "Mailbox config".
Commands received by the Mailbox are as follows:
C
M<name>|<line1>|<line2>|<line3>| [...]
Clear mailbox; removes all messages and resets the script
Create mail message in notecard <name>
For example, sending "MHaiku|at the age old pond|a frog leaps into water|a deep resonance" will create a notecard called "Haiku" with the contents:
at the age old pond
a front leaps into water
a deep resonance
The notecard is stored in the mailbox prim.
Use notes
The user can pick up messages by clicking the object, which will present them with a menu. The menu text will list notecards currently in the prim, numbered 1, 2, 3, etc. Corresponding numbered buttons are below. If there are more than 9 buttons, only the first 9 are shown, and a button "Next >>" is shown to allow navigation to the next page (on all subsequent pages, a "<< Prev" button allows backward navigation). A button "Done" allows the menu to be closed gracefully.
Selecting a number corresponding to a notecard will cause the script to offer that card to the user and delete it from the prim's inventory. If the user declines the card, it is lost by design.
To avoid extraneous listeners, the menu listener is silently closed after one minute of inactivity. In this case, the menu may be redisplayed by clicking the object again.