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 Goto page 1, 2  Next
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Tue Aug 06, 2002 5:37 pm   

Anti-trigger afflictions.
 
I have been stumped by the following affliction so many times now, its getting me down. So, I am bringing it before you Guru's to see if you can help.

The actual line trigger is:

A prickly stinging overwhelms your body.

However, due to the type of affliction it is, there is built in anti-trigger that prevents it from working, as follows:

A pr*ckly stinging *verwhelms you* body

The * is random each time and there are simply too many variations to list them all as triggers.

Is there any way to get the program to recognise the line, even with the *'s?

I'd appreciate any help you could give :) Thanks.
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Tue Aug 06, 2002 5:39 pm   
 
Erm.. its seems that the forum has decided that my trigger line contained a rude word and ***'d it. I hope you know what I meant. :)
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Aug 06, 2002 7:03 pm   
 
Yes, this has been brought up in the past before. However, in this case the MUD works for us by using asterisks as the masking character because you can do this:
#TRIGGER {(*)} {#IF (%1 =~ "A pr ickly stinging overwhelms your body.") {cure affliction}}

However, I'm not sure why that wasn't the solution suggested before so here is the same solution that was given to the other person that asked this (I'm sure that there was another line that always got displayed before the one you presented, but I can't remember it now, so I'm making one up):
#TRIGGER {%w gives you an affliction.$(*)} {#VAR affline "A pr ickly stinging overwhelms your body.";#VAR affliction "%1";#WHILE (%pos("*", @affliction)) {#VAR affline {%delete(@affline, %pos("*", @affliction), 1)};#VAR affliction {%delete(@affliction, %pos("*", @affliction), 1)}};#IF (@affliction = @affline) {cure affliction}}

Note: A put a space in there to stop the forum from thinking I used a rude word but you get what I mean.

Kjata
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Aug 06, 2002 10:42 pm   
 
Kjata's is mostly right, a wildcard pattern of %* however is required to match and capture *'s in the line from the mud.

#TRIGGER {%w gives you an affliction.$(%*)} {#VAR affline "A pr ickly stinging overwhelms your body.";#VAR affliction "%1";#WHILE (%pos("*", @affliction)) {#VAR affline {%delete(@affline, %pos("*", @affliction), 1)};#VAR affliction {%delete(@affliction, %pos("*", @affliction), 1)}};#IF (@affliction = @affline) {cure affliction}}

Alternately you can put many afflictions into one trigger.
#VAR AffLines {A rickly stinging overwhelms your body.|Venom sears through you blood.|You are blind.}
#VAR Cures {quaff 'cure poison'|quaff 'cure poison'|eat mushroom}
#TRIGGER {%w gives you an affliction.$(%*)} {#VAR AffLine 1;#WHILE (@AffLine<=%numitems(@AffLines)) {#IF (%item(@AffLines,@AffLine) =~ "%1") {#MATH AffLine {@AffLine+(2*%numitems(@AffLines))}} {#ADD AffLine 1}};#MATH AffLine {@AffLine-2*(%numitems(@AFFLines)};#IF (@AffLine>0) {#EXEC {%item(@Cures,@AffLine)}}}
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Tue Aug 06, 2002 11:42 pm   
 
Thank you both! I will try it and let you know.

Is it possible for me to make the Trigger and Variable the same?

The reason I ask, is that I get the affliction from being hit by a sword and there are variations to being hit(slash, jab etc). The first time I know that I have the affliction is when the 'sensation' line appears as above.
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Wed Aug 07, 2002 7:09 am   
 
Ok.. tried and tried, but I cant seem to get it to work. There are 3 main problems.

1) The initial "%w gives you an affliction." trigger doesnt help me. In my case I tried "%w jabs you with a shining steel longsword.", but there are too many combinations of weapons and types of hit to create lots of triggers.
Whatever the weapon and hit.. Its the "A pr ickly stinging overwhelms your body" line that I need to trigger. That essentially is my problem, the line itself is already filled with *'s.

What I see on the from the MUD is as follows:
(Player) jabs you with a shining steel longsword.
A *rickly stinging overwhelms your bo*y

If its not possible to execute the cure directly from the affliction line, then I will simply have to make triggers for all the possibilities of weapons and hit types.

2) Your line {%w gives you an affliction.$(%*)} is causing problems. When I import the text into my trigger list, the $(%*) in the trigger/pattern line doesnt make the pattern match to the text from the MUD. This may be my error, see below.

3) I am a newb to programming zMUD, so please bear with me. I am certain that this it is something I am doing wrong.

I apologise for the hassle.. but I do appreciate your time and effort.. thanks.
Reply with quote
GiriFox
Wanderer


Joined: 25 Sep 2001
Posts: 59
Location: Australia

PostPosted: Wed Aug 07, 2002 9:24 am   
 
Use something like this in your pattern.

{A|*}{ |*}{p|*}{r|*}{i|*}{c|*}{k|*}{l|*}{y|*}{ |*}{s|*}{t|*}{i|*}{n|*}{g|*}{i|*}{n|*}{g|*}{ |*}{o|*}
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Wed Aug 07, 2002 10:03 am   
 
quote:

Use something like this in your pattern.

{A|*}{ |*}{p|*}{r|*}{i|*}{c|*}{k|*}{l|*}{y|*}{ |*}{s|*}{t|*}{i|*}{n|*}{g|*}{i|*}{n|*}{g|*}{ |*}{o|*}




That worked perfectly! Thank you very much :P
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Thu Aug 08, 2002 6:41 am   
 
It has worked well, and it has helped a lot, but I have a new issue now :P

The problem is that whenever I now go into a shop.. there are lines of "*******************************"'s

This now triggers me to cure and is wasting my herbs.

Is there anyway to make it ignore a line of *'s but but not the affliction?

Sorry for this.. just want to get it 100% if possible.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 08, 2002 11:49 am   
 
Yes, there is. Use the initial suggestion:
#TRIGGER {(*)} {#IF ("A pr ickly stinging overwhelms your body." =~ "%1") {cure affliction}}

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Aug 08, 2002 3:30 pm   
 
The MUD probably doesn't replace spaces with *'s, so you could use:
{A|*} {p|*}{r|*}{i|*}{c|*}{k|*}{l|*}{y|*} {s|*}{t|*}{i|*}{n|*}{g|*}{i|*}{n|*}{g|*} {o|*}


LightBulb
Senior Member
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Thu Aug 08, 2002 5:31 pm   
 
Kjata,

Your trigger doesn't seem to recognise the line from the MUD, and I cant seem to find out why. I'm sorry. I am guessing it something I am doing, maybe you could explain it please.

LightBulb,

You are right when you say that the MUD doesn't replace spaces with *'s. The pattern without any spaces at all won't recognise the line, though.

BUT your idea led me to change the { |*} spaces to just blank spaces { }. Now it recognises the line and also breaks up a long line of *'s :)

Thanks to all of you for all of the advice, I really appreciate it!
Reply with quote
LEit
Novice


Joined: 27 Jul 2002
Posts: 38
Location: USA

PostPosted: Thu Aug 08, 2002 5:47 pm   
 
Although it may be easy to miss, LightBulb has a space in his trigger. You don't need the {} around the space for the trigger to match.
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Thu Aug 08, 2002 6:12 pm   
 
Ah.. ok.. thanks :) Sorry Lightbulb.

BTW.. just tested it. There ARE *'s in the spaces :(

This is tricky.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 08, 2002 6:34 pm   
 
Can't think of a reason why it won't work. It works fine for me. Here is what I do:
1. I enter the following into zMUD's command line:
#TRIGGER {(*)} {#IF ("A pr ickly stinging overwhelms your body." =~ "%1") {cure affliction}}

Of course, without the extra space between "pr" and "ickly".

2. I test it by entering this into the command line:
#sh A p*ickly stin*ing*overwhelms *our body.

zMUD sends "cure affliction" to the MUD.

3. I test it some more by entering this:
#sh A p*ickly stin*ing*overwhelm *our body.

zMUD sends nothing to the MUD.

Kjata
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Thu Aug 08, 2002 8:14 pm   
 
Kjata Thanks. It does work! My error.. sorry.

However, try copying the line below into the command line and you will see that it still triggers. Is there anyway to stop it?

"****************************************************"
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 08, 2002 8:33 pm   
 
Yup, it does fire the trigger. Ok, then, it's onto suggestion number 2 above:

#TRIGGER {(*)} {#VAR affline "A pr ickly stinging overwhelms your body.";#VAR affliction "%1";#WHILE (%pos("*", @affliction)) {#VAR affline {%delete(@affline, %pos("*", @affliction), 1)};#VAR affliction {%delete(@affliction, %pos("*", @affliction), 1)}};#IF ((@affliction = @affline) and (@affline <> "")) {cure affliction}}

This is one should not fire with anything else but the correct line.

Kjata
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Thu Aug 08, 2002 10:16 pm   
 
Incredible.. Thank you so much!

Works perfectly! :P

I appreciate the time you spend helping newbs like me. I have learnt a lot being here.

Thanks again,

Sam
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Fri Aug 09, 2002 12:26 am   
 
Kjata,

Sorry to be a pain, but now that trigger is creating a LOT of classes.

So if I type "Hello my friend".. it creates a class with the following:

#CLASS {friend.""}
#VAR affliction {"You say, "Hello} {my}
#CLASS 0

Any idea whats happening? It happens for everything that is said or done.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Aug 09, 2002 12:37 am   
 
Open the Settings Editor and go to edit the trigger. Check to see that all the command are like those in the post above. My guess is that you have this:
#VAR affliction %1

instead of:
#VAR affliction "%1"

Kjata
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Fri Aug 09, 2002 12:42 am   
 
What I have is:

#VAR affline "A p rickly stinging overwhelms your body"
#VAR affliction "%1"
#WHILE (%pos( "*", @affliction)) {
#VAR affline {%delete( @affline, %pos( "*", @affliction), 1)}
#VAR affliction {%delete( @affliction, %pos( "*", @affliction), 1)}
}
#IF ((@affliction = @affline) and (@affline <> "")) {
#color %color( 15, 4)
cure
}

I have the #VAR affliction "%1". Its strange.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Aug 09, 2002 12:54 am   
 
Oh, I see the problem. The communication channels on your MUD use double quotes, right? Like this:
You say, "Hello my friend."

Ok, to fix that change:
#VAR affliction "%1"

to:
#VAR affliction {%1}

Kjata
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Fri Aug 09, 2002 1:13 am   
 
That did it! Yes.. my MUD uses quotes for speach *sigh*.

Thanks again! There is no doubt as to your 'Guruness' :P
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Fri Aug 09, 2002 3:11 pm   
 
Kjata :P

Back again..sorry for this.

I am now getting the following error message:



An example of when it comes up is as follows:

Jo draws his blade back and plunges it deep into your helpless body impaling
writhe
it to the hilt.
H:2387 M:2625 [p eb]You begin to writhe furiously to escape the blade that has impaled you.
H:2387 M:2625 [p e-]
You have recovered balance on all limbs.
H:2387 M:2625 [p eb]
Your health continues to drain away as your impaled body shudders on the end of
the weapon.
H:2170 M:2625 [p eb]
With an heroic effort you manage to writhe yourself free from the weapon which
impaled you.

It appears while the above happens.. but its a completely different trigger (for 'writhe'). I havent tested it with other things to see if it comes up for those too. But.. the 'P rickly sensation' trigger works though.

I have no idea why its doing this :( Although I am guessing that the "H:2387 M:2625 [p e-]" is the problem?? I think its trying to parse e-.
Reply with quote
Sam
Beginner


Joined: 15 Jul 2002
Posts: 18

PostPosted: Fri Aug 09, 2002 3:43 pm   
 
I tried using "#VAR affliction "%2" and it seems to work. I'll let you know.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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