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


Joined: 10 May 2007
Posts: 11

PostPosted: Tue Jan 07, 2020 12:34 am   

Room script help
 
I have a room script that works but I was looking for a way to expand it and got lost with the #if statements. Here is the script that works:

#TRIGGER {A green-leafed herb grows here.} {
#sub {A green-leafed bundle of five-finger herb grows here. (1 copper) %10}
#CW Springgreen
}

This script looks at the text in the room and works from that.

What I am looking to add is a way to tell me that if "A green-leafed herb grows here." is not written (which tells me that someone else already took it) the return text will not be "A green-leafed bundle of five-finger herb grows here. (1 copper)" but instead will be "Opps, looks like someone else beat you to this".

Thanks in advance for any help you can give me.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue Jan 07, 2020 4:16 am   
 
You can't really sub out what isn't there.
You might be able to rig something up with '#EVENT onRoomEnter {}' and a #WAITFOR with a timeout clause to #SAYADD the extra info.
_________________
Discord: Shalimarwildcat
Reply with quote
jallen0
Beginner


Joined: 10 May 2007
Posts: 11

PostPosted: Tue Jan 07, 2020 5:43 pm   
 
Ah, that's why I could not make it work. Let me look at your suggestions. Thanks.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue Jan 07, 2020 8:09 pm   
 
Those are CMUD suggestions, many of those features don't exist in zMUD.
_________________
Discord: Shalimarwildcat
Reply with quote
jallen0
Beginner


Joined: 10 May 2007
Posts: 11

PostPosted: Thu Jan 09, 2020 8:20 pm   
 
Well...that creates an issue then. Again it's a room script so I thought I could just compare what is there and if it is there I use the script in my initial thread. If the text is not there...well that's whee I got bogged down in looking at the #IF statements.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Fri Jan 10, 2020 1:31 am   
 
Yea, I'm tryingt to think of a way that would work in zMUD.

Room script is good. Add this to it and see if it works:

#TEMP "herbFinder" {A green-leafed herb grows here.} {}
#ALARM "herbCheck" +5 {#IF (%trigger(herbFinder) {#SAY {Opps, looks like someone else beat you to this.}}
_________________
Discord: Shalimarwildcat
Reply with quote
kumarip
Newbie


Joined: 05 Feb 2020
Posts: 1

PostPosted: Wed Feb 05, 2020 7:56 am   
 
Good information.
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