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 question

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
dalton



Joined: 26 Jan 2012
Posts: 30

PostPosted: Fri Feb 03, 2012 9:00 pm    Post subject: map question Reply with quote

I have a map with over 100 room,how can i walk through all rooms quickly ,and not deny by MUD server for too many cmds?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3281

PostPosted: Fri Feb 03, 2012 10:45 pm    Post subject: Reply with quote

Try: #map run {location} {delay}

For example:

#map run {barber shop} {0.4}
Back to top
View user's profile Send private message Send e-mail
dalton



Joined: 26 Jan 2012
Posts: 30

PostPosted: Fri Feb 03, 2012 10:53 pm    Post subject: Reply with quote

yes,I already try #map run {} {delay}
but I need walk through every room looking for a task npc,which have a random name every task.
so I try do :
#loop 1 100 vnum
{
#map run {$vnum} {0.5};
}

then I got so many cmds input ...
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3281

PostPosted: Sat Feb 04, 2012 3:50 pm    Post subject: Reply with quote

Use #map set roomdata to mark each room as unvisited, then use #map find to visit the first vnum, then use #path walk to slow walk to that destination, marking each room visited as you go along with #event {ENTER ROOM} events, and using #event {END OF PATH} to look for the end of the path. When reaching your destination use a loop to find an unvisited room, with #map get roomdata, using #break to break out of the loop when you do.

It's somewhat involved but not undoable.
Back to top
View user's profile Send private message Send e-mail
dalton



Joined: 26 Jan 2012
Posts: 30

PostPosted: Sun Feb 05, 2012 7:50 am    Post subject: Reply with quote

hmm...Not clearly,still have many question
for example:
I need from Area_a to Area_b,and search a temp npc in Area_b,and I have the map of Aare_b. I can get path to Area_b,so walk to there easy . When i arrived ,
"When reaching your destination use a loop to find an unvisited room, with #map get roomdata, using #break to break out of the loop when you do."

How?
if i need looking for every room from the first room,how use loop cmd ,which mud i played will refuse exec when i send so many cmds.
If i want to search some room which have a known distance,like 2,how?
like this:
A--B--C--D
| |
E--F--G

I reach A ,and search from A ,want visit B/C/E/F ,how?
Back to top
View user's profile Send private message
dalton



Joined: 26 Jan 2012
Posts: 30

PostPosted: Sun Feb 05, 2012 1:18 pm    Post subject: Reply with quote

OK,I wrote something for walk through all room,like this:

Code:
#cl map open

#alias setarea {#var roomarea %1;#show {OK.Set roomarea to $roomarea}}
#alias startbianli {setunvisit;bianli}

#alias bianli
{
   search;
   #if {&vnum_list[]}
   {
      #event {END OF PATH} {#unti sbs;#map set roomdata {{visit}{1}};bianli};
      #map get roomname {name} {$vnum_list[1]};
      #map find {$name};
      #path save f way;
      slwalk;
   }
   {
      #map run 1;
      #sh {Map Overview,Not find} 1;
   };
}

#alias slwalk
{
   #ti sbs {#path walk f} 0.1;
}

#alias setunvisit
{
   #loop 2 71 vnum
   {
      #map set roomdata {{visit}{0}} {$vnum};
   }
}

#alias search
{
   #list vnum_list clr;
   #loop 1 71 vnum
   {
      #map get {roomdata} {vi} {$vnum};
      #if {$vi[visit] == 0}
      {
         #list vnum_list add $vnum;
      }
   }
}

#alias addroomnum
{
   #var room_names {};
   #loop 1 71 vnum
   {
      #map get roomname {name} {$vnum};
      #if {&room_names[$name] == 0}
      {
          #var room_names[$name] $vnum;
         #map set roomname {$name} {$vnum};
      }
      {
         #format name {%s%d} {$name} {$vnum};
         #var room_names[$name] $vnum;
         #map set roomname {$name} {$vnum};
      };
   };
}

#unac {^%* -%s$}
{
   #var roomname %1;
   #map name $roomname;
}

#cl map close


seems work,but i think maybe have better way. and still dont know how break my "bianli" alias when i find sb ,just #unti sbs ??
Back to top
View user's profile Send private message
dalton



Joined: 26 Jan 2012
Posts: 30

PostPosted: Thu Feb 09, 2012 6:34 am    Post subject: Reply with quote

Sad
Still have problem:
#loop ,use #loop +#path (or #map ) run {delay} ,with #map get for searching my temp task npc,use #break when #ac trigger ,but the result generaly is I got wrong room .
{#path run} or {#map run} cann't break a path,use {#ti slowwalk},so slow.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help 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