 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Wed Jun 11, 2008 2:35 pm
Damage Calculator - Milestone, still need help though :) |
So I thank a lot of you for bearing with me, I've finally reached a milestone with the damage calculator. Scroll past the two code blocks to find out the purpose of this post.
Some output:
Code: |
Sample Battle 1:
...
<1614/1536hp 1186/1232m 406/406mv 36891tnl 1797pq 242/390w 817g/46s
[An Uneven, Hot Corridor] [EW-NW] 4:00am [Night Time] [Elvish]>
You parry a gnome stone excavator's attack.
Your beating maims a gnome stone excavator! (34.5) dmg
Your beating wounds a gnome stone excavator. (18.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
Your beating MANGLES a gnome stone excavator! (54.5) dmg
Your beating MUTILATES a gnome stone excavator! (38.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
Your beating MASSACRES a gnome stone excavator! (50.5) dmg
Your beating maims a gnome stone excavator! (34.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
A gnome stone excavator is in awful condition.
You did 231 to all creatures this round.
You took 0 from all creatures this round.
<1620/1536hp 1186/1232m 406/406mv 36891tnl 1797pq 242/390w 817g/46s
[An Uneven, Hot Corridor] [EW-NW] 4:00am [Night Time] [Elvish]>
TICK IN 5 SECONDS.
You parry a gnome stone excavator's attack.
Your beating DISEMBOWELS a gnome stone excavator! (42.5) dmg
Your beating devastates a gnome stone excavator! (30.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
Your beating DISMEMBERS a gnome stone excavator! (46.5) dmg
Your beating maims a gnome stone excavator! (34.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
A gnome stone excavator is in awful condition.
You did 154 to all creatures this round.
You took 0 from all creatures this round.
<1627/1536hp 1186/1232m 406/406mv 36891tnl 1797pq 242/390w 817g/46s
[An Uneven, Hot Corridor] [EW-NW] 4:00am [Night Time] [Elvish]>
You parry a gnome stone excavator's attack.
Your beating devastates a gnome stone excavator! (30.5) dmg
Your beating injures a gnome stone excavator. (14.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
Your beating *** DEVASTATES *** a gnome stone excavator!
Your beating DISEMBOWELS a gnome stone excavator! (42.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
A gnome stone excavator is in awful condition.
You did 87.5 to all creatures this round.
You took 0 from all creatures this round.
<1633/1536hp 1186/1232m 406/406mv 36891tnl 1797pq 242/390w 817g/46s
[An Uneven, Hot Corridor] [EW-NW] 4:00am [Night Time] [Elvish]>
A gnome stone excavator's slash misses you. (0) dmg
Your beating maims a gnome stone excavator! (34.5) dmg
Your beating mauls a gnome stone excavator. (22.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
Your beating MANGLES a gnome stone excavator! (54.5) dmg
Your beating MUTILATES a gnome stone excavator! (38.5) dmg
Yasan swings with his staff and sings, 'One quick blow to the cheek, and a jab to your head. A strike where you're weak, and now you're dead!'
a gnome stone excavator is DEAD!!
~
You receive 202 experience points.
A gnome stone excavator's leg is sliced from his dead body.
You get 32 silver coins and 7 gold coins from the corpse of a gnome stone excavator.
0 gold and 32 silver are collected for Shalonesti_kingdom's coffers.
<1541/1536hp 1190/1232m 406/406mv 36891tnl 1797pq 242/390w 824g/46s
[An Uneven, Hot Corridor] [EW-NW] 4:30am [Night Time] [Elvish]>
Timer now at 41 secs.
You did 5539 to creatures in this battle.
You took 30.5 from creatures in this battle.
<1541/1536hp 1190/1232m 406/406mv 36891tnl 1797pq 242/390w 824g/46s
[An Uneven, Hot Corridor] [EW-NW] 4:30am [Night Time] [Elvish]>
==============================================================
| You did 5539 to creatures | You took 30.5 in the battle |
==============================================================
Sample Battle 2:
...
<1554/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 824g/46s
[An Uneven, Hot Corridor] [EW-NW] 9:30am [Day Time] [Elvish]>
You parry a gnome stone excavator's attack.
Your beating DISMEMBERS a gnome stone excavator! (46.5) dmg
Your beating maims a gnome stone excavator! (34.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
A gnome stone excavator is in awful condition.
You did 81 to all creatures this round.
You took 0 from all creatures this round.
<1554/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 824g/46s
[An Uneven, Hot Corridor] [EW-NW] 9:30am [Day Time] [Elvish]>
A gnome stone excavator's slash misses you. (0) dmg
Your beating maims a gnome stone excavator! (34.5) dmg
Your beating mauls a gnome stone excavator. (22.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
A gnome stone excavator is in awful condition.
You did 57 to all creatures this round.
You took 0 from all creatures this round.
<1556/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 824g/46s
[An Uneven, Hot Corridor] [EW-NW] 9:30am [Day Time] [Elvish]>
You block a gnome stone excavator's attack with your shield.
Your beating *** DEVASTATES *** a gnome stone excavator!
Your beating DISEMBOWELS a gnome stone excavator! (42.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
Your beating *** DEMOLISHES *** a gnome stone excavator! (58.5) dmg
Your beating DISEMBOWELS a gnome stone excavator! (42.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
A gnome stone excavator is in awful condition.
You did 143.5 to all creatures this round.
You took 0 from all creatures this round.
<1561/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 824g/46s
[An Uneven, Hot Corridor] [EW-NW] 9:30am [Day Time] [Elvish]>
A gnome stone excavator's slash misses you. (0) dmg
Your beating DISMEMBERS a gnome stone excavator! (46.5) dmg
Your beating maims a gnome stone excavator! (34.5) dmg
A dreadwood quarterstaff draws life from a gnome stone excavator.
A gnome stone excavator is in awful condition.
You did 81 to all creatures this round.
You took 0 from all creatures this round.
<1563/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 824g/46s
[An Uneven, Hot Corridor] [EW-NW] 9:30am [Day Time] [Elvish]>
You dodge a gnome stone excavator's attack.
A gnome stone excavator dodges your attack.
A gnome stone excavator is in awful condition.
You did 0 to all creatures this round.
You took 0 from all creatures this round.
<1563/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 824g/46s
[An Uneven, Hot Corridor] [EW-NW] 9:30am [Day Time] [Elvish]>
You block a gnome stone excavator's attack with your shield.
A gnome stone excavator dodges your attack.
Your beating maims a gnome stone excavator! (34.5) dmg
Yasan swings with his staff and sings, 'One quick blow to the cheek, and a jab to your head. A strike where you're weak, and now you're dead!'
a gnome stone excavator is DEAD!!
~
You receive 208 experience points.
You hear a gnome stone excavator's death cry.
You get 28 silver coins and 8 gold coins from the corpse of a gnome stone excavator.
0 gold and 37 silver are collected for Shalonesti_kingdom's coffers.
<1563/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 832g/37s
[An Uneven, Hot Corridor] [EW-NW] 9:30am [Day Time] [Elvish]>
You did 5704 to creatures in this battle.
You took 0 from creatures in this battle.
<1563/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 832g/37s
[An Uneven, Hot Corridor] [EW-NW] 9:30am [Day Time] [Elvish]>
TICK IN 5 SECONDS.
<1536/1536hp 1232/1232m 406/406mv 36891tnl 1797pq 242/390w 832g/37s
[An Uneven, Hot Corridor] [EW-NW] 10:00am [Day Time] [Elvish]>
Timer now at 41 secs.
==============================================================
| You did 5704 to creatures | You took 0 in the battle |
==============================================================
|
Code: |
#var attack_type {chomp|polevault kick|flame|spell|flamestrike|smash|lightning bolt|roundhouse|shock|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|kick} _nodef {General Variables|Damage Calculator}
#var damage_type {misses|maims|scratches|grazes|hits|injures|wounds|mauls|decimates|devastates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\* DEMOLISHES \*\*\*|\*\*\* DEVASTATES \*\*\*|=== OBLITERATES ===|>>> ANNIHILATES <<<|<<< ERADICATES >>>|GHASTLY|HORRID|DREADFUL|HIDEOUS|INDESCRIBABLE|UNSPEAKABLE} _nodef {General Variables|Damage Calculator}
#oninput {^add_attack (*)} {#noinput;#ADDITEM attack_type %1;#say %1 Added to attack type} {General Aliases}
#var Pcolor1 "#005700" _nodef {General Variables|Damage Calculator}
#var Pcolor2 "#FFFF00" _nodef {General Variables|Damage Calculator}
#var Pcolor3 "#FF0000" _nodef {General Variables|Damage Calculator}
#var round_dmg 0 _nodef {General Variables|Damage Calculator}
#var round_dmgu 0 _nodef {General Variables|Damage Calculator}
#wait 400
#say Loading Battle Variable...
#var Battle 0 0 {General Variables|Damage Calculator}
#var Total_dmg 0 0 {General Variables|Damage Calculator}
#var Total_dmgu 0 0 {General Variables|Damage Calculator}
#var attack_type {chomp|polevault kick|flame|spell|flamestrike|smash|lightning bolt|roundhouse|shock|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|kick} _nodef {General Variables|Damage Calculator}
#var damage_type {misses|maims|scratches|grazes|hits|injures|wounds|mauls|decimates|devastates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\* DEMOLISHES \*\*\*|\*\*\* DEVASTATES \*\*\*|=== OBLITERATES ===|>>> ANNIHILATES <<<|<<< ERADICATES
#var condition {excellent condition|a few scratches|some small wounds and bruises|quite a few wounds|some big nasty wounds and scratches|pretty hurt|awful condition} _nodef {General Variables|Damage Calculator}
#var battle_report_your_damage 0 _nodef {General Variables|Damage Calculator}
#var battle_report_their_damage 0 _nodef {General Variables|Damage Calculator}
#oninput {^Pcolor1 (*)} {#noinput;Pcolor1=%1;#say Player Color 1 Set to: @Pcolor1} {General Aliases|Damage Calculator}
#oninput {^Pcolor2 (*)} {#noinput;Pcolor2=%1;#say Player Color 2 Set to: @Pcolor2} {General Aliases|Damage Calculator}
#oninput {^Pcolor3 (*)} {#noinput;Pcolor3=%1;#say Player Color 3 Set to: @Pcolor3} {General Aliases|Damage Calculator}
#al Pcolor {
#say {Pcolor1: <color @Pcolor1>@Pcolor1</color>}
#say {Pcolor2: <color @Pcolor2>@Pcolor2</color>}
#say {Pcolor3: <color @Pcolor3>@Pcolor3</color>} } {General Aliases|Damage Calculator}
#al add_attack { #if (%ismember(%params, @attack_type)) {
#say %params is already in the list!
} { #ADDITEM attack_type %params
#say %params Added to attack type } } {General Aliases|Damage Calculator}
#al showlist { #forall @attack_type {#wait 400;#say %i }} {General Aliases|Damage Calculator}
#al Dam_Report {
#say {<color #AAAAAA>==============================================================</color>}
#say {<color #AAAAAA>| You did @battle_report_your_damage to creatures | You took @battle_report_their_damage in the battle |</color>}
#say {<color #AAAAAA>==============================================================</color>}
} {General Aliases|Damage Calculator}
#regex Damage_Convert {^(?>\[(?: \w+){1,4} \] )?((?>[\w'-]+ ){1,5})(@attack_type) (?>does )?(@damage_type) (?>things to )?(?>a |the )?(?>[\w'-]+[ !.]){1,5}}
{
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
} { round_dmgu=@round_dmgu+$Dmg }
} {General Triggers|Damage Calculator}
#REGEX dmg_report_round {^(?:a |the |an )?(?>[\w'-]+ ){1,5}(?:has|is in|looks) (?:@condition)\.} {
#IF (@battle) {
total_dmg=@total_dmg+@round_dmg
total_dmgu=@total_dmgu+@round_dmgu
#say " "
#say {<color #AAAAAA> You did @round_dmg to all creatures this round. </color>}
#say {<color #AAAAAA> You took @round_dmgu from all creatures this round. </color>}
round_dmg=0
round_dmgu=0
}
} {General Triggers|Damage Calculator}
#TRIGGER EoB {* is DEAD!!} {
battle=0
#wait 500
#say " "
#say {<color #AAAAAA> You did @total_dmg to creatures in this battle. </color>}
#say {<color #AAAAAA> You took @total_dmgu from creatures in this battle. </color>}
battle_report_your_damage=@total_dmg
battle_report_their_damage=@total_dmgu
total_dmg=0
total_dmgu=0} {General Triggers|Damage Calculator}
|
So, that's all the stuff in the script, and what it outputs. But I'm far from done, which is why this is only a milestone, not the end. So, the following is what I need help with, if you're interested or just want to help:
1) I need to tighten up this script. I've worked hard on it, and have already had help from many of the Gurus, but I know there must be plenty of areas where I could tighten it up. Make it cleaner, more efficient, etc...
2) I have a list of features of the completed damage calculator in another post, but I will post them here:
- Damage broken down by all participants in the match, an example would be, say, two players: Throxten and Phrunk. Phrunk also has a spirit he can summon, along with some other mobs. So, the total battle has... Throxten, Phrunk, Spirit, Great Sphinx and Criosphinx. I want the amount of damage that each does, and the amount of damage each takes.
- Number of hits. Easy enough to count really, if they attack and they don't miss, then they've hit. I need this for...
- Average Damage, calculated on the number of hits in the fight by the total damage in the fight
- Damage Dealt and Taken (and maybe even averages) based on the attack_type. For instance, How much damage Throxten did with chop and lightning, and how much damage Phrunk took from chop, how much the spirit took from chop. As well as how much damage Phrunk did with roundhouse, how much the spirit did with pierce and how much Throxten took from roundhouse and pierce.
I'm sorry if it's confusing, but I hope you get the idea. The final table would be a neat, organized output report of all of these damage break downs.
I can try to get you any information you need. Though, if you are truely interested, I encourage you to make a character in the game and level it up a little so that you can get it to a decent point for testing. If you decide to do that, and need help in the game, send me a PM and I'll see what I can do. I thank you all for your help and hope that you will bear with me and continue in friendly helpfulness to complete this large project, and learning experience. |
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Wed Jun 11, 2008 8:40 pm |
Another oddity:
Quote: |
Your beating MANGLES a boreatid! (54.5) dmg
A boreatid's beating wounds you. (18.5) dmg
C'lor is in excellent condition.
You did 168.5 to all creatures this round.
You took 0 from all creatures this round.
|
Code: |
#regex Damage_Convert {^(?>\[(?: \w+){1,4} \] )?((?>[\w'-]+ ){1,5})(@attack_type) (?>does )?(@damage_type) (?>things to )?(?>a |the )?([\w'-]+[ !.]){1,5}}
{
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
}
} {General Triggers|Damage Calculator}
|
%4 is you. So why isn't it adding the damage in? |
|
|
 |
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Wed Jun 11, 2008 11:00 pm |
because %4 actually equals "you." I believe. Someone with better regex knowledge can confirm.
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Wed Jun 11, 2008 11:24 pm |
Yup, it does. No clue why I have the parentheses encapsulating the period. I checked for that too, and missed it. Thanks.
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Wed Jun 11, 2008 11:48 pm |
I'm going to try this pattern, may or may not work:
Code: |
^(?>\[(?: \w+){1,4} \] )?((?>[\w'-]+ ){1,5})(@attack_type) (?>does )?(@damage_type) (?>things to )?(?>a |the )?([\w'-]+( )?){1,5}[ !.]
|
My issue is that there's sometimes space between the words, but if there's not, it ends on a period, so space isn't always a given.
It worked, thanks for pointing that out, Toxic. Now I'm on to the other tasks at hand, which will likely require the patience and attention of the Gurus. |
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu Jun 12, 2008 12:15 am |
An interesting development:
A pattern such as:
an armored skeleton has some small wounds and bruises.
doesn't match
Code: |
(?:a |the |an )?(?>[\w'-]+ ){1,5}(?:has|is in|looks) (?:excellent condition|a few scratches|some small wounds and bruises|quite a few wounds|some big nasty wounds and scratches|pretty hurt|awful condition)\.
^(?:a |the |an )?(?>[\w'-]+ ){1,5}(?:has|is in|looks) (?:@condition)\.
|
Now, it does match in regex coach, but not in CMUD. As you can see by the previous outputs, it matches other conditions just fine. But I've noticed it consistently failing here, and I'm not sure what to make of it.
Edit:
note - the pearl regex puts a square character before small wounds and bruises, I don't know why.
Also, is there a way to view the pearl regex without a full package screen? |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Jun 12, 2008 12:25 am |
It matches when I try it. I pasted your top pattern into a new trigger, checked the regex box, and pasted your example text into the test box. So it's a problem with your code, not with the pattern.
EDIT: Hmm, that's interesting. I have no idea what could be causing that, looks like a bug unless you've got some freaky-ass character in your variable. |
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu Jun 12, 2008 1:20 am |
Code: |
#var condition {excellent condition|a few scratches|some small wounds and bruises|quite a few wounds|some big nasty wounds and scratches|pretty hurt|awful condition} _nodef {General Variables|Damage Calculator}
|
Is the variable. |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Jun 12, 2008 1:27 am |
I'm getting exactly the same result here. I'm going to post a new thread about this problem - it's probably related to the other list-related bugs and been fixed in 2.27 already, but it's best to be sure.
|
|
|
 |
Brenex Beginner
Joined: 13 May 2008 Posts: 25
|
Posted: Thu Jun 12, 2008 3:23 am |
For the record, I am using a variable list in my regex matching trigger line and I also have a square character infront of the first item in that variable list. I have to use regex alternation to account for whatever follows the square character.
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu Jun 12, 2008 4:17 am |
Yeah, it seems to be a bug. Fang made a post for it.
|
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Thu Jun 12, 2008 10:51 am |
Chamenas you know how to accumulate the damages and how to use counters right?
If %1 did 85 damage to %4, then you obviously know how much damage %1 did and how much %4 took.
Take this part and change it around:
Code: |
#IF (%1="Your ") {
round_dmg=@round_dmg+$Dmg
}
#IF (%4="you") {
round_dmgu=@round_dmgu+$Dmg
} |
Just use database records and you won't need the IF statements, since you are tracking everyone and their brother. This will store the damages for each round and keep tallying the number of hits for each person including you.
Code: |
#ADDKEY RDmgGiven {%1} {%eval( %db( @RDmgGiven, %1) + $Dmg)}
#ADDKEY RDmgTaken {%4} {%eval( %db( @RDmgTaken, %4) + $Dmg)}
#ADDKEY Hits {%1} {%eval( %db( @Hits, %1) + 1)}
|
For totals..
Code: |
#LOOPDB @RDmgGiven {#ADDKEY TDmgGiven {%key} {%eval( %db( @TDmgGiven, %key) + %val)}}
#LOOPDB @RDmgTaken {#ADDKEY TDmgTaken {%key} {%eval( %db( @TDmgTaken, %key) + %val)}}
|
There you go now you can store the damages given and taken for each round for like 20 people including yourself. Then you can get the totals for all of them at once too. Obviously you should be able to figure out how to get averages out of this. This should get you started. I'm sure someone else has a better way of doing it but at least you should be able to figure out some things.
Quote: |
Damage Dealt and Taken (and maybe even averages) based on the attack_type. For instance, How much damage Throxten did with chop and lightning, and how much damage Phrunk took from chop, how much the spirit took from chop. As well as how much damage Phrunk did with roundhouse, how much the spirit did with pierce and how much Throxten took from roundhouse and pierce. |
I don't remember that other script you showed, which you based this on, having this did it?
Well anyway...someone else can figure it out. I'm going to bed. lol |
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Thu Jun 12, 2008 3:22 pm |
hahaha, thanks Oldguy. I'll be busy the next couple of days so implementing it will be slow but it looks like you gave me a lot to work with. The only thing I worry about is multiple things of the same name, but I suppose I should just keep my testing to singular things for now? I'm assuming the addkeys only create new ones with new instances, and otherwise just update the current one, thus accounting for being able to deal with multiple amounts and yet update existing?
|
|
|
 |
|
|
|
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
|
|