MSLP
MSLP (Mud Server Link Protocol) requires enabling #config mouse on,
and creating the appropriate LINK events.
The simplest link can be created by surrounding a keyword with the
\e[4m and \e[24m tags.
Example: #substitute {\b{n|e|s|w|u|d}\b} {\e[4m%1\e[24m}
This would display 'Exits: n, e, w.' as 'Exits: n, e, w.'.
When clicked this would trigger the PRESSED LINK MOUSE BUTTON ONE
event of which %4 will hold the link command and %6 holds the
link name, which in the case of a simple link will be empty.
Example: #event {PRESSED LINK MOUSE BUTTON ONE} {#send {%4}}
Keep in mind that if you change PRESSED to DOUBLE-CLICKED the link
will only work if the text does not scroll in between clicks.
If you want to create a complex link use an OSC code.
Example: #sub {\bsmurf\b} {\e]68;1;;say I hate smurfs!\a\e[4m%0\e[24m}
If you have the LINK event of the previous example set, the %4
argument will contain 'say I hate smurfs!'.
Example: #sub {\bgoblin\b} {\e]68;1;SEND;kill goblin\a\e[4m%0\e[24m}
Notice the previous instance of ;; has been replaced with ;SEND;
which will name the link. This will generate a named event.
Example: #event {PRESSED LINK SEND MOUSE BUTTON ONE} {#send {%4}}
By naming links you can organize things a little bit better instead
of tunneling everything through the same event.
Keep in mind that the server is allowed to use \e]68;1;\a as well,
subsequently various security measures are in place.
To create secure links, which are filtered out when send by a server,
you need to use \e]68;2;\a, and they instead trigger the SECURE LINK
event.
To creae a link that is not undelined, use \e]4;24m text \e]24m.
Example: #sub {%* tells %*} {\e]68;2;EXEC;#cursor set tell %1 \a\e[4;24m%0\e[24m}
#event {PRESSED SECURE LINK EXEC MOUSE BUTTON ONE} {%4}
This would make you start a reply when clicking on a tell.
Website: https://tintin.mudhalla.net/protocols/mslp
Related: event and port.
|