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 Goto page Previous  1, 2, 3, 4, 5, 6  Next
chamenas Posted: Thu Apr 17, 2008 11:47 am
replacing lines of text before they show...
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sun Apr 20, 2008 11:04 pm   
 
Well first of all you have like a mixture of both types of variables.

In the beginning you need to declare it.

$dmg=""

Then in your script you need to make sure you write it correctly as "$dmg". Like in your #switch statement it would be $dmg=263 or whatever. In the lower #switch it would be ($dmg <= 34.5) and in the #sayadd it would be $dmg too. Look at how I did it above.

Code:
$dmgVal=%2
$dmg=""
#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}
  ("INDESSCRIBABLE") {$dmg=263}
  ("UNSPEAKABLE") {$dmg=280}
#switch ($dmg <= 34.5) {#sayadd { ~(<color lime>$dmg</color>~) dmg}}
  (($dmg > 34.5) AND ($dmg <= 54.5)) {#sayadd { ~(<color yellow>$dmg</color>~) dmg}}
  (($dmg > 54.5) AND ($dmg < 280)) {#sayadd { ~(<color red>$dmg</color>~) dmg}}
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sun Apr 20, 2008 11:18 pm   
 
Done:

Code:

#regex Damage_Convert {^Your (acidic bite|beating|bite|blast|charge|chill|chop|claw|cleave|crush|divine|drain|flame|flaming bite|freezing bite|grep|magic|peck|pierce|pound|punch|scratch|shocking bite|shock|slap|slash|slice|slime|smash|stab|sting|suction|thrust|thwack|whip|wrath|polevault kick) (misses|maims|scratches|grazes|hits|injures|wounds|mauls|decimates|devestates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\* DEMOLISHES \*\*\*|\*\*\* DEVESTATES \*\*\*|=== OBLITERATES ===|>>> ANNIHILATES <<<|<<< ERADICATES >>>|GHASTLY|HORRID|DREADFUL|HIDEOUS|INDESSCRIBABLE|UNSPEAKABLE) (?:a|the|A|The)? (.+)[!\.]$}
{ Dmg_Val=%2
Dmg=" "
#switch ($Dmg_Val)
  ("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}
  ("INDESSCRIBABLE") {Dmg=263}
  ("UNSPEAKABLE") {Dmg=280}

   #switch ($Dmg <= 34.5) {#sayadd {<color @Pcolor_color1>)</color>~(<color red>)$Dmg</color><color @Pcolor_color1>)~) dmg </color>}}
      (($Dmg > 34.5) AND ($Dmg <= 54.5)) {#sayadd {<color @Pcolor_color2>)</color>~(<color red>)$Dmg</color><color @Pcolor_color2>)~) dmg </color>}}
      (($Dmg > 54.5) AND ($Dmg < 280)) {#sayadd {<color @Pcolor_color3>)</color>~(<color red>)$Dmg</color><color @Pcolor_color3>)~) dmg </color>}}

} {General Triggers|Damage Calculator}


Same error :P
_________________
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: Sun Apr 20, 2008 11:38 pm   
 
You still haven't changed them all. You still have loads of Dmg=somethings everywhere that should be $Dmg=something. I think you need to read this, memorise it, sleep with it under your pillow at night. Perhaps make an audio recording of it and listen to it on the bus like you're learning a foreign language.
_________________
Rorso's syntax colouriser.

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


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sun Apr 20, 2008 11:40 pm   
 
Dude you must be like totally ignoring my examples.

By the way, I did find one problem. I forgot to mention you need to change ($dmg < 280) to ($dmg <= 280). Otherwise if the damage type is unspeakable, it will never use the #sayadd.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 12:13 am   
 
Oh, I have to use $ for ever instance of it??

So...

Code:

#regex Damage_Convert {^Your (acidic bite|beating|bite|blast|charge|chill|chop|claw|cleave|crush|divine|drain|flame|flaming bite|freezing bite|grep|magic|peck|pierce|pound|punch|scratch|shocking bite|shock|slap|slash|slice|slime|smash|stab|sting|suction|thrust|thwack|whip|wrath|polevault kick) (misses|maims|scratches|grazes|hits|injures|wounds|mauls|decimates|devestates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\* DEMOLISHES \*\*\*|\*\*\* DEVESTATES \*\*\*|=== OBLITERATES ===|>>> ANNIHILATES <<<|<<< ERADICATES >>>|GHASTLY|HORRID|DREADFUL|HIDEOUS|INDESSCRIBABLE|UNSPEAKABLE) (?:a|the|A|The)? (.+)[!\.]$}
{ $Dmg_Val=%2
$Dmg=" "
#switch ($Dmg_Val)
  ("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}
  ("INDESSCRIBABLE") {$Dmg=263}
  ("UNSPEAKABLE") {$Dmg=280}

   #switch ($Dmg <= 34.5) {#sayadd {<color @Pcolor_color1>)</color>~(<color red>)$Dmg</color><color @Pcolor_color1>)~) dmg </color>}}
      (($Dmg > 34.5) AND ($Dmg <= 54.5)) {#sayadd {<color @Pcolor_color2>)</color>~(<color red>)$Dmg</color><color @Pcolor_color2>)~) dmg </color>}}
      (($Dmg > 54.5) AND ($Dmg < 280)) {#sayadd {<color @Pcolor_color3>)</color>~(<color red>)$Dmg</color><color @Pcolor_color3>)~) dmg </color>}}

} {General Triggers|Damage Calculator}
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 12:31 am   
 
...yes.

You didn't change $dmg < 280 to $dmg <= 280 either. Don't forget or when your trigger contains UNSPEAKABLE it will never do anything. Also I am just curious why you indented the second #switch like that?
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 12:35 am   
 
oops, forgot it. Will change. Intended the second switch like what?

Each of the three switches represents one of the three damage value ranges, green, YELLOW, and *** RED ***

..actually, couldn't I make the 4rth one (candy striped) blinky?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Apr 21, 2008 12:59 am   
 
Yep, just add %ansi(blink) before whatever you want to blink, and %ansi(none) after it.

He said indented, not intended. Your #switch has some spaces before it for no apparent reason.
_________________
Rorso's syntax colouriser.

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


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 1:25 am   
 
I like to neaten things up *shrugs* nesting.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 1:40 am   
 
You aren't nesting that #switch. It's a whole new block.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 1:45 am   
 
Nested in relation to the trigger as a whole. I should nest the first switch too, but I'm too scared it'll screw it up, the script seems very fincky with whitespace.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 2:17 am   
 
I'm not sure you understand what nesting means.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 2:52 am   
 
Oh, I do. I know it's not the same.

This is nesting

Code:

Function one ( )
{

  IF ( ) {

    IF ( ) {

    }

  Else  {

   }

 }

 Else {

 }

}


Last edited by chamenas on Mon Apr 21, 2008 3:26 am; edited 1 time in total
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Apr 21, 2008 2:57 am   
 
In this case, the #switch is inside the #trig - it'll look better in the text file this way, but won't look so good in the package editor. Doesn't really matter either way, so it's his choice.
_________________
Rorso's syntax colouriser.

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


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 3:27 am   
 
It's just habit I suppose. But I would like to know how much whitespace I can play with, to neaten things up.

edit: Trigger still isn't working :/


Your flaming bite DISMEMBERS a Nymph!
Your flaming bite maims a Nymph!
Your flaming bite DISEMBOWELS a Nymph!
Your flaming bite DISEMBOWELS a Nymph!
Your flaming bite devastates a Nymph!
Your flaming bite DISMEMBERS a Nymph!
Your flaming bite maims a Nymph!
Your flaming bite DISMEMBERS a Nymph!
Your flaming bite maims a Nymph!
Your flaming bite DISEMBOWELS a Nymph!
Your flaming bite devastates a Nymph!
Your flaming bite DISEMBOWELS a Nymph!
Your flaming bite maims a Nymph!
A Nymph is in awful condition.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 5:06 am   
 
Edit: Hmm I just tested what you had and it works fine. You must have changed something somewhere.

Your flaming bite DISEMBOWELS a Nymph!)()42.5)) dmg
Your flaming bite DISEMBOWELS a Nymph!)()42.5)) dmg
Your flaming bite DISEMBOWELS a Nymph!)()42.5)) dmg
Your flaming bite DISEMBOWELS a Nymph!)()42.5)) dmg
Your flaming bite DISEMBOWELS a Nymph!)()42.5)) dmg
Your flaming bite DISEMBOWELS a Nymph!)()42.5)) dmg
Your flaming bite DISEMBOWELS a Nymph!)()42.5)) dmg
Your flaming bite DISEMBOWELS a Nymph!)()42.5)) dmg
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 5:23 am   
 
Code:


#regex Damage_Convert {(?:A|The)? .*'s (acidic bite|beating|bite|blast|charge|chill|chop|claw|cleave|crush|divine|drain|flame|flaming bite|freezing bite|grep|magic|peck|pierce|pound|punch|scratch|shocking bite|shock|slap|slash|slice|slime|smash|stab|sting|suction|thrust|thwack|whip|wrath) (misses|maims|scratches|grazes|hits|injures|wounds|mauls|decimates|devestates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\* DEMOLISHES \*\*\*|\*\*\* DEVESTATES \*\*\*|=== OBLITERATES ===|>>> ANNIHILATES <<<|<<< ERADICATES >>>|GHASTLY|HORRID|DREADFUL|HIDEOUS|INDESSCRIBABLE|UNSPEAKABLE) you[!\.]$}
{ $EDmg_Val=%2
$EDmg=" "
#switch ($EDmg_Val)
  ("misses") {$EDmg=0}
  ("scratches") {$EDmg=2.5}
  ("grazes") {$EDmg=6.5}
  ("hits") {$EDmg=10.5}
  ("injures") {$EDmg=14.5}
  ("wounds") {$EDmg=18.5}
  ("mauls") {$EDmg=22.5}
  ("decimates") {$EDmg=26.5}
  ("devastates") {$EDmg=30.5}
  ("maims") {$EDmg=34.5}
  ("MUTILATES") {$EDmg=38.5}
  ("DISEMBOWELS") {$EDmg=42.5}
  ("DISMEMBERS") {$EDmg=46.5}
  ("MASSACRES") {$EDmg=50.5}
  ("MANGLES") {$EDmg=54.5}
  ("*** DEMOLISHES ***") {$EDmg=58.5}
  ("*** DEVASTATES ***") {$EDmg=68}
  ("=== OBLITERATES ===") {$EDmg=88}
  (">>> ANNIHILATES <<<") {$EDmg= 112}
  ("<<< ERADICATES >>>") {$EDmg=136}
  ("GHASTLY") {$EDmg=163}
  ("HORRID") {$EDmg=188}
  ("DREADFUL") {$EDmg=228}
  ("HIDEOUS") {$EDmg=238}
  ("INDESSCRIBABLE") {$EDmg=263}
  ("UNSPEAKABLE") {$EDmg=280}

   #sayadd {<color red>~($EDmg~) Dmg to you!!!</color>}

} {General Triggers|Damage Calculator}



This is what I have
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 5:30 am   
 
Well for one thing you gave both your triggers the same ID so if you pasted both of those on the command line one just overwrote the other.

What you just pasted works, because I tested it too. However, it will only work for patterns that match when YOU get attacked.

A Nymph's flaming bite DISEMBOWELS you!(42.5) Dmg to you!!!
A Nymph's flaming bite DISEMBOWELS you!(42.5) Dmg to you!!!
A Nymph's flaming bite DISEMBOWELS you!(42.5) Dmg to you!!!
A Nymph's flaming bite DISEMBOWELS you!(42.5) Dmg to you!!!
A Nymph's flaming bite DISEMBOWELS you!(42.5) Dmg to you!!!
A Nymph's flaming bite DISEMBOWELS you!(42.5) Dmg to you!!!
A Nymph's flaming bite DISEMBOWELS you!(42.5) Dmg to you!!!
A Nymph's flaming bite DISEMBOWELS you!(42.5) Dmg to you!!!

In other words the other trigger no longer exists, which is why it won't work for the other lines.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 5:48 am   
 
whoops, wrong one

Code:

#regex Damage_Convert {^Your (acidic bite|beating|bite|blast|charge|chill|chop|claw|cleave|crush|divine|drain|flame|flaming bite|freezing bite|grep|magic|peck|pierce|pound|punch|scratch|shocking bite|shock|slap|slash|slice|slime|smash|stab|sting|suction|thrust|thwack|whip|wrath|polevault kick) (misses|maims|scratches|grazes|hits|injures|wounds|mauls|decimates|devestates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\* DEMOLISHES \*\*\*|\*\*\* DEVESTATES \*\*\*|=== OBLITERATES ===|>>> ANNIHILATES <<<|<<< ERADICATES >>>|GHASTLY|HORRID|DREADFUL|HIDEOUS|INDESSCRIBABLE|UNSPEAKABLE) (?:a|the|A|The)? (.+)[!\.]$}
{ $Dmg_Val=%2
$Dmg=" "
#switch ($Dmg_Val)
  ("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}
  ("INDESSCRIBABLE") {$Dmg=263}
  ("UNSPEAKABLE") {$Dmg=280}

  #switch ($Dmg <= 34.5) {#sayadd {<color @Pcolor_color1>)</color>~(<color red>)$Dmg</color><color @Pcolor_color1>)~) dmg </color>}}
     (($Dmg > 34.5) AND ($Dmg <= 54.5)) {#sayadd {<color @Pcolor_color2>)</color>~(<color red>)$Dmg</color><color @Pcolor_color2>)~) dmg </color>}}
     (($Dmg > 54.5) AND ($Dmg <= 280)) {#sayadd {<color @Pcolor_color3>)</color>~(<color red>)$Dmg</color><color @Pcolor_color3>)~) dmg </color>}}

} {General Triggers|Damage Calculator}
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 8:16 am   
 
You still have both your triggers with the same exact ID in the same location.

I put it in an empty session and it works fine. The only thing I can think of is that your Pcolor variables have nothing in their values?
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 12:17 pm   
 
Yeah, I fixed the name when you pointed that out. I can test Pcolor. That may be it since it wasn't setting before.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 1:08 pm   
 
It works now! However, the variable colors don't work, only the static red does.

Is there a way to store all the possible attack types somewhere else? It's getting to be quite a list...

"acidic bite|beating|bite|blast|charge|chill|chop|claw|cleave|crush|divine|drain|flame|flaming bite|freezing bite|grep|magic|peck|pierce|pound|punch|scratch|shocking bite|shock|slap|slash|slice|slime|smash|stab|sting|suction|thrust|thwack|whip|wrath|polevault kick|kick|flamestrike"

Either that, or alternative formatting to make it easier to read.

Also of interest:


A fire elemental's flame === OBLITERATES === A sasquatch!
A fire elemental's flame === OBLITERATES === A sasquatch!
A sasquatch's pierce misses you.(0) Dmg to you!!!
Your flaming bite DISMEMBERS A sasquatch!(46.5) dmg
Your flaming bite decimates A sasquatch!(26.5) dmg
Your flaming bite MASSACRES A sasquatch!(50.5) dmg
Your flaming bite devastates A sasquatch!
A sasquatch is in awful condition.

no damage shows up.

And...

Your spell does GHASTLY things to A sasquatch!

I changed to this:
Code:

{^Your (acidic bite|beating|bite|blast|charge|chill|chop|claw|cleave|crush|divine|drain|flame|flaming bite|freezing bite|grep|magic|peck|pierce|pound|punch|scratch|shocking bite|shock|slap|slash|slice|slime|smash|stab|sting|suction|thrust|thwack|whip|wrath|polevault kick|kick|flamestrike|spell)(?: does)? (misses|maims|scratches|grazes|hits|injures|wounds|mauls|decimates|devestates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\* DEMOLISHES \*\*\*|\*\*\* DEVESTATES \*\*\*|=== OBLITERATES ===|>>> ANNIHILATES <<<|<<< ERADICATES >>>|GHASTLY|HORRID|DREADFUL|HIDEOUS|INDESSCRIBABLE|UNSPEAKABLE)(?: things to)? (?:a|the|A|The)? (.+)[!\.]$}


still doesn't work.

Also... there are still random lines where the color disappears.

And...
Code:

{^(?:A|The|a|the)? .* (acidic bite|beating|bite|blast|charge|chill|chop|claw|cleave|crush|divine|drain|flame|flaming bite|freezing bite|grep|magic|peck|pierce|pound|punch|scratch|shocking bite|shock|slap|slash|slice|slime|smash|stab|sting|suction|thrust|thwack|whip|wrath|polevault kick|kick|flamestrike|spell|flame)(?: does)? (misses|maims|scratches|grazes|hits|injures|wounds|mauls|decimates|devestates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\* DEMOLISHES \*\*\*|\*\*\* DEVESTATES \*\*\*|=== OBLITERATES ===|>>> ANNIHILATES <<<|<<< ERADICATES >>>|GHASTLY|HORRID|DREADFUL|HIDEOUS|INDESSCRIBABLE|UNSPEAKABLE)(?: things to)? (?:a|the|A|The)? (.+)[!\.]}


I added for lines like this:
A fire elemental's flame *** DEVESTATES *** A sasquatch!

It works for every line except the one shown.

Thanks for the help :)
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Apr 21, 2008 3:09 pm   
 
^(?:A|The|a|the)? .*
That's a kind of pointless expression, you might as well just start with .* or just not start at the beginning of the line if you're going to make the first part optional and not capture any of it anyway (second pattern).

(?: things to)? (?:a|the|A|The)? (.+)
You've got two required spaces in a row, so if you don't have (a|the|A|The), your pattern won't match (both patterns).

[!\.]
In this case, you don't need to escape . because it's in a range (both patterns).

The really major problem is that you're consistently spelling "devastates" incorrectly in your patterns.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Mon Apr 21, 2008 5:05 pm   
 
gamma_ray wrote:
^(?:A|The|a|the)? .*
That's a kind of pointless expression, you might as well just start with .* or just not start at the beginning of the line if you're going to make the first part optional and not capture any of it anyway (second pattern).

(?: things to)? (?:a|the|A|The)? (.+)
You've got two required spaces in a row, so if you don't have (a|the|A|The), your pattern won't match (both patterns).

[!\.]
In this case, you don't need to escape . because it's in a range (both patterns).

The really major problem is that you're consistently spelling "devastates" incorrectly in your patterns.


I'm spelling them how they're spelled in the game. I know how to spell, but the coder in the game doesn't. So I don't think that's it, but I could double check. The ^(?:A|The|a|the) is very important for later purposes. I want to capture the name, not what proceeds the name... so...

A sasquatch, I just want to capture sasquatch, but it's not always A, it could be:
The Arkane Guard
or
a small fish
or
the puppy dog
or
Chamenas (player name)

That's why it's optional.

should be (?: things to)?(?: a|the|A|The)? (.+), I'll fix it. Wont be able to test until later.
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Apr 21, 2008 5:23 pm   
 
Well in your example of something not matching, you have:

Your flaming bite devastates A sasquatch!

with devastates (the correct spelling), and in your trigger, you have devEstates. So either your example is wrong or you need to fix your trigger to match the (correct) spelling.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
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