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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
seannity
Newbie


Joined: 15 Jul 2006
Posts: 6

PostPosted: Wed Oct 03, 2007 1:03 pm   

Need help with automapper please :)
 
Hi everyone,
I have one question and i do not know if it is possible in zmud. I would like to make a trigger to retrieve zone name by using room name.
For an example, when i say 'check bedroom', then zmud will show the zone name of that room.

Any helps would be greatly appreciated :)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Oct 03, 2007 3:01 pm   
 
The trouble is that unless you have one room with the literal name "bedroom" (which seems unlikely) then there's going to be more than one result.

Nevertheless, you can use the %mapquery function to do this. Something like:

#alias check {#forall %mapquery(%concat("[NAME] like %",%-1,"%")) {#say Room: %roomname(%i) Name: %zonename(%roomzone(%i))}}

This'll create a map query "[NAME] like %whateveryoutype%" and then loop through all the room ids that this query spits out, listing their name and the name of the zone that they're in.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
seannity
Newbie


Joined: 15 Jul 2006
Posts: 6

PostPosted: Wed Oct 03, 2007 4:13 pm   
 
thank you so much Fang Xianfu...
I dont know i'm dumb or what, but i couldn't get it to work after copy and paste it,
but it gaves me an idea how it is going be and after I read some help file I comes out with this
and it works wonderfully.

#ALIAS check {#forall %mapquery( "[Name] LIKE '%-1'") {#say RoomName: %roomname( %i) AreaName: %zonename( %roomzone( %i))}}

by the way... is it possible to make it to show any room name with the same keyword?
Let say I type 'check bedroom' and it will show 'a bedroom','the bedroom', and so on...
thanks again :)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Oct 03, 2007 4:51 pm   
 
The %s are important - they'll do what you're after.

Also, I reckon mine wasn't working because the capitalisation was wrong. Try:

#alias check {#forall %mapquery(%concat("[Name] LIKE '%",%-1,"%'")) {#say Room: %roomname(%i) Name: %zonename(%roomzone(%i))}}

Though just adding %s to yours should do the trick
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
seannity
Newbie


Joined: 15 Jul 2006
Posts: 6

PostPosted: Wed Oct 03, 2007 5:42 pm   
 
wow... this is perfect!
bow deeply...
Reply with quote
seannity
Newbie


Joined: 15 Jul 2006
Posts: 6

PostPosted: Sat Oct 13, 2007 9:03 am   
 
Now i have another problem and anyone could help me please?
My problem is the automapper open for incorrect window and therefore it couldn't check the roomname
I have tried to put this into the check trigger but no lucks :(

#trigger {(%w) says 'check (%*)'.} {#menu {Windows|1};#menu {Windows|Automapper};check %2}
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sat Oct 13, 2007 2:08 pm   
 
Just close the automapper that is in the wrong window and reopen it in the right window?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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