|
jakj Novice
Joined: 30 Apr 2006 Posts: 45
|
Posted: Sun Nov 28, 2010 2:10 pm
Mapper Room-Name Search Automatic Trigger |
So, how about this: Trigger on text from the MUD to somehow make a clickable link which, when clicked, issues a search in the mapper on the text as a room name (thereby opening a spreadsheet view with the results).
Any ideas? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sun Nov 28, 2010 10:18 pm |
Sure. First question: are your room names clearly identifiable as room names, as distinguished from any other text?
|
|
|
|
jakj Novice
Joined: 30 Apr 2006 Posts: 45
|
Posted: Sun Nov 28, 2010 11:52 pm |
Yes, I will be able to easily separate them. Making the trigger to capture and modify the text is the easiest part and won't be a problem. What I need to know are
*) how to #sub to create a clickable link to execute a CMUD function (presumably with MXP), and
*) how to programmatically (versus manually) bring up a room-name search within the mapper. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Nov 29, 2010 1:27 pm |
The map search part will be either #MAPQUERY or %mapquery().
The substitution part will be:
Code: |
<send 'command string'>displayed string</send>
|
This will be just a bit tricky, because MXP doesn't handle quote marks within the command string well, and mapqueries use single quotes to delimit the SQL string. The easiest way around this is to create an alias. Let's call the alias findroom. The value of findroom would be something like:
Code: |
$roomname = %params
#MAPQUERY {%concat("[Name] = '",$roomname,"'")}
|
Now for the replace trigger. The code for this part would be something like:
Code: |
...
<code to set $roomname to name of room>
...
#sub {%concat("<send 'findroom ",$roomname,"'>",$roomname,"</send>")}
|
|
|
|
|
|
|