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
croww
Beginner


Joined: 02 Jul 2013
Posts: 10

PostPosted: Tue Aug 19, 2025 5:48 pm   

Find room alias
 
I would like to create an alias named FR

So when i type FR cyclop , it would show me all rooms with name cyclop in a list.

I managed to make this and this show the info i like when i type it out in the "command line"


#VAR Path %mapquery("[Name] LIKE '%cyclop%'")
#FORALL @Path {#SHOW %roomname(%i),Zone %zonename(%roomzone(%i)),rumnr %i}


But i cant use this in creating a alias. i tried this

<alias name="FR " autoappend="true" id="2536">
<value>
#VAR Path %mapquery("[Name] LIKE '%%1%'")
#FORALL @Path {#SHOW %roomname(%i)),Zone %zonename(%roomzone(%i)),rumnr %i} </value>
</alias>

Nothin happens when i type FR cyclop

I also tried this

<alias name="FR " autoappend="true" id="2536">
<value>
#VAR Path %mapquery("[Name] LIKE '%cyclop%'")
#FORALL @Path {#SHOW %roomname(%i),Zone %zonename(%roomzone(%i)),rumnr %i} </value>
</alias>

And thought i would get the list if i just typed FR like i get when i type the same thing in the command line.

I might missunderstand how to use aliases, and i should use something else ?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Tue Aug 26, 2025 1:46 am   
 
i often find i have to use %char when dealing with single and double quote characters you want in a %concat string, which you will need to cobble together your %mapquery string with variables


Something like:

#FORALL %mapquery(%concat(%char(34), "[Name] LIKE '%", %1, "%'", %char(34))) {stuff}
_________________
Discord: Shalimarwildcat
Reply with quote
croww
Beginner


Joined: 02 Jul 2013
Posts: 10

PostPosted: Tue Aug 26, 2025 10:12 am   
 
Thank you, the %concat thing fixed it.

If someone wants the same alias, it looks like this

<alias name="FR" autoappend="true" id="2536">
<value>#VAR Path %mapquery(%concat(%char(34), "[Name] LIKE '%", %1, "%'", %char(34)))
#FORALL @Path {#SHOW %roomname(%i), Zone %zonename(%roomzone(%i)), rumnr %i}</value>
</alias>


So if you type FR Inside the temple of Maar
It will show all "Inside the temple of Maar", what zone its in and the roomnumber if you wanna #walk there
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