Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
Santel
Novice


Joined: 07 Feb 2003
Posts: 32

PostPosted: Sun Feb 09, 2003 3:39 pm   

RoD Add doors to mapper
 
RoD Exits description: Exits: [north] east [south] west
Where [] are doors

#var doordir ""
#var exitstring ""
#VAR exitstring %replace( "%1", "[", "/")
#VAR exitstring %replace( @exitstring, " ", "|")
#var i 1
#FORALL @exitstring {#add i 1}
#delnitem exitstring @i
#forall @exitstring {#if (%pos( "/", %i)>0) {} {#delitem exitstring %i}}
#var doordir %replace( @exitstring, "/", "")
#var doordir %replace( @doordir, "]", "")
#var doordir %replace( @doordir, "north", "n")
#var doordir %replace( @doordir, "south", "s")
#var doordir %replace( @doordir, "east", "e")
#var doordir %replace( @doordir, "west", "w")
#var doordir %replace( @doordir, "northwest", "nw")
#var doordir %replace( @doordir, "northeast", "ne")
#var doordir %replace( @doordir, "southwest", "sw")
#var doordir %replace( @doordir, "southeast", "se")
#if (@doordir = "") {} {#alarm {+0.5} {#forall @doordir {#door %i}}}

The last line with the #alarm code is needed due to the fact that zmud moves a lot faster than the mapper. With no alarm code you would get doors from the room you are entering into the room from where you left. You might have to adjust the time but 0.5sec is good for me.

Santel
Realms of Despair
Reply with quote
Petrograd
Novice


Joined: 08 Dec 2005
Posts: 35
Location: Sweden

PostPosted: Fri Dec 23, 2005 10:16 am   
 
It's quite useful... even better if you have the TRIGGER needed to get this whole thing to start at all :P

#tr {Exits: (*)} {
#var doordir ""
#var exitstring ""
#VAR exitstring %replace( "%1", "[", "/")
#VAR exitstring %replace( @exitstring, " ", "|")
#var i 1
#FORALL @exitstring {#add i 1}
#delnitem exitstring @i
#forall @exitstring {#if (%pos( "/", %i)>0) {} {#delitem exitstring %i}}
#var doordir %replace( @exitstring, "/", "")
#var doordir %replace( @doordir, "]", "")
#var doordir %replace( @doordir, "north", "n")
#var doordir %replace( @doordir, "south", "s")
#var doordir %replace( @doordir, "east", "e")
#var doordir %replace( @doordir, "west", "w")
#var doordir %replace( @doordir, "northwest", "nw")
#var doordir %replace( @doordir, "northeast", "ne")
#var doordir %replace( @doordir, "southwest", "sw")
#var doordir %replace( @doordir, "southeast", "se")
#if (@doordir = "") {} {#alarm {+0.5} {#forall @doordir {#door %i}}} }
should do it
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net