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


Joined: 16 Sep 2008
Posts: 17

PostPosted: Tue Sep 30, 2008 1:32 am   

string problem
 
Ok, so I'm working on building my herb, salve, and smoke queues. I've made a bunch of triggers and I have it to where they are supposed to add to a string table when the message comes up. However, the message is always firing and it's flooding my string tables, any idea what is wrong? Here is the coding:

#CLASS {diagnose}
#TRIGGER (pacified) {#addi afflicted pacifism} "" {notrig}
#TRIGGER (indifferent) {#addi safflicted indefference} "" {notrig}
#TRIGGER (being effused of phlegm) {#addi afflicted phlegm} "" {notrig}
#TRIGGER (anorexic) {#addi safflicted anorexia} "" {notrig}
#TRIGGER (confounded with blurry vision) {#addi safflicted bvison} "" {notrig}
#TRIGGER (engulf your body) {#addi safflicted aflame} "" {notrig}
#TRIGGER (confused) {#addi afflicted confusion} "" {notrig}
#TRIGGER (demented) {#addi afflicted dementia} "" {notrig}
#TRIGGER (hallucinating) {#addi afflicted hallucinations} "" {notrig}
#TRIGGER (paranoid) {#addi afflicted paranoia} "" {notrig}
#TRIGGER (feeling unnaturally tranquil) {#addi afflicted peace} "" {notrig}
#TRIGGER (paralysed) {#addi afflicted paralysis} "" {notrig}
#TRIGGER (allergic to sunlight) {#addi afflicted darkshade} "" {notrig}
#TRIGGER (violently ill) {#addi afflicted vomiting} "" {notrig}
#TRIGGER (overcome by dizziness) {#addi afflicted dizziness} "" {notrig}
#TRIGGER (suffering from epilepsy) {#addi afflicted epilepsy} "" {notrig}
#TRIGGER (impatient) {#addi afflicted impatience} "" {notrig}
#TRIGGER (unnaturally stupid) {#addi afflicted stupidity} "" {notrig}
#TRIGGER (afflicted by horrible asthma) {#addi afflicted asthma} "" {notrig}
#TRIGGER (afflicted with clumsiness) {#addi afflicted clumsiness} "" {notrig}
#TRIGGER (full of limp veins) {#addi afflicted limpv} "" {notrig}
#TRIGGER (sensitive to pain) {#addi afflicted sensitivity} "" {notrig}
#TRIGGER (wearied in body) {#addi afflicted weariness} "" {notrig}
#TRIGGER (agoraphobic) {#addi afflicted agoraphobia} "" {notrig}
#TRIGGER (frothing at the mouth) {#addi afflicted berserk} "" {notrig}
#TRIGGER (masochisti) {#addi afflicted masochism} "" {notrig}
#TRIGGER (reckless) {#addi afflicted recklessness} "" {notrig}
#TRIGGER (afraid of heights) {#addi afflicted vertigo} "" {notrig}
#TRIGGER (afflicted with the mind power of an idiot) {#addi afflicted idiocty} "" {notrig}
#TRIGGER (plodding with slow movement) {#addi afflicted plodding} "" {notrig}
#TRIGGER (afflicted by thin blood) {#addi afflicted scytherus} "" {notrig}
#TRIGGER (catching glimpses of Hell) {#addi smafflicted hellsight} "" {notrig}
#TRIGGER (extremely oily) {#addi smafflicted slickness} "" {notrig}
#TRIGGER (inspiring disloyalty in those nearby) {#addi afflicted disfigurement} "" {notrig}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Sep 30, 2008 2:18 am   
 
My guess is that you need to replace all the parentheses (( and )) with curly brackets ({ and }).

Parentheses in a #TRIGGER = Expression trigger = in ZMud they ALL get evaluated every time any variable gets changed. As each set of parentheses has plain text in them, and since all plain-text characters have an ascii value greater than 0 and since 0 or "" = False in ZMud they would evaluate to true and fire, and therein set a variable to start the whole process over again.
_________________
EDIT: I didn't like my old signature
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Sep 30, 2008 2:33 am   
 
Yeah. Matt has the right of it. 20 seconds to type in a few things with CMud's subregex and here you go. I also corrected the typo "safflicted", and added a #CLASS 0 to the end. I put a #DELCLASS on there so it gets rid of all the old triggers first.
Code:
#DELCLASS diagnose
#CLASS {diagnose}
#TRIGGER {pacified} {#addi afflicted pacifism} "" {notrig}
#TRIGGER {indifferent} {#addi afflicted indefference} "" {notrig}
#TRIGGER {being effused of phlegm} {#addi afflicted phlegm} "" {notrig}
#TRIGGER {anorexic} {#addi afflicted anorexia} "" {notrig}
#TRIGGER {confounded with blurry vision} {#addi afflicted bvison} "" {notrig}
#TRIGGER {engulf your body} {#addi afflicted aflame} "" {notrig}
#TRIGGER {confused} {#addi afflicted confusion} "" {notrig}
#TRIGGER {demented} {#addi afflicted dementia} "" {notrig}
#TRIGGER {hallucinating} {#addi afflicted hallucinations} "" {notrig}
#TRIGGER {paranoid} {#addi afflicted paranoia} "" {notrig}
#TRIGGER {feeling unnaturally tranquil} {#addi afflicted peace} "" {notrig}
#TRIGGER {paralysed} {#addi afflicted paralysis} "" {notrig}
#TRIGGER {allergic to sunlight} {#addi afflicted darkshade} "" {notrig}
#TRIGGER {violently ill} {#addi afflicted vomiting} "" {notrig}
#TRIGGER {overcome by dizziness} {#addi afflicted dizziness} "" {notrig}
#TRIGGER {suffering from epilepsy} {#addi afflicted epilepsy} "" {notrig}
#TRIGGER {impatient} {#addi afflicted impatience} "" {notrig}
#TRIGGER {unnaturally stupid} {#addi afflicted stupidity} "" {notrig}
#TRIGGER {afflicted by horrible asthma} {#addi afflicted asthma} "" {notrig}
#TRIGGER {afflicted with clumsiness} {#addi afflicted clumsiness} "" {notrig}
#TRIGGER {full of limp veins} {#addi afflicted limpv} "" {notrig}
#TRIGGER {sensitive to pain} {#addi afflicted sensitivity} "" {notrig}
#TRIGGER {wearied in body} {#addi afflicted weariness} "" {notrig}
#TRIGGER {agoraphobic} {#addi afflicted agoraphobia} "" {notrig}
#TRIGGER {frothing at the mouth} {#addi afflicted berserk} "" {notrig}
#TRIGGER {masochisti} {#addi afflicted masochism} "" {notrig}
#TRIGGER {reckless} {#addi afflicted recklessness} "" {notrig}
#TRIGGER {afraid of heights} {#addi afflicted vertigo} "" {notrig}
#TRIGGER {afflicted with the mind power of an idiot} {#addi afflicted idiocty} "" {notrig}
#TRIGGER {plodding with slow movement} {#addi afflicted plodding} "" {notrig}
#TRIGGER {afflicted by thin blood} {#addi afflicted scytherus} "" {notrig}
#TRIGGER {catching glimpses of Hell} {#addi smafflicted hellsight} "" {notrig}
#TRIGGER {extremely oily} {#addi smafflicted slickness} "" {notrig}
#TRIGGER {inspiring disloyalty in those nearby} {#addi afflicted disfigurement} "" {notrig}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Sep 30, 2008 2:52 am   
 
The only problem is that since they are in no way anchored, the triggers will fire whenever someone uses the words in general chat. While "You are pacified." will fire, so will "Charneus gossips 'what's the meaning of pacified?'" It's best to make the triggers as exact as possible to prevent such instances. Just my two cents.

Charneus
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Tue Sep 30, 2008 5:33 pm   
 
I'll have to agree with Charn on that, and if possible use the ^ character to denote only to fire on a newline.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
kazu
Beginner


Joined: 16 Sep 2008
Posts: 17

PostPosted: Tue Sep 30, 2008 7:34 pm   thanks
 
Thanks for all the help guys, also the safflicted wasn't a typo, that's for a salve queue, safflicted=salve afflicted Also, how do I add the ^ to help anchor them? The reason they are partial like that is because they work off a skill in the mudd that only spits out partial lines for each different affliction like that.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Sep 30, 2008 7:55 pm   
 
Give a few examples of lines the MUD spits out regarding your triggers and someone, if not me, will probably write a better trigger for it. We need all the examples it can spit out, if possible.

Charneus
Reply with quote
kazu
Beginner


Joined: 16 Sep 2008
Posts: 17

PostPosted: Tue Sep 30, 2008 7:58 pm   
 
Those lines I gave you are the exact ones. It's not a full affliction line, there are plenty of those. This is working off a skill called diagnose that gives me an exact phrase about what I have. Here's an example of an affliction stupidity line:

%w uses his mind to cast a net of stupidity over your own.

If I were to use diagnose, I would always see:

unnaturally stupid
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Sep 30, 2008 8:29 pm   
 
Code:
#DELCLASS {diagnose}
#CLASS {diagnose}
#TRIGGER {^pacified$} {#addi afflicted pacifism} "" {notrig|case}
#TRIGGER {^indifferent$} {#addi safflicted indefference} "" {notrig|case}
#TRIGGER {^being effused of phlegm$} {#addi afflicted phlegm} "" {notrig|case}
#TRIGGER {^anorexic$} {#addi safflicted anorexia} "" {notrig|case}
#TRIGGER {^confounded with blurry vision$} {#addi safflicted bvison} "" {notrig|case}
#TRIGGER {^engulf your body$} {#addi safflicted aflame} "" {notrig|case}
#TRIGGER {^confused$} {#addi afflicted confusion} "" {notrig|case}
#TRIGGER {^demented$} {#addi afflicted dementia} "" {notrig|case}
#TRIGGER {^hallucinating$} {#addi afflicted hallucinations} "" {notrig|case}
#TRIGGER {^paranoid$} {#addi afflicted paranoia} "" {notrig|case}
#TRIGGER {^feeling unnaturally tranquil$} {#addi afflicted peace} "" {notrig|case}
#TRIGGER {^paralysed$} {#addi afflicted paralysis} "" {notrig|case}
#TRIGGER {^allergic to sunlight$} {#addi afflicted darkshade} "" {notrig|case}
#TRIGGER {^violently ill$} {#addi afflicted vomiting} "" {notrig|case}
#TRIGGER {^overcome by dizziness$} {#addi afflicted dizziness} "" {notrig|case}
#TRIGGER {^suffering from epilepsy$} {#addi afflicted epilepsy} "" {notrig|case}
#TRIGGER {^impatient$} {#addi afflicted impatience} "" {notrig|case}
#TRIGGER {^unnaturally stupid$} {#addi afflicted stupidity} "" {notrig|case}
#TRIGGER {^afflicted by horrible asthma$} {#addi afflicted asthma} "" {notrig|case}
#TRIGGER {^afflicted with clumsiness$} {#addi afflicted clumsiness} "" {notrig|case}
#TRIGGER {^full of limp veins$} {#addi afflicted limpv} "" {notrig|case}
#TRIGGER {^sensitive to pain$} {#addi afflicted sensitivity} "" {notrig|case}
#TRIGGER {^wearied in body$} {#addi afflicted weariness} "" {notrig|case}
#TRIGGER {^agoraphobic$} {#addi afflicted agoraphobia} "" {notrig|case}
#TRIGGER {^frothing at the mouth$} {#addi afflicted berserk} "" {notrig|case}
#TRIGGER {^masochisti$} {#addi afflicted masochism} "" {notrig|case}
#TRIGGER {^reckless$} {#addi afflicted recklessness} "" {notrig|case}
#TRIGGER {^afraid of heights$} {#addi afflicted vertigo} "" {notrig|case}
#TRIGGER {^afflicted with the mind power of an idiot$} {#addi afflicted idiocty} "" {notrig|case}
#TRIGGER {^plodding with slow movement$} {#addi afflicted plodding} "" {notrig|case}
#TRIGGER {^afflicted by thin blood$} {#addi afflicted scytherus} "" {notrig|case}
#TRIGGER {^catching glimpses of Hell$} {#addi smafflicted hellsight} "" {notrig|case}
#TRIGGER {^extremely oily$} {#addi smafflicted slickness} "" {notrig|case}
#TRIGGER {^inspiring disloyalty in those nearby$} {#addi afflicted disfigurement} "" {notrig|case}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Tue Sep 30, 2008 11:16 pm   
 
kazu wrote:

This is working off a skill called diagnose that gives me an exact phrase about what I have.


I don't see a trigger to turn it off after the output from the command is done. Do you handle that and the activation externally?

Some typos remain ("idiocty", "indefference"). They're not part of the input so as long as they're consistently misspelt where they're used elsewhere everything will be fine.

-Tarn
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Wed Oct 01, 2008 1:00 pm   
 
Also you could put diagnose into an alias form that turns on the diagnose class and then add a trigger for the end of diagnose that turns the class back off. That way these trigs will only fire when you diagnose yourself.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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