Trouble with door script
Posted: Thu Aug 24, 2017 12:41 pm
I'm just trying to use one of the door scripts already lying around the forums, but part of it isn't working for some reason. The part that isn't working is where it detects the door I'm trying to use, and then saves it for use with the script. The commands that are linked to the map "cd w" for example work just fine. It looks like the script isn't grabbing the variable for the door and putting it into @doorName.
* R HP:Healthy SP:Bursting MV:Fresh > look w
The damodreddoor is open.
doorName is now set as:
* R HP:Healthy SP:Bursting MV:Fresh > open
Open what?
* R HP:Healthy SP:Bursting MV:Fresh > close
Close what?
#CLASS {Doors}
#ALIAS helpDoors {
#SHOW {""}
#SHOW {""}
#SAY {" -----Doors Help File-----"}
#SHOW {""}
#SHOW {" @doorName variable is automatically filled with trigger events."}
#SHOW {""}
#SHOW {" Type <command> to complete action."}
#SHOW {" Example: type od to open @doorName."}
#SHOW {""}
#SHOW {" Type <command> <direction> to complete action in that direction."}
#SHOW {" Note: Map must be set to current location and door name saved in map properties."}
#SHOW {" Example: Type od n to open the door saved in map properties north of current location."}
#SHOW {""}
#SHOW {" Recognized directions: n e s w u d"}
#SHOW {" Note: anything not a recognized direction will be ignored and @doorName variable used."}
#SHOW {""}
#SHOW {" Type cd to close door."}
#SHOW {" Type kd to knock door."}
#SHOW {" Type ld to lock door."}
#SHOW {" Type od to open door."}
#SHOW {" Type pd to pick door."}
#SHOW {" Type ud to unlock door."}
#SHOW {""}
}
#ALIAS cd {#IF (%ismember(%1,@doorDirections)) {close %doorname( ,%1)} {close @doorName}}
#ALIAS kd {#IF (%ismember(%1,@doorDirections)) {knock %doorname( ,%1)} {knock @doorName}}
#ALIAS ld {#IF (%ismember(%1,@doorDirections)) {lock %doorname( ,%1)} {lock @doorName}}
#ALIAS od {#IF (%ismember(%1,@doorDirections)) {open %doorname( ,%1)} {open @doorName}}
#ALIAS pd {#IF (%ismember(%1,@doorDirections)) {pick %doorname( ,%1)} {pick @doorName}}
#ALIAS ud {#IF (%ismember(%1,@doorDirections)) {unlock %doorname( ,%1)} {unlock @doorName}}
#VAR doorName {}
#VAR doorDirections {n|e|s|w|u|d} {n|e|s|w|u|d}
#TRIGGER {The %w seems to be closed.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {You skillfully discover a hidden %w.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {The %w is closed.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {The %w is open.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {The %w is obviously open.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {The %w is quite visible.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#CLASS 0
* R HP:Healthy SP:Bursting MV:Fresh > look w
The damodreddoor is open.
doorName is now set as:
* R HP:Healthy SP:Bursting MV:Fresh > open
Open what?
* R HP:Healthy SP:Bursting MV:Fresh > close
Close what?
#CLASS {Doors}
#ALIAS helpDoors {
#SHOW {""}
#SHOW {""}
#SAY {" -----Doors Help File-----"}
#SHOW {""}
#SHOW {" @doorName variable is automatically filled with trigger events."}
#SHOW {""}
#SHOW {" Type <command> to complete action."}
#SHOW {" Example: type od to open @doorName."}
#SHOW {""}
#SHOW {" Type <command> <direction> to complete action in that direction."}
#SHOW {" Note: Map must be set to current location and door name saved in map properties."}
#SHOW {" Example: Type od n to open the door saved in map properties north of current location."}
#SHOW {""}
#SHOW {" Recognized directions: n e s w u d"}
#SHOW {" Note: anything not a recognized direction will be ignored and @doorName variable used."}
#SHOW {""}
#SHOW {" Type cd to close door."}
#SHOW {" Type kd to knock door."}
#SHOW {" Type ld to lock door."}
#SHOW {" Type od to open door."}
#SHOW {" Type pd to pick door."}
#SHOW {" Type ud to unlock door."}
#SHOW {""}
}
#ALIAS cd {#IF (%ismember(%1,@doorDirections)) {close %doorname( ,%1)} {close @doorName}}
#ALIAS kd {#IF (%ismember(%1,@doorDirections)) {knock %doorname( ,%1)} {knock @doorName}}
#ALIAS ld {#IF (%ismember(%1,@doorDirections)) {lock %doorname( ,%1)} {lock @doorName}}
#ALIAS od {#IF (%ismember(%1,@doorDirections)) {open %doorname( ,%1)} {open @doorName}}
#ALIAS pd {#IF (%ismember(%1,@doorDirections)) {pick %doorname( ,%1)} {pick @doorName}}
#ALIAS ud {#IF (%ismember(%1,@doorDirections)) {unlock %doorname( ,%1)} {unlock @doorName}}
#VAR doorName {}
#VAR doorDirections {n|e|s|w|u|d} {n|e|s|w|u|d}
#TRIGGER {The %w seems to be closed.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {You skillfully discover a hidden %w.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {The %w is closed.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {The %w is open.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {The %w is obviously open.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#TRIGGER {The %w is quite visible.} {
#VAR doorName {%1}
#SAY {doorName is now set as: %1}
} "" {case}
#CLASS 0