| Message |
I added line colouring to show what was happening. A few minor problems, fixed as so:
<triggers>
<trigger
group="battle"
match="<*"
name="multihit_stopper"
send_to="12"
sequence="40"
>
<send>
EnableTrigger ("multihit_line", false)
EnableTrigger ("multihit_stopper", false)
if not multihit_table or next (multihit_table) == nil then
print ("No damage.")
else
table.sort (multihit_table)
print ("Your Multihit Damage:")
local total = 0
for _, item in ipairs (multihit_table) do
print (item)
total = total + tonumber (item)
end -- for
print ("Total damage =", total)
end -- if some damage
multihit_table = {} -- for next time
</send>
</trigger>
<trigger
custom_colour="1"
group="battle"
keep_evaluating="y"
match="\[(\d+)\]$"
name="multihit_line"
regexp="y"
send_to="12"
sequence="100"
>
<send>
table.insert (multihit_table, "%1")
</send>
</trigger>
<trigger
custom_colour="3"
enabled="y"
group="battle"
keep_evaluating="y"
match="^\.\.\.your revenge death ball pushes."
regexp="y"
send_to="12"
sequence="100"
>
<send>
multihit_table = multihit_table or {}
EnableTrigger ("multihit_line", true)
EnableTrigger ("multihit_stopper", true)
</send>
</trigger>
</triggers>
 |
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
One problem was that you had "your revenge death ball pushes" resetting the table to empty, so naturally it only remembered the last one.
Now with this test data:
You hold up both hands while screaming out in rage, a huge black ball of ki quickly appears above you. The ball continues to expand as red bolts of lightning crackle around
it, with a sudden jolt you throw the massive Revenge Death Ball at Fire Spirit.
...your revenge death ball pushes Fire Spirit into the ground!
[========]=-=[49824]
...your revenge death ball pushes Fire Spirit into the ground!
[======--]=-=[50034]
...your revenge death ball pushes Fire Spirit into the ground!
[=====---]=-=[50187]
...your revenge death ball pushes Fire Spirit into the ground!
[=====---]=-=[50082]
...your revenge death ball pushes Fire Spirit into the ground!
[====----]=-=[50221]
<15 hp>
I get:
Your Multihit Damage:
49824
50034
50082
50187
50221
Total damage = 250348
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|