Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Nov 08, 2008 10:17 am   

Possible display bug?
 
Quote:

You dodge a male nomad's attack.
A wild black horse's claw injures a male nomad.
Your pierce decimates a male nomad! (26.5) dmg
A fine alloy great dagger draws life from a male nomad.
Your pierce maims a male nomad! (34.5) dmg
A fine alloy great dagger draws life from a male nomad.
A male nomad looks pretty hurt.




The pattern matches, but it doesn't display like it should. But, as you can see, it displays just fine for the others.

Code:

<trigger name="Damage Convert" priority="1730" regex="true" id="173">
  <pattern><![CDATA[^(?>\[(?: \w+){1,5} \] )?((?>[\w'-]+ ){1,5})(@attack_type) (?>does )?(@damage_type) (?>things to )?(?>a |the )?([\w'-]+(?: )?){1,5}[!.]]]></pattern>
  <value><![CDATA[  battle=1
  $DmgVal=%3
  $Dmg=%null
  #switch ($DmgVal)
    ("misses") {$Dmg=0}
    ("scratches") {$Dmg=2.5}
    ("grazes") {$Dmg=6.5}
    ("hits") {$Dmg=10.5}
    ("injures") {$Dmg=14.5}
    ("wounds") {$Dmg=18.5}
    ("mauls") {$Dmg=22.5}
    ("decimates") {$Dmg=26.5}
    ("devastates") {$Dmg=30.5}
    ("maims") {$Dmg=34.5}
    ("MUTILATES") {$Dmg=38.5}
    ("DISEMBOWELS") {$Dmg=42.5}
    ("DISMEMBERS") {$Dmg=46.5}
    ("MASSACRES") {$Dmg=50.5}
    ("MANGLES") {$Dmg=54.5}
    ("*** DEMOLISHES ***") {$Dmg=58.5}
    ("*** DEVASTATES ***") {$Dmg=68}
    ("=== OBLITERATES ===") {$Dmg=88}
    (">>> ANNIHILATES <<<") {$Dmg= 112}
    ("<<< ERADICATES >>>") {$Dmg=136}
    ("GHASTLY") {$Dmg=163}
    ("HORRID") {$Dmg=188}
    ("DREADFUL") {$Dmg=228}
    ("HIDEOUS") {$Dmg=238}
    ("INDESCRIBABLE") {$Dmg=263}
    ("UNSPEAKABLE") {$Dmg=280}

  #switch ($Dmg=0) {#sayadd { <color #CCCCCC>~(</color><color #2D2D00>$Dmg</color><color #CCCCCC>~) dmg </color>}}
     (($Dmg > 0) AND ($Dmg <=34.5)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor1>$Dmg</color><color #CCCCCC>~) dmg </color>}}
     (($Dmg > 34.5) AND ($Dmg <= 54.5)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor2>$Dmg</color><color #CCCCCC>~) dmg </color>}}
     (($Dmg > 54.5) AND ($Dmg <= 136)) {#sayadd { <color #CCCCCC>~(</color><color @Pcolor3>$Dmg</color><color #CCCCCC>~) dmg </color>}}
     (($Dmg >= 163) AND ($Dmg <= 280)) {#sayadd { %ansi(blink)<color #CCCCCC>~(</color><color @Pcolor3>$Dmg</color><color #CCCCCC>~) dmg </color>%ansi(none)}}

#IF (%1="Your ")
{
 round_dmg=@round_dmg+$Dmg
}
#IF (%4="you")
{
 round_dmgu=@round_dmgu+$Dmg
}]]></value>
</trigger>
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Nov 10, 2008 6:21 am   
 
bump?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Nov 10, 2008 2:39 pm   
 
I got the same thing with "A wild black horse's claw wounds a black bull."

But this time it didn't match. 0.0

I threw it into regex coach, but it doesn't do a great job of telling you what's wrong. It matched the whole thing with a gray highlight instead of turning yellow at the breaking point, but said the string didn't match.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Nov 10, 2008 3:34 pm   
 
It'd be more helpful if one had the variables so one wouldn't have to pull things out of their rear end to see if it works for them or if it fails, too.

Charneus
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Nov 10, 2008 4:28 pm   
 
Oops, I thought I posted the pearl pattern:

Code:

^(?>\[(?: \w+){1,5} \] )?((?>[\w'-]+ ){1,5})(wrath|whip|thwack|thrust|suction|sting|stab|spell|smash|smash|slime|slice|slash|slap|shocking bite|shock|shock|scratch|roundhouse|punch|pound|polevault kick|pierce|peck|magic|lightning bolt|lightning|kick|grep|freezing bite|flaming bite|flamestrike|flame|flame|fireball|drain|divine|crush|cleave|claw|chop|chomp|chill|charge|blast|bite|beating|backstab|acidic bite) (?>does )?(\*\*\* DEVASTATES \*\*\*|\*\*\* DEMOLISHES \*\*\*|UNSPEAKABLE|MUTILATES|mauls|MASSACRES|MANGLES|maims|INDESCRIBABLE|HORRID|HIDEOUS|GHASTLY|DREADFUL|DISMEMBERS|DISEMBOWELS|devastates|decimates|>>> ANNIHILATES <<<|=== OBLITERATES ===|<<< ERADICATES >>>) (?>things to )?((?>a |the )?(?:[\w'-]+(?: )?){1,5})[!.]
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Nov 11, 2008 12:44 am   
 
You need to post your variables. specifically the ones used in the triger pattern and the script. i.e. Attack_type, damage_type, round_dmg and round_dmgu.

Edit late post. I'll take a look at in on my flight.
_________________
Asati di tempari!
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Nov 11, 2008 5:27 am   
 
Your damage type variable is missing the entry "injures". Also it may be because of how I copied it, but make sure there's no space at the end of your pattern.
_________________
Asati di tempari!
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Nov 11, 2008 5:43 pm   
 
But then how did it match the pattern?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Nov 11, 2008 7:09 pm   
 
Magic? I don't know, but the pattern you posted above doesn't match the text "A wild black horse's claw injures a male nomad."

If you gave us the XML for the actual variables you're using in addition to that for the trigger, we could try with your exact setup.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Nov 11, 2008 7:29 pm   
 
I had problems making the stringlist and probably missed a few more. If I set them all up on their own lines in notepad, can I import them into the editor?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Nov 11, 2008 7:44 pm   
 
The easiest way would probably be to get a text editor that allows regex-based find and replace, and doing

find ^(*)$
replace with #additem StringList {\1}

And then pasting that onto the command line. You could do that pretty easily yourself if you put the "#additem StringList {" part into the clipboard, you'd just have to press home-ctrl+v-down over and over.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Wed Nov 12, 2008 3:37 am   
 
Does NotePad++ have that?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Nov 12, 2008 4:12 am   
 
Probably, but in the time it takes you to find it, download it, install it, and work out how to use it, you could probably have done it using the manual method.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Wed Nov 12, 2008 6:47 am   
 
Well, for future reference and use... what program did you have in mind?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Nov 12, 2008 12:29 pm   
 
Take your pick!

http://en.wikipedia.org/wiki/Comparison_of_text_editors

If you look toward the middle of the page, it will tell you which ones support that feature.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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