|
hykou Wanderer
Joined: 29 Apr 2004 Posts: 63 Location: USA
|
Posted: 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? |
|
|
|
Full Throttle Wanderer
Joined: 07 Dec 2004 Posts: 65
|
Posted: 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 |
|
|
|
hykou Wanderer
Joined: 29 Apr 2004 Posts: 63 Location: USA
|
Posted: 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 :/ |
|
|
|
hykou Wanderer
Joined: 29 Apr 2004 Posts: 63 Location: USA
|
Posted: 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? |
|
|
|
Rappy Wanderer
Joined: 15 Jul 2005 Posts: 96
|
Posted: Sun Jul 31, 2005 3:14 pm |
Code: |
#TRIGGER {(%*) is closed.$} {open %lastdir( );%lastdir()} |
-Rappy |
|
|
|
Full Throttle Wanderer
Joined: 07 Dec 2004 Posts: 65
|
Posted: 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} |
|
|
|
Rappy Wanderer
Joined: 15 Jul 2005 Posts: 96
|
Posted: 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 |
|
|
|
Ikyu Beginner
Joined: 27 Feb 2005 Posts: 24
|
Posted: 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. |
|
|
|
hykou Wanderer
Joined: 29 Apr 2004 Posts: 63 Location: USA
|
Posted: Mon Aug 01, 2005 4:27 am |
That one didnt work at first, but now after chaning settings and stuff it works fine. :/
|
|
|
|
|
|