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
daftshiva
Beginner


Joined: 09 Jul 2002
Posts: 11
Location: United Kingdom

PostPosted: Thu Jun 16, 2005 9:23 am   

Door variables
 
Hi and thanks for any help before I get going.

I sometimes use a macro that allows me to hit CTRL+numpad or ALT+numpad to open or close doors in a certain direction.


At the moment I use this :

ALT+KEY1

open %doorname ( ,d)

And CTRL+KEY1

close %doorname ( ,d)

The problem I have is that it uses %doorname as a variable (I think). This works fine on doors that have a different name to just plain 'door', as I assume it takes it from the room properties.

If there's a default doorname then nothing is actually entered in room properties, as I have 'door' set to default value.

This results in no value being retrieved when I try to open a door that I haven't actually manually entere the name of.

The map is big, and this would take me days to go around every default door and enter the value 'door', so is there any way to capture this?

Not sure how much sense I made there, but hope someone can understand what I'm trying to get done, and once again thanks for any help :)
Reply with quote
malikai3k
Beginner


Joined: 24 Dec 2004
Posts: 14
Location: Brisbane, Australia

PostPosted: Thu Jun 16, 2005 11:14 am   
 
i'd use an if to check if %doorname is nul

if it is set a var to 'door'

if it's not null set the var %doorname

then open or close that var.

make sense?
Reply with quote
daftshiva
Beginner


Joined: 09 Jul 2002
Posts: 11
Location: United Kingdom

PostPosted: Thu Jun 16, 2005 3:39 pm   
 
i'm a total newbie in regards to zmud scripting, so please correct me if i'm wrong

would this work?

If %doorname = nul
then %doorname = $door
open %doorname

I told you I was a newbie ;-)
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Thu Jun 16, 2005 10:22 pm   
 
#KEY ALT-KEY1 {#IF (%doorname(,d) = "") {this_door = door} {this_door = %doorname};open @this_door}
#KEY CTRL-KEY1 {#IF (%doorname(,d) = "") {this_door = door} {this_door = %doorname};close @this_door}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Jun 16, 2005 11:36 pm   
 
This should work without thee need for a variable

#KEY ALT-KEY1 {#IF (%null(%doorname(,d))) {open door} {open %doorname(,d)}}
#KEY CTRL-KEY1 {#IF (%null(%doorname(,d))) {close door} {close %doorname(,d)}}


Or alternativly strip the first group of {}'s to get the value if using the settings editor instead of command line creation
#IF (%null(%doorname(,d))) {open door} {open %doorname(,d)}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Fri Jun 17, 2005 5:16 am   
 
i only use the variable caase i ran into a situation of getting trapped in a room while fighting once, so i store door names for use with a flee script, just some future thinking.
Reply with quote
malikai3k
Beginner


Joined: 24 Dec 2004
Posts: 14
Location: Brisbane, Australia

PostPosted: Fri Jun 17, 2005 7:57 am   
 
nexela for the win
Reply with quote
daftshiva
Beginner


Joined: 09 Jul 2002
Posts: 11
Location: United Kingdom

PostPosted: Fri Jun 17, 2005 6:20 pm   
 
Wow, thanks all. :)
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