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
Trouble with door script
Re: Trouble with door script
Are you using cMUD? This version is for zMUD and might have some complications when trying to direct swap it. I am currently in the process of updating all of my scripts from zMUD into cMUD, just going to take a while because cMUD is less forgiving on syntax than zMUD was and I'm still learning the subtle diffrences.
My cMUD Scripts
My zMUD Scripts
My cMUD Scripts
My zMUD Scripts
Re: Trouble with door script
I'm actually using zmud
Re: Trouble with door script
Kill all other scripts and just load this one. Make sure there isn't an override.
Also you may have to escape special characters. Or at least I have to for my specific setup.
#TRIGGER {The %w is open.}
to
#TRIGGER {The %w is open\.}
Also, why is it using %w and not %1?
I don't use cmud or zmud but these few things stand out to me.
Also you may have to escape special characters. Or at least I have to for my specific setup.
#TRIGGER {The %w is open.}
to
#TRIGGER {The %w is open\.}
Also, why is it using %w and not %1?
I don't use cmud or zmud but these few things stand out to me.
Re: Trouble with door script
Period isn't a special character used in pattern matching for zMUD, that looks like maybe regex you are thinking of. (also zMUD uses the ~ to escape out special characters)Quantalex wrote:Kill all other scripts and just load this one. Make sure there isn't an override.
Also you may have to escape special characters. Or at least I have to for my specific setup.
#TRIGGER {The %w is open.}
to
#TRIGGER {The %w is open\.}
Also, why is it using %w and not %1?
I don't use cmud or zmud but these few things stand out to me.
%w is for pattern matching a word: zMUD pattern matching
That all being said, Quantalex found the answer inadvertently. Somehow all the () around the %w are missing... need (%w) for zMUD to access the door name in the trigger via the %1 parameter. Don't know how I messed that up and posted wrong version or something... will update my Archives post.
Thanks for bringing this to my attention! Should work now: Doors
Re: Trouble with door script
Worked! Thanks!