|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Sun Apr 23, 2006 6:06 pm
finding room color via map |
hey. im tryin to do something but i just cant get it to work.. basically i want to produce a list on my map of every room colored xxx.
eg... all my deadly rooms are colored red. and all my hunting rooms are collored #47E4C5
how can i make it produce a list of the rooms with a color i specify?
chears for the help
[edit] I have a zmapper licence if zmap is required |
|
|
|
Vodoc Apprentice
Joined: 11 Apr 2003 Posts: 119 Location: Sweden
|
Posted: Sun Apr 23, 2006 8:29 pm |
Code: |
#alias search_color {
#VARIABLE map_rooms {%mapquery( %concat( "[Color] = ", %1, " AND ZoneID = ", %zonenum))}
#ECHO {Searched for color ~"%1~" in %zonename ~(%zonenum~) found %numitems( @map_rooms) rooms.}
#COLOR (high,green)
#FORALL @map_rooms {#ECHO {%roomname( %i) (%i)}}
}
#alias room_current {#ECHO Color in %roomname( %map.SelectRoomID) ~(%map.SelectRoomID~) is %roomcol( %map.SelectRoomID)} |
You must have zMapper installed for this to work.
Use the alias room_current to get the colour you are currently in (according to the blue dot). Then use the alias search_color <color> i.e. search_color 65535 to get a list of all rooms in the currently active zone (once again according to the blue dot) with the specified colour. I think the aliases should be pretty self explaining but ask away if you need further help. |
|
|
|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Fri Apr 28, 2006 8:08 pm |
wow! works better then i even expected! thankyou very much
sorry its taken me so long to reply! |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Sun Apr 30, 2006 1:09 pm |
Any way to do this WITHOUT zmapper?
|
|
|
|
Vodoc Apprentice
Joined: 11 Apr 2003 Posts: 119 Location: Sweden
|
Posted: Sun Apr 30, 2006 2:32 pm |
Hmm, very easy actually. The first alias (search_color) works right out of the bat since it doesn't use they %map function.
Code: |
#ALIAS room_current {#ECHO Color in %roomname( ) ~(%roomkey( )~) is %roomcol( )} |
That's actually enough to get all the required info from the current room without requiring zMapper, the first script I posted was just thrown together out of something a little bit more complex and I didn't thought about simplifying it to the above script. |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Mon May 01, 2006 4:05 pm |
Kewl, thanks.
Made a SLIGHT mod to the script: (to which you might wanna make a 2nd alias to keep the 1st one for some reason)
#VARIABLE map_rooms {%mapquery( %concat( "[Color] = ", %1))}
#ECHO {Searched for color ~"%1~" and found %numitems( @map_rooms) rooms.}
#COLOR (high,green)
#FORALL @map_rooms {#ECHO {%roomname( %i) (%i)}}
This will search ALL zones for the color.
Searched for color "65535" and found 7 rooms.
Fantasizing (13863)
An Overgrown Forest Trail (14059)
At the entrance of the park (14860)
The Entrance To A Large Forest (14959)
The edge of a steamy marsh. (15009)
Union Station (15059)
A Quiet Meadow (15386)
Now, the question is, how to get the zone names listed in there?
Fantasizing (13863) - Fantasy Fields |
|
|
|
Vodoc Apprentice
Joined: 11 Apr 2003 Posts: 119 Location: Sweden
|
Posted: Mon May 01, 2006 6:18 pm |
Vitae wrote: |
Now, the question is, how to get the zone names listed in there?
Fantasizing (13863) - Fantasy Fields |
By using the functions %zonename and %roomzone. For example change the loop in the above script to this:
Code: |
#FORALL @map_rooms {#ECHO {%roomname( %i) (%i) - %zonename( %roomzone( %i))}} |
|
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Mon May 01, 2006 6:33 pm |
Bleh, I was headed in the right direction, but I only had done %zonename()
Thanks Vodoc!
I got the 1st room(s) of the areas colored so makes a few things easier for me now. |
|
|
|
|
|