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
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Thu Apr 17, 2003 4:46 am   

Pattern matching
 
I'm having trouble with successfully matching
[code]<1772/1826hp 938/956m 373265g 4052xp> Your blast of frost CRIPPLES A roadie's head! [46]
against
Your (*) {@damages} (%2)'s {@bodyparts}* ~[%d~]$

Testing the trigger returns as a success (the variables are properly filled), but almost nothing inside the reaction pane wants to fire...right now the testing response is

#IF ("%1" == "blast of lightning") {
cast 'lightning breath'
#ADD breath 1
#ABORT 1
}

As a side note, I cant set the prompt to seperate from the rest of the line...the only way to force non-prompt text to a new line is by leaving the preference for "echo commands/scripts" on...but i dont like that :P I think that if I can seperate the two pieces, the script will work once more. It's worked on 5.55->6.55 (i think 6.55) till recently. The prompt thing also seems to interfere with mapping, but #tag attempts have failed :/

Why oh WHY did I have pass door on...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 17, 2003 5:33 am   
 
What's the problem?

1. Does the trigger fire or not? With the trigger pattern and the given sample MUD
output, it should. However, you should replace that (%2) with (*). Or possibly,
just with *, since you don't appear to be using it later.

2. When it does fire, do you get the expected actions? Presumably not. However,
that might be the result of faulty expectations rather than anything in the
trigger. That is:
"blast of frost" is not the same as "blast of lightning"
So, it should NOT do anything in the script snippet you provided.

LightBulb
Advanced Member
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Thu Apr 17, 2003 5:48 am   
 
1) The trigger doesnt fire 99% of the time...that 1% seems to be random, and only when the text comes in on a new line (even tho the trigger isnt prefaced with a ^).

2) The full trigger text is deeper than what I've supplied, but testing the same spell with the same response doesnt fire...I merely pasted in an example that worked until recently, an example I've also tried on its own (with the right spell :P) Like I was saying though, this worked perfectly until recently and suddenly "wont". Nothing on my end was changed, thats why I'm confused.


#IF ( @breath > 15) {
#IF (@hp < @maxhp) {
#VARIABLE breath 0
cast 'cure serious' self
} {
disarm
#VARIABLE breath 0
}
}
#IF (@mana > 100) {
#IF ("%1" == "blast of lightning") {
cast 'lightning breath'
#ADD breath 1
#ABORT 1
}
#IF ("%1" == "blast of acid") {
cast 'acid breath'
#ADD breath 1
#ABORT 1
}
#IF ("%1" == "blast of flame") {
cast 'fire breath'
#ADD breath 1
#ABORT 1
}
#IF ("%1" == "blast of frost") {
cast 'frost breath'
#ADD breath 1
#ABORT 1
}
#IF ("%1" == "blast of gas") {
#VARIABLE breath 0
#ABORT 1
}
}

Why oh WHY did I have pass door on...
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Apr 17, 2003 6:43 am   
 
Trigger:
Your (*) {@damages} (*)'s {@bodyparts}* ~[%d~]$
Value:
#Pcol blue %x1
#Pcol red %x2

Variable: damages
Value:
CRIPPLES|HOPS|SKIPS|JUMPS

Variable: bodyparts
Value:
head|feet|rightearlobe

I'm having no issue pattern matching it.

<1772/1826hp 938/956m 373265g 4052xp> Your blast of frost CRIPPLES A roadie's head! [46]

//

Try perhaps for the prompt issue:
Use GA/EOR for prompt (local)

Controls whether zMud interprets the Go Ahead/End Of Record telnet options to indicate the end of a prompt. When active zMud will display the next text received from the mud on a newline if the mud forgets to send a newline. Default is on.


Ton Diening
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 17, 2003 6:50 am   
 
Sorry, I just noticed that you said the trigger worked through version 6.55, so it's
probably either a bug or a bugfix in the latest beta version. If you can narrow the
problem down, report it on the Beta forum.

You don't start with ^ but you do end with $. Make sure there aren't any trailing
spaces. Remember that MUDs make changes too.

You could probably eliminate all the #ABORT commands. It really won't take zMUD long to
check 4 more #IF commands (worst case) which would all be false and require no action.

You use several variables from other sources. Specifically, @mana comes from
another source. Check that the VARIABLE is at least 101 (don't rely on your prompt).
Check the trigger that provides it.

Check the trigger(s) and variables for @hp and @maxhp also, although these won't come
into play until @breath reaches 16.

Check that the damage message matches an item in @damages. Check that the bodypart
matches an item in @bodyparts.

You might want to add some #SAY or #MESSAGE commands to verify trigger firing/logic.
These are just for testing and can be removed again once firing/logic is verified
(one way or the other).

You could do everyone a favor by NOT using the forum's [ code ] and [ /code ] tags. In
addition to providing an attractive layout they also:
1. Disable wordwrap, often resulting in posts that go several screens WIDE. This
seriously impairs readability.
2. Remove the end-of-line's, making the code nearly worthless for cut-and-paste
IMHO, those two faults far outweigh the slight advantage they provide in terms of
layout. That also means you should edit your earlier posts to remove the tags you already
used.

Pattern:
Your (*) {@damages} *'s {@bodyparts}* ~[%d~]$

Value:
#IF (@breath > 15) {#IF (@hp < @maxhp) {
#VARIABLE breath 0
cast 'cure serious' self
} {
disarm
#VARIABLE breath 0
}}
#IF (@mana > 100) {
#IF ("%1" = "blast of lightning") {
cast 'lightning breath'
#ADD breath 1
}
#IF ("%1" = "blast of acid") {
cast 'acid breath'
#ADD breath 1
}
#IF ("%1" = "blast of flame") {
cast 'fire breath'
#ADD breath 1
}
#IF ("%1" = "blast of frost") {
cast 'frost breath'
#ADD breath 1
}
#IF ("%1" = "blast of gas") {#VARIABLE breath 0}
}

LightBulb
Advanced Member
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Thu Apr 17, 2003 7:21 am   
 
Fixed the /code tags, I keep forgetting people dont like those :)

As for the script...the #pcolor tags are NOT colouring the target and the offense in the spells, so the spell doesnt recast (yet). Regular attacks ARE being coloured (from the same trigger), so since it's a sign of life, I'll tinker s'more and see what comes up...

Ton:
Enabling GA/EOR didnt appear to make a difference, but good suggestion...it was off for some reason (alcohol perhaps?). Still having the problem of spells/regular/room names (map reasons) coming in on the same line as the prompt.

Edit: changed wording to reflect original meanings
Why oh WHY did I have pass door on...
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Thu Apr 17, 2003 12:40 pm   
 
I rebuilt the .mud file, beginning with the breath and its required stuff...worked perfectly..doh. Added the rest slowly, and it still works...nothing omitted, settings still the same...but it works.

Chalking it up to "too many upgrades" since I havent been mudding lately :P

Why oh WHY did I have pass door on...
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