TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

#map find

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
pladdypants



Joined: 30 Nov 2014
Posts: 8

PostPosted: Sun Nov 30, 2014 8:39 pm    Post subject: #map find Reply with quote

Hey there,

I've been mapping on my mud and I've found i mostly note rooms of interest with a color and a roomnote. I'm not setting the roomname until I have a room i may want to speed walk to.

Is it possible to use #map find to just search for keywords in the roomnote field?

Thanks!
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Tue Dec 02, 2014 5:37 am    Post subject: Reply with quote

This should work:

Code:
#map find {} {} {} {} {notes to search here}
Back to top
View user's profile Send private message
pladdypants



Joined: 30 Nov 2014
Posts: 8

PostPosted: Wed Dec 03, 2014 3:44 pm    Post subject: re; #Map find Reply with quote

Thanks a ton, that seemed to work. I might end up doing something with the map file itself using grep since my notes overlap and find only sets one path.

Thank you,
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Fri Dec 05, 2014 12:33 pm    Post subject: Reply with quote

I thought that #map find had been updated a version or two back to accept pairs of {field} {thing to look for} arguments {instead of|as well as} the format that you used which is #map find {thing to look for in room name(?)} {thing to look for in room area(?)} {thing to look for in ....} ... {thing to look for in data} - though its been so long since I've used TinTin++ that I cannot remember the exact list of fields for the newer format or the order of subjects for the older format... Embarassed
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Fri Dec 05, 2014 3:29 pm    Post subject: Reply with quote

That's what the HELP of v2.01.0 tells:
Code:
#map find <name> <exits> <desc> <area> <note> <terrain>


anyway the method you are describing is very interesting and powerful, maybe not so backward compatible, but nothing that can't be corrected with a patching batch on all the old scripts.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sat Dec 06, 2014 12:22 pm    Post subject: Reply with quote

Code:

         #map list <name> <exits> <desc> <area> <note> <terrain>
                  Lists all matching rooms and their distance.

                  Use {variable} {<variable>} to save the output to a variable.
                  {roomname} {<name>}, {roomarea} {<area>}, etc, are valid too.

Same method works for #map find.
Back to top
View user's profile Send private message Send e-mail
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sun Dec 07, 2014 10:55 am    Post subject: Reply with quote

Code:
#map list {roomname} {name of the room}

indeed works showing a list of all the rooms with that name (cool Smile )

but I can't understand how to "save the output to a variable"
Back to top
View user's profile Send private message
ixle



Joined: 15 Sep 2011
Posts: 158
Location: United States

PostPosted: Sun Dec 07, 2014 3:47 pm    Post subject: Reply with quote

Does #map list {roomname} {<name of the room>} {variable} {<some_variable>} not work?
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sun Dec 07, 2014 4:01 pm    Post subject: Reply with quote

oh, now I got it Smile

Anyway I found that not all the info are saved into the list, for example if I have 2 rooms with a similar name:

name1
name2

and I do a "#map list {roomname} {name}"

I get this:

vnum: 6 distance: 3.000 name: name1
vnum: 7 distance: 3.000 name: name2

while if I do a "#map list {roomname} {name} {variable} {roomlist}"

I get this:

#VARIABLE {roomlist}={{6}{3.000}{7}{3.000}}

and I lost the corresponding room names
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Fri Jan 02, 2015 4:16 pm    Post subject: Reply with quote

Well, it is slightly possible that a while ago I come up with the variable option because the other fields are used to identify matching rooms but there wasn't a way to capture the list of rooms found: hence the idea of storing them into a variable - then reporting the distance is helpful to find the nearest room with a specified item; e.g.: "Where can I find the nearest piece of Willow bark for a healing potion".

After all, once you know the room vnum it is a simple task to query all the details for that room. Coffee
Back to top
View user's profile Send private message
szhairui



Joined: 16 Jan 2013
Posts: 13

PostPosted: Sat Jan 10, 2015 10:58 am    Post subject: Reply with quote

PowerGod wrote:
oh, now I got it Smile

Anyway I found that not all the info are saved into the list, for example if I have 2 rooms with a similar name:

name1
name2

and I do a "#map list {roomname} {name}"

I get this:

vnum: 6 distance: 3.000 name: name1
vnum: 7 distance: 3.000 name: name2

while if I do a "#map list {roomname} {name} {variable} {roomlist}"

I get this:

#VARIABLE {roomlist}={{6}{3.000}{7}{3.000}}

and I lost the corresponding room names


But which one is the best way to traversal a list like that ?

#VARIABLE {roomlist}={{6}{3.000}{7}{3.000}}

My way is something like :

Code:

   #foreach {$lstTargetRoom} {r}
      {
         #var r;
         #regex {$r} {%d.%d} {}
         {
            #map find $r;
            #path show;
         };
      };

But that seems strange.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jan 11, 2015 9:24 am    Post subject: Reply with quote

Try

Code:
#foreach {$lstTargetRoom[]} {r}


That way you only parse the keys.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group