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

A good way to deal with cases of triggered blockage in #map

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Finished Scripts
View previous topic :: View next topic  
Author Message
dawang10



Joined: 14 Feb 2015
Posts: 66

PostPosted: Sun Mar 19, 2017 8:50 am    Post subject: A good way to deal with cases of triggered blockage in #map Reply with quote

#nop to get a path
#map find {}

#nop save path to a variable
#path save forward {aa}

#nop $aa acts same as #map run and #path run, worth mentioning that any direction in $aa could contain some commands you inserted, e.g. open door etc don't have to insert them again. BUT we don't know which room we are in once blocked

#nop this will act same as #map run. the advantage is that the step number is recorded.
#list aa create aa
#list aa {size} {bb};#var step 0;#loop {1} {$bb} {num} {#math step $step+1;$aa[$num]}

recording the number blocked steps, then #list {$bb-$blockedsteps} {$bb} {num} {#math step $step+1;$aa[$num]}
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3758

PostPosted: Sun Mar 19, 2017 9:53 pm    Post subject: Reply with quote

Also possible to do it as a while.
Code:

#while {&aa[]}
{
    $aa[+1];
    #unvar aa[+1]
}


If you want to walk backwards use -1 instead of +1. You'd of course have to code a pause if the path is blocked.
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 -> Finished Scripts 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