Curtains & Auto-doors

For builders to discuss and ask building questions.
Post Reply
Arnof
Sword Journeyman
Sword Journeyman
Posts: 129
Joined: Wed Oct 22, 2008 8:47 pm
Location: Arizona, USA
Contact:

Curtains & Auto-doors

Post by Arnof » Wed Jan 24, 2018 5:47 am

So, I've got something I'm curious about. Since coming back I've come across a bunch of doors that auto open/close when you head that direction. They're closed doors before hand. I'm just wondering how this is accomplished. I've referenced these two threads but would still appreciate some clarification. One and two.

Code: Select all

>intercept_prog east~
if inroom($n) == QQ02
	mpecho {60}A set of {30}w{B0}i{30}n{B0}d {30}b{B0}e{30}a{B0}t{30}e{B0}n{60} curtains pull aside as you enter.
	mpat QQ04 {60}A set of {30}w{B0}i{30}n{B0}d {30}b{B0}e{30}a{B0}t{30}e{B0}n{60} curtains pull aside as someone enters.
	open east
	mpunintercept
	close east
else
	if inroom($n) == QQ12
	mpecho {60}A set of {30}w{B0}i{30}n{B0}d {30}b{B0}e{30}a{B0}t{30}e{B0}n{60} curtains pull aside as you enter.
	mpat QQ13 {60}A set of {30}w{B0}i{30}n{B0}d {30}b{B0}e{30}a{B0}t{30}e{B0}n{60} curtains pull aside as someone enters.
	open east
	mpunintercept
	close east
else
	if inroom($n) == QQ31
	mpecho {60}A set of {30}w{B0}i{30}n{B0}d {30}b{B0}e{30}a{B0}t{30}e{B0}n{60} curtains pull aside as you enter.
	mpat QQ32 {60}A set of {30}w{B0}i{30}n{B0}d {30}b{B0}e{30}a{B0}t{30}e{B0}n{60} curtains pull aside as someone enters.
	open east
	mpunintercept
	close east
else
	mpunintercept
endif
endif
endif
Am I on the right track there?

Thanks,
B
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: Curtains & Auto-doors

Post by Harroghty » Wed Jan 24, 2018 2:43 pm

Yes, you're on the right track.

I use an invisible mobile with corresponding intercept and greet programs to run these doors. The mobile needs to be inside and outside of all affected doors and have the corresponding programs (e.g. intercept_prog east, intercept_prog west, etc..) and if room checks for the greet.

Code: Select all

>intercept_prog south
if inroom($n) == 1234
  mpquiet on
  open south
  mpunintercept
else
  mpunintercept
endif
~

Code: Select all

>greet_prog 100
if isimmort($n)
else
  if inroom($n) == 1235
    mpat 1234 close south
  else
     if inroom($n) == 1234
       mpat 1235 close north
     endif
  endif
endif
~
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Post Reply