Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
jakj
Novice


Joined: 30 Apr 2006
Posts: 45

PostPosted: 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?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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?
Reply with quote
jakj
Novice


Joined: 30 Apr 2006
Posts: 45

PostPosted: 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.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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>")}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net