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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
hykou
Wanderer


Joined: 29 Apr 2004
Posts: 63
Location: USA

PostPosted: Sat Jul 30, 2005 8:44 pm   

Why is it not working...?
 
Code:

#CLASS {doors}
#TRIGGER {The (*) is closed.} {
  #IF (%lastcom=s) {lastdir = south} {#if (%lastcom=n) {lastdir = north} {#if (%lastcom=e) {lastdir = east} {#if (%lastcom=w) {lastdir = west} {#if %lastcom=ne) {lastdir = northeast} {#if (%lastcom=nw) {lastdir = northwest} {#if (%lastcom=se) {lastdir = southeast} {#if (%lastcom=sw) {lastdir = southwest} {#if (%lastcom=d) {lastdir = down} {#if (%lastcom=u) {lastdir = up} {}}}}}}}}}} {}
  open @lastdir
  }
#TRIGGER {The drain cover is closed.} {
  #IF (%lastcom=s) {lastdir = south} {#if (%lastcom=n) {lastdir = north} {#if (%lastcom=e) {lastdir = east} {#if (%lastcom=w) {lastdir = west} {#if %lastcom=ne) {lastdir = northeast} {#if (%lastcom=nw) {lastdir = northwest} {#if (%lastcom=se) {lastdir = southeast} {#if (%lastcom=sw) {lastdir = southwest} {#if (%lastcom=d) {lastdir = down} {#if (%lastcom=u) {lastdir = up} {}}}}}}}}}} {}
  open @lastdir
  }
#CLASS 0


Now when I test it, it doesnt open the door... Heres what I get.
Quote:

(------------------------------------) W <---(M)---> E
- # -
south
The door is closed.
open

Open what?


What did I do wrong here?
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Sat Jul 30, 2005 10:39 pm   
 
Here is a similar script to auto-open doors.

#class {Doors}
#alias {n} {north;#variable direction north}
#alias {s} {south;#variable direction south}
#alias {w} {west;#variable direction west}
#alias {e} {east;#variable direction east}
#alias {u} {up;#variable direction up}
#alias {d} {down;#variable direction down}
#alias {nw} {northwest;#variable direction northwest}
#alias {ne} {northeast;#variable direction northeast}
#alias {sw} {southwest;#variable direction southwest}
#alias {se} {southeast;#variable direction southeast}
#trigger {^The (*) is closed.} {open %1 @direction}
#class 0
Reply with quote
hykou
Wanderer


Joined: 29 Apr 2004
Posts: 63
Location: USA

PostPosted: Sun Jul 31, 2005 4:19 am   
 
I tried that also and i get this...

Quote:

south
The door is closed.
open door


I'm using 7.13b :/
Reply with quote
hykou
Wanderer


Joined: 29 Apr 2004
Posts: 63
Location: USA

PostPosted: Sun Jul 31, 2005 2:26 pm   
 
Oops... My mud just need open <direction> took out the %1... But now it does this...

Quote:

south
The gate is closed.
open north


No matter what way I want to go, it tries to open <north>. Anyone have advice?
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Sun Jul 31, 2005 3:14 pm   
 
Code:
#TRIGGER {(%*) is closed.$} {open %lastdir( );%lastdir()}


-Rappy
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Sun Jul 31, 2005 3:21 pm   
 
I don't think the script was imported correctly.

Code:
#class {Doors}
#variable direction {0} {0}
#alias {n} {north
 #variable direction north}
#alias {s} {south
 #variable direction south}
#alias {w} {west
 #variable direction west}
#alias {e} {east
 #variable direction east}
#alias {u} {up
 #variable direction up}
#alias {d} {down
 #variable direction down}
#alias {nw} {northwest
 #variable direction northwest}
#alias {ne} {northeast
 #variable direction northeast}
#alias {sw} {southwest
 #variable direction southwest}
#alias {se} {southeast
 #variable direction southeast}
#trigger {^The * is closed.} {#if (@direction != 0) {open @direction}}
#class 0


Import:

1. save the new script to a file
2. delete the old script: #delclass {Doors}
3. import the new script: #menu {Settings|Import|Script}
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Sun Jul 31, 2005 3:28 pm   
 
You shouldn't have to set a #VARIABLE for anything zMUD automatically sets your last direction to %lastdir()

-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
Reply with quote
Ikyu
Beginner


Joined: 27 Feb 2005
Posts: 24

PostPosted: Sun Jul 31, 2005 5:34 pm   
 
Rappy wrote:
You shouldn't have to set a #VARIABLE for anything zMUD automatically sets your last direction to %lastdir()

-Rappy


I thought %lastdir() is only for the mapper.
and a #show %lastdir() didn't return anything for me.
Reply with quote
hykou
Wanderer


Joined: 29 Apr 2004
Posts: 63
Location: USA

PostPosted: Mon Aug 01, 2005 4:27 am   
 
That one didnt work at first, but now after chaning settings and stuff it works fine. :/
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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