|
Erasmus Wanderer
Joined: 04 Aug 2004 Posts: 82 Location: Philadelphia
|
Posted: Tue Sep 18, 2007 12:37 am
Calling the mapper from a child window |
Every time I go on a quest I have the essential info (what i need to get, what room, what zone) put into a child window, called Quest, for easy reference in case I forget where I am going (which happens a lot). What I want to do is make a spped menu for that window that will allow me to select the room name, filter the mapper for all names with that room, and have the results displayed to the main window of the mud.
The code below creates a speed menu from selected text, filters the map for rooms that have that/those word(s), and then displays an output showing the Room Name, VNum, Zone, and SpeedWalk to the room. This does exactly what I want, and it works from the main window, but I don't know how to modify it so it will work from a child window. Some help please.
Code: |
#IF (%isnumber( %selected)) {#CALL %mapfilter(ObjID = %selected)} {#CALL {%mapfilter(%concat(Name LIKE '*,%selected,*'))}}
#CR
#IF (%numrooms = 0) {#ECHO No Matching Rooms Found}
#IF (%numrooms > 0 & %numrooms <= 50) {#LOOP %numrooms {#ECHO %concat( Room: %roomname( %mapvnum( %i)) ~(%mapvnum( %i)~), %repeat( " ", %eval( 40-6-%len( %roomname( %mapvnum( %i))))), Zone: %zonename( %roomzone( %mapvnum( %i))), %repeat( " ", %eval( 60-12-%len( %roomname( %mapvnum( %i)))-%len( %zonename( %roomzone( %mapvnum( %i)))))), SW: %replace( %walk( %mapvnum( %i)), "."))}}
#IF {%numrooms > 50} {#ECHO %numrooms Matching Rooms Found}
#CALL %mapfilter("") |
Also, I'm sure this is some way to do this much faster, and more efficient then what I have. I am going to look at other options like ptting the results in a variable first, or using mapquery instead of mapfilter, but any tips would be appreciated. |
|
_________________ Erasmus |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Sep 18, 2007 3:56 am |
I think the easiest way would be to dump the code into an alias kept in the main window's settings. The menu would instead call the alias, allowing the menu to be safely moved to the child window's settings.
In the alias, try changing #ECHO to :windowname:. Dunno if that will work, but if it does then you won't need any extra variables. If it don't work, change it to a variable assignment and then send the final result via :windowname: or #window. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|
|
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
|
|