|
in4939 Newbie
Joined: 12 Nov 2008 Posts: 5
|
Posted: Wed Jul 08, 2009 12:27 pm
CMud Automapper get Zone name |
Hi
I'm trying to write a cmud alias that when given a room name as a parameter will return the zone name (rather than the zone id).
So far I can get the zoneid of the room, but I can't get the zone name.
Any help will be much appreciated. |
|
|
|
in4939 Newbie
Joined: 12 Nov 2008 Posts: 5
|
Posted: Wed Jul 08, 2009 12:36 pm |
Actually I take that back - I can't even get the zoneId - just the room number.
|
|
|
|
in4939 Newbie
Joined: 12 Nov 2008 Posts: 5
|
Posted: Wed Jul 08, 2009 1:57 pm |
Would I have to write a COM component to do proper SQL lookups on the map database?
|
|
|
|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Wed Jul 08, 2009 1:57 pm |
You'll need to stack a few functions, %mapquery() to get the room number, then %roomzone to get the zone then %zonename to get the zone name
Code: |
%zonename(%roomzone(%mapquery("[Name] like 'test'"))) |
|
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
|
in4939 Newbie
Joined: 12 Nov 2008 Posts: 5
|
Posted: Wed Jul 08, 2009 2:52 pm |
Thanks Wyrm that almost works!!!
%zonename appears to be working fine as does %mapquery but for some strange reason %roomzone always returns the same value, nomatter what roomid I pass to it.
ANyone got any ideas why that would be so? |
|
|
|
in4939 Newbie
Joined: 12 Nov 2008 Posts: 5
|
Posted: Wed Jul 08, 2009 3:14 pm |
Scratch that last one, it now works perfectly.
Thanks Wym - that was just the job. |
|
|
|
|
|