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
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Sat Jul 30, 2005 12:17 am   

2 line trigger
 
Is it possible to only make a trigger fire of if two lines are recieved from the mud. The lines are identical.

The salve seeps into your skin and slowly heals you.
The salve seeps into your skin and slowly heals you.

Problem is I don't want it to fire off both times it shows up. Only once. Can any of you help?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Jul 30, 2005 1:18 am   
 
Multistate triggers!

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you. } {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you. } {Code Here}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Sat Jul 30, 2005 1:35 am   
 
So something like this?
Useing The salve seeps into your skin and slowly heals you as the pattern?

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you. } {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you. }
#if (@hps<=@hpsmax/2) {apply salve} {}
Reply with quote
shalimar
GURU


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

PostPosted: Sat Jul 30, 2005 1:51 am   
 
try

#TR {The salve seeps into your skin and slowly heals you.$The salve seeps into your skin and slowly heals you.} {dostuff}
_________________
Discord: Shalimarwildcat
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Sat Jul 30, 2005 2:14 am   
 
Neither one of those seems to work... Crying or Very sad
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jul 30, 2005 2:22 am   
 
Nexela's should work. And, is that a typo in the #COND command or were you really trying to put an #IF command outside of the code block for the #COND (obviously, a trigger wouldn't work in that case because zmud wouldn't recognize it as a trigger during execution--although that should almost certainly give you a nice red-colored syntax error message)?
_________________
EDIT: I didn't like my old signature
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Sat Jul 30, 2005 2:40 am   
 
MattLofton wrote:
Nexela's should work. And, is that a typo in the #COND command or were you really trying to put an #IF command outside of the code block for the #COND (obviously, a trigger wouldn't work in that case because zmud wouldn't recognize it as a trigger during execution--although that should almost certainly give you a nice red-colored syntax error message)?


I'm new to all this so I'm not sure I understand. I posted it exactly like I have it. I didn't recieve a syntax error. The trigger is still fireing but it does it at every "The salve seeps into your skin and slowly heals you." instead of just after both.

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you. } {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you.}
#if (@hps<=@hpsmax/10*8) {apply salve} {}

is what I've been useing to test. I'm not sure if its suppose to or not but the {#NOOP do nothing} appears as a new trigger I didn't make. Any ideas?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Jul 30, 2005 3:51 am   
 
You should enter this script into the command line (where you type mud commands) and hit enter.

The #IF outside of a trigger will only work the first time it is sent.

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you.} {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you.} {
#IF (@hps<=@hpsmax/10*8) {apply salve}
} {within|param=2}
_________________
Zmud Support Library
Zmud Knowledge Base

Last edited by nexela on Sun Jul 31, 2005 3:32 pm; edited 1 time in total
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Sat Jul 30, 2005 1:46 pm   
 
nexela wrote:
You should enter this script into the command line (where you type mud commands) and hit enter.

The #IF outside of a trigger will only work the first time it is sent.

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you. } {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you.} {
#IF (@hps<=@hpsmax/10*8) {apply salve}
}


Entering this into the command line doesn't seem to do anything. No new triggers are created that I can tell. Is it suppose to add something to the settings?
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sat Jul 30, 2005 3:18 pm   
 
Shalimar was on the right track just missed a step is all.

Code:
#TRIGGER
{The salve seeps into your skin and slowly heals you.$The salve seeps into your skin and slowly heals you.} {dostuff} "" {within|param=2}


the within|param=2 options are necessary.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jul 30, 2005 4:15 pm   
 
Quote:

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you. } {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you.}
#if (@hps<=@hpsmax/10*8) {apply salve} {}



This is what I meant. The bolded part is outside of the codeblock for the #COND command. It should have curly brackets surrounding the #IF command just like you have for the #NOOP part.
_________________
EDIT: I didn't like my old signature
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Sat Jul 30, 2005 7:35 pm   
 
#TRIGGER
{The salve seeps into your skin and slowly heals you.$The salve seeps into your skin and slowly heals you.} {dostuff} "" {within|param=2}

Throws me into a giant loop which displays just about ever setting I've created so far.

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you. } {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you.}
#if (@hps<=@hpsmax/10*8) {apply salve} {}

adding any { to the if command gives me syntax errors

Still no luck on this at all really. I don't know if the right code as already been said and I've done something wrong or what but it just doesn't seem like this one is gonna work anytime in the near future.
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Sat Jul 30, 2005 7:37 pm   
 
Code:

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you. } {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you.} {#if (@hps<=@hpsmax/10*8) {apply salve} {}} "" {within|param=2}
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Sun Jul 31, 2005 2:20 pm   
 
Aarlot wrote:
Code:

#TRIGGER "ms_salve" {^The salve seeps into your skin and slowly heals you. } {#NOOP do nothing}
#COND {^The salve seeps into your skin and slowly heals you.} {#if (@hps<=@hpsmax/10*8) {apply salve} {}} "" {within|param=2}


Hmm. I've got a lot to learn but very nice all the same. Replaceing "ms_salve" with The salve seeps into your skin and slowly heals you gets this thing to work pretty well.
It responds the first time it recieves the text then ignores it the second time which is close enough to what I wanted to do.

Unless someone sees something wrong with the following code I'm happy. Thanks everyone for helping me out with this.

Code:
#TRIGGER "The salve seeps into your skin and slowly heals you." {The salve seeps into your skin and slowly heals you.} {#NOOP do nothing}
#COND {The salve seeps into your skin and slowly heals you.} {#if (@hps<=@hpsmax10*8) {apply salve} {}} "" {within|param=2}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Jul 31, 2005 3:32 pm   
 
The first part is the name, if you will look closer at the pattern you will see that there is an extra space before the closing bracket. it has been fixed in my above post.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Mon Aug 01, 2005 11:31 pm   
 
Well no real complaints about the code but there seems to be a minor problem. The trigger never stops applying salve. any takers?
Code:
#Class automatedhealing
#TRIGGER "The salve seeps into your skin and slowly heals you." {The salve seeps into your skin and slowly heals you.} {#NOOP do nothing}
#COND {The salve seeps into your skin and slowly heals you.} {#if (@hps<=@hpsmax/10*8) {apply salve} {}} "" {within|param=2}
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Mon Aug 01, 2005 11:53 pm   
 
nm found the problem elsewhere.
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