About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
Rose
Beginner


Joined: 23 Oct 2003
Posts: 15

PostPosted: Sun Nov 30, 2003 2:43 pm   

Room Scripting Help
 
Hi all,

I wish to make my Room Scripting as smart as possible and I have the following ideas, but am having problems implementing it properly:-

For example, upon entering the room, I want to "pull level".
I can do this by scripting the room as #NOOP %roomcom(,#alias rm {pull level}), and just type rm to execute it when I am in the room.
However, to improve it even further (since I need to do this for many rooms), I wish to use a Variable, say @bAuto.
So I want my room script to be this
#IF (@bAuto=1) {pull level}

Since I need to do this for MANY rooms when mapping, I wish to setup an ALIAS to set the room script. For example, #ALIAS setrm {#IF (@bAuto=1) {%-1}}
So, I can just enter into the command prompt "setrm pull level" when I map each room (without having to open the room properties and enter the script for each room as the scripts are different for each room).

The problem I ran into is that the script always get saved as
#IF (1=1) {{pull level}}, as the @bAuto is automatically evaluated. Is there anyway to overcome this problem and do what I want to achieve?

Thanks in advance.
Reply with quote
Rose
Beginner


Joined: 23 Oct 2003
Posts: 15

PostPosted: Wed Dec 03, 2003 1:46 am   
 
Seeing no response to this, perhaps I should simplify my question.

How do I create an ALIAS with VARIABLE in it?
#VAR @bAuto 1
I have tried with #ALIAS setrm {#IF (@bAuto=1) {%-1}}
When I type "setrm pull level"
I get the result #IF (1=1) {pull level} where the @bAuto has been evaluated, what I really want is #IF (@bAuto=1) {pull level}, as I want to save the result as Room Script and @bAuto may have a different value at different time.

Is there a way?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Dec 03, 2003 2:46 am   
 
You original question was unclear. I happened to initially read right after getting up and din't have time to try and fathom what you want to do before going to work.

Sounds like you settled on an alias that will always be available that will insert the room script for you. That would be this...
#ALIAS setrm {#NOOP %roomcom(,%concat("#IF (@bAuto=1) {", %-1, "}"))}

If I have misinterpretted what you want to do then you should be able to adapt it to what you want, or you can be more specific. Just remember quotes are your friends.
Reply with quote
Rose
Beginner


Joined: 23 Oct 2003
Posts: 15

PostPosted: Wed Dec 03, 2003 10:49 am   
 
That's exactly what I want.

Works like a charm now, and thanks!
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