hit % calculator
Posted: Fri Jul 22, 2016 9:10 pm
Wondering if anyone has a plugin that can track the % of how often you land strikes and how often your hit.
Code: Select all
This can be tweaked for any thyng...hits parry, evade..etc
Copy and then open trigger thyng on Mush and choose the Paste button
Copy each one seperate-ly
1...attack counter
__________________________________
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="^The (.*?) attacks you with (.*?)$"
regexp="y"
send_to="12"
sequence="100"
>
<send>SetVariable("Attacks",(GetVariable("Attacks") + 1))
Note("ttl-Attacks: " .. GetVariable("Attacks"))</send>
</trigger>
</triggers>
___________________
2. ..parry counter...
_______________________
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="^(.*?), but you parry the blow with your (.*?)$"
regexp="y"
send_to="12"
sequence="100"
>
<send>SetVariable("Parries",(GetVariable("Parries") + 1))
SetVariable("Attacks",(GetVariable("Attacks") + 1))
Note("ttl-Attacks: " .. GetVariable("Attacks"))
Note("Parries: " .. GetVariable("Parries"))
Note("Percentage parried: " .. ((GetVariable("parries")/GetVariable("Attacks"))*100) .. "%")</send>
</trigger>
</triggers>
____________________
and aliases....sc (show counter) and zc..(zero counter)
open Alias thyng on Mush and choose Paste button
________________________
Alias1. sc...show counter
_______________________________
<aliases>
<alias
match="sc"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>Note("Attacks: " .. GetVariable("Attacks"))
Note("Parries: " .. GetVariable("Parries"))
Note("Percentage parried: " .. ((GetVariable("parries")/GetVariable("Attacks"))*100) .. "%")</send>
</alias>
</aliases>
______________________________
Alias 2. zc..zero counter
____________________
<aliases>
<alias
match="zc"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>Note("Zeroing counters")
SetVariable("Attacks","0")
SetVariable("Parries","0")
Note("Attacks: " .. GetVariable("Attacks"))
Note("Parries: " .. GetVariable("Parries"))
</send>
</alias>
</aliases>
_____________
You should type ...zc.... to set all counters before first use
yell if ya need help..Code: Select all
<triggers>
<trigger
enabled="y"
match="You fire*"
send_to="12"
sequence="100"
>
<send>
EnableTrigger ("hit_counts", true)
</send>
</trigger>
</triggers>Code: Select all
<triggers>
<trigger
match="^The attack (.+)"
name="hit_counts"
regexp="y"
send_to="12"
sequence="50"
>
<send>
if "%1" == "misses." then
SetVariable("Misses",(GetVariable("Misses") + 1))
elseif "%1" == "is a mild prick." then
SetVariable("Mildat",(GetVariable("Mildat") + 1))
elseif "%1" == "is a minor cut." then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%1" == "is a decent strike." then
SetVariable("Decentat",(GetVariable("Decentat") + 1))
elseif "%1" == "is a solid strike." then
SetVariable("Solidat",(GetVariable("Solidat") + 1))
elseif "%1" == "is a piercing strike." then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
else
SetVariable("Gashat",(GetVariable("Gashat") + 1))
end --if
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
EnableTrigger ("hit_counts", false)
</send>
</trigger>
</triggers>Code: Select all
<triggers>
<trigger
custom_colour="17"
enabled="y"
match="(dodges your|blocks your|parries your)"
name="thwart_counts"
regexp="y"
send_to="12"
sequence="50"
other_back_colour="darkorange"
>
<send>
SetVariable("Thwarts",(GetVariable("Thwarts") + 1))
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
</send>
</trigger>
</triggers>Code: Select all
<aliases>
<alias
match="sc"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>
Note("Total Attacks: " .. GetVariable("AttackTot"))
Note("Misses: " .. GetVariable("Misses"))
Note("Percentage missed: " .. ((GetVariable("Misses")/GetVariable("AttackTot"))*100) .. "%")
Note("Mild Pricks: " .. GetVariable("Mildat"))
Note("Minor: " .. GetVariable("Minorat"))
Note("Decent: " .. GetVariable("Decentat"))
Note("Solid: " .. GetVariable("Solidat"))
Note("Pierces: " .. GetVariable("Pierceat"))
Note("Gashes: " .. GetVariable("Gashat"))
Note("Thwarts: " .. GetVariable("Thwarts"))
</send>
</alias>
</aliases>Code: Select all
<aliases>
<alias
match="zc"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>Note("Zeroing counters")
SetVariable("AttackTot","0")
SetVariable("Misses","0")
SetVariable("Mildat","0")
SetVariable("Minorat","0")
SetVariable("Decentat","0")
SetVariable("Solidat","0")
SetVariable("Pierceat","0")
SetVariable("Gashat","0")
SetVariable("Thwarts","0")
EnableTrigger ("hit_counts", false)
</send>
</alias>
</aliases>Code: Select all
<triggers>
<trigger
enabled="y"
lines_to_match="2"
match="(You fire )(.*?)\sThe attack (.+)\Z"
multi_line="y"
name="new_shot"
regexp="y"
send_to="12"
sequence="100"
>
<send>if "%3" == "misses." then
SetVariable("Misses",(GetVariable("Misses") + 1))
SetVariable("Misstot",(GetVariable("Misstot") + 1))
elseif "%3" == "is a mild prick." then
SetVariable("Mildat",(GetVariable("Mildat") + 1))
elseif "%3" == "is a minor cut." then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%3" == "is a decent strike." then
SetVariable("Decentat",(GetVariable("Decentat") + 1))
elseif "%3" == "is a solid strike." then
SetVariable("Solidat",(GetVariable("Solidat") + 1))
elseif "%3" == "is a piercing strike." then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%3" == "is a severe gash." then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%3" == "is a critical puncture." then
SetVariable("Critat",(GetVariable("Critat") + 1))
else
SetVariable("Misses",(GetVariable("Misses") + 1))
SetVariable("Misstot",(GetVariable("Misstot") + 1))
end --if
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))</send>
</trigger>
</triggers>
Code: Select all
<triggers>
<trigger
enabled="y"
group="ChkBlock"
lines_to_match="2"
match="(blocks your attack)(.*?)\s\[Delay\: 4\.0 sec\.\]\Z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>
SetVariable("Thwarts",(GetVariable("Thwarts") + 1))
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("Thwarttot",(GetVariable("Thwarttot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))</send>
</trigger>
</triggers>Code: Select all
<triggers>
<trigger
custom_colour="17"
enabled="y"
match="(dodges your|parries your)"
name="thwart_counts"
regexp="y"
send_to="12"
sequence="50"
other_back_colour="darkorange"
>
<send>
SetVariable("Thwarts",(GetVariable("Thwarts") + 1))
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("Thwarttot",(GetVariable("Thwarttot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))
</send>
</trigger>
</triggers>Code: Select all
<aliases>
<alias
match="sc"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>
local fpercnt = string.format ("%.2f",100-(GetVariable("Misses")/GetVariable("AttackTot"))*100)
Note("TotalAttacks: " .. GetVariable("AttackTot") .. " Misses: " .. GetVariable("Misses") .. " HitPercent: " .. fpercnt .. "%")
Note("Pricks: " .. GetVariable("Mildat") .. " Minor: " .. GetVariable("Minorat") .. " Decent: " .. GetVariable("Decentat") .. " Solid: " .. GetVariable("Solidat") .. " Pierce: " .. GetVariable("Pierceat") .. " Gash: " .. GetVariable("Gashat") .. " Crit: " .. GetVariable("Critat") .. " Thwarted: " .. GetVariable("Thwarts"))
local percnt = string.format ("%.2f",100-(GetVariable("Misstot")/GetVariable("GrandTot"))*100)
local dpercnt = string.format ("%.2f",100-((GetVariable("Misstot")+GetVariable("Thwarttot"))/GetVariable("GrandTot"))*100)
Note("Session totals:")
Note("Attacks: " .. GetVariable("GrandTot") .. " Misses: " .. GetVariable("MissTot") .. " Thwarts: " .. GetVariable("Thwarttot") .. " PercentGoodHits: " .. percnt .. "%" .. " PercentDamageHits: " .. dpercnt .. "%")</send>
</alias>
</aliases>Code: Select all
<aliases>
<alias
match="zc"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>Note("Zeroing counters")
SetVariable("AttackTot","0")
SetVariable("Misses","0")
SetVariable("Mildat","0")
SetVariable("Minorat","0")
SetVariable("Decentat","0")
SetVariable("Solidat","0")
SetVariable("Pierceat","0")
SetVariable("Gashat","0")
SetVariable("Critat","0")
SetVariable("Thwarts","0")
EnableTrigger ("hit_counts", false)
</send>
</alias>
</aliases>Code: Select all
<aliases>
<alias
match="zcz"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>Note("Zeroing session counters")
SetVariable("GrandTot","0")
SetVariable("Misstot","0")
SetVariable("Thwarttot","0")
</send>
</alias>
</aliases>Code: Select all
------------------------------
The actual counting trigger
-------------------------------
<triggers>
<trigger
enabled="y"
lines_to_match="2"
match="(You thrust |You attack |You swing |You fire).*?\sThe attack (misses|(.+))\.\Z"
multi_line="y"
name="attackCount"
regexp="y"
send_to="12"
sequence="100"
>
<send>if "%2" == "misses" then
SetVariable("Misses",(GetVariable("Misses") + 1))
SetVariable("Misstot",(GetVariable("Misstot") + 1))
elseif "%2" == "is a mild prick" then
SetVariable("Mildat",(GetVariable("Mildat") + 1))
elseif "%2" == "is a mild scratch" then
SetVariable("Mildat",(GetVariable("Mildat") + 1))
elseif "%2" == "is a minor cut" then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%2" == "is a glancing blow" then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%2" == "is a grazing cut" then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%2" == "is a decent strike" then
SetVariable("Decentat",(GetVariable("Decentat") + 1))
elseif "%2" == "is a decent slice" then
SetVariable("Decentat",(GetVariable("Decentat") + 1))
elseif "%2" == "is a solid strike" then
SetVariable("Solidat",(GetVariable("Solidat") + 1))
elseif "%2" == "is a solid swing" then
SetVariable("Solidat",(GetVariable("Solidat") + 1))
elseif "%2" == "is a piercing strike" then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%2" == "is a powerful bash" then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%2" == "is a powerful slash" then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%2" == "is a severe gash" then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%2" == "is a severe laceration" then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%2" == "is a severe crunch" then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%2" == "is a critical puncture" then
SetVariable("Critat",(GetVariable("Critat") + 1))
elseif "%2" == "is a critical strike" then
SetVariable("Critat",(GetVariable("Critat") + 1))
elseif "%2" == "is a critical blow" then
SetVariable("Critat",(GetVariable("Critat") + 1))
else
SetVariable("Misses",(GetVariable("Misses") + 1))
SetVariable("Misstot",(GetVariable("Misstot") + 1))
end --if
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))</send>
</trigger>
</triggers>
-------------------------------
Catch the dodges and parries
--------------------------------
<triggers>
<trigger
enabled="y"
match="(dodges your|parries your)"
name="thwart_counts"
regexp="y"
send_to="12"
sequence="50"
other_back_colour="darkorange"
>
<send>
SetVariable("Thwarts",(GetVariable("Thwarts") + 1))
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("Thwarttot",(GetVariable("Thwarttot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))
</send>
</trigger>
</triggers>
----------------------------------------
Catch the blocks
----------------------------------------
<triggers>
<trigger
enabled="y"
group="ChkBlock"
lines_to_match="2"
match="(blocks your attack)(.*?)\s\[Delay\: 4\.0 sec\.\]\Z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>Note("it was blocked")
SetVariable("Thwarts",(GetVariable("Thwarts") + 1))
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("Thwarttot",(GetVariable("Thwarttot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))</send>
</trigger>
</triggers>
---------------------------------------
Alias to clear the variables
---------------------------------------
<aliases>
<alias
match="zc"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>Note("Zeroing counters")
SetVariable("AttackTot","0")
SetVariable("Misses","0")
SetVariable("Mildat","0")
SetVariable("Minorat","0")
SetVariable("Decentat","0")
SetVariable("Solidat","0")
SetVariable("Pierceat","0")
SetVariable("Gashat","0")
SetVariable("Critat","0")
SetVariable("Thwarts","0")
EnableTrigger ("hit_counts", false)
</send>
</alias>
</aliases>
-------------------------------------------
Alias to clear the grand total counters
----------------------------------------------
<aliases>
<alias
match="zcz"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>Note("Zeroing session counters")
SetVariable("GrandTot","0")
SetVariable("Misstot","0")
SetVariable("Thwarttot","0")
</send>
</alias>
</aliases>
---------------------------------------------
Alias to see the count
---------------------------------------------
<aliases>
<alias
match="sc"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>
local fpercnt = string.format ("%.2f",100-(GetVariable("Misses")/GetVariable("AttackTot"))*100)
Note("TotalAttacks: " .. GetVariable("AttackTot") .. " Misses: " .. GetVariable("Misses") .. " HitPercent: " .. fpercnt .. "%")
Note("Pricks: " .. GetVariable("Mildat") .. " Minor: " .. GetVariable("Minorat") .. " Decent: " .. GetVariable("Decentat") .. " Solid: " .. GetVariable("Solidat") .. " Pierce: " .. GetVariable("Pierceat") .. " Gash: " .. GetVariable("Gashat") .. " Crit: " .. GetVariable("Critat") .. " Thwarted: " .. GetVariable("Thwarts"))
local percnt = string.format ("%.2f",100-(GetVariable("Misstot")/GetVariable("GrandTot"))*100)
local dpercnt = string.format ("%.2f",100-((GetVariable("Misstot")+GetVariable("Thwarttot"))/GetVariable("GrandTot"))*100)
Note("Session totals:")
Note("Attacks: " .. GetVariable("GrandTot") .. " Misses: " .. GetVariable("MissTot") .. " Thwarts: " .. GetVariable("Thwarttot") .. " PercentGoodHits: " .. percnt .. "%" .. " PercentDamageHits: " .. dpercnt .. "%")</send>
</alias>
</aliases>
Code: Select all
<triggers>
<trigger
enabled="y"
group="ChkBlock"
lines_to_match="2"
match="(blocks your attack)(.*?)\s\[Delay\: (4|6)\.0 sec\.\]\Z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>Note("it was blocked")
SetVariable("Thwarts",(GetVariable("Thwarts") + 1))
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("Thwarttot",(GetVariable("Thwarttot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))</send>
</trigger>
</triggers>Code: Select all
<triggers>
<trigger
enabled="y"
group="Hit Counter"
lines_to_match="2"
match="(You thrust |You attack |You swing |You fire).*?\sThe attack (misses|(.+))\.\Z"
multi_line="y"
name="attackCount"
regexp="y"
send_to="12"
sequence="100"
>
<send>if "%2" == "misses" then
SetVariable("Misses",(GetVariable("Misses") + 1))
SetVariable("Misstot",(GetVariable("Misstot") + 1))
elseif "%2" == "is a mild prick" then
SetVariable("Mildat",(GetVariable("Mildat") + 1))
elseif "%2" == "is a mild scratch" then
SetVariable("Mildat",(GetVariable("Mildat") + 1))
elseif "%2" == "is a minor cut" then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%2" == "is a glancing blow" then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%2" == "is a grazing cut" then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%2" == "is a decent strike" then
SetVariable("Decentat",(GetVariable("Decentat") + 1))
elseif "%2" == "is a decent slice" then
SetVariable("Decentat",(GetVariable("Decentat") + 1))
elseif "%2" == "is a solid strike" then
SetVariable("Solidat",(GetVariable("Solidat") + 1))
elseif "%2" == "is a solid swing" then
SetVariable("Solidat",(GetVariable("Solidat") + 1))
elseif "%2" == "is a piercing strike" then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%2" == "is a powerful bash" then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%2" == "is a powerful slash" then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%2" == "is a severe gash" then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%2" == "is a severe laceration" then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%2" == "is a severe crunch" then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%2" == "is a critical puncture" then
SetVariable("Critat",(GetVariable("Critat") + 1))
elseif "%2" == "is a critical strike" then
SetVariable("Critat",(GetVariable("Critat") + 1))
elseif "%2" == "is a critical blow" then
SetVariable("Critat",(GetVariable("Critat") + 1))
else
SetVariable("Misses",(GetVariable("Misses") + 1))
SetVariable("Misstot",(GetVariable("Misstot") + 1))
end --if
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))</send>
</trigger>
</triggers>
I've torn it all out, built it back up, can't seem to get the new one working. Tried to put the old one back in, getting the same concept of error now. I didn't edit anything before I started getting the errors.Error number: 0
Event: Compile error
Description: [string "Trigger: attackCount"]:2: unexpected symbol near ' '
Called by: Immediate execution
Code: Select all
<triggers>
<trigger
enabled="y"
group="Hit Counter"
lines_to_match="2"
match="(You fire |You attack |You thrust |You swing )(.*?)\sThe attack (.+)\Z"
multi_line="y"
name="AttackCount"
regexp="y"
send_to="12"
sequence="100"
>
<send>if "%3" == "misses." then
SetVariable("Misses",(GetVariable("Misses") + 1))
SetVariable("Misstot",(GetVariable("Misstot") + 1))
elseif "%3" == "is a mild prick." then
SetVariable("Mildat",(GetVariable("Mildat") + 1))
elseif "%3" == "is a mild scratch." then
SetVariable("Mildat",(GetVariable("Mildat") + 1))
elseif "%3" == "is a minor cut." then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%3" == "is a glancing blow." then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%3" == "is a grazing cut." then
SetVariable("Minorat",(GetVariable("Minorat") + 1))
elseif "%3" == "is a decent strike." then
SetVariable("Decentat",(GetVariable("Decentat") + 1))
elseif "%3" == "is a decent slice." then
SetVariable("Decentat",(GetVariable("Decentat") + 1))
elseif "%3" == "is a solid strike." then
SetVariable("Solidat",(GetVariable("Solidat") + 1))
elseif "%3" == "is a solid swing." then
SetVariable("Solidat",(GetVariable("Solidat") + 1))
elseif "%3" == "is a piercing strike." then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%3" == "is a powerful bash." then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%3" == "is a powerful slash." then
SetVariable("Pierceat",(GetVariable("Pierceat") + 1))
elseif "%3" == "is a severe gash." then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%3" == "is a severe laceration." then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%3" == "is a severe crunch." then
SetVariable("Gashat",(GetVariable("Gashat") + 1))
elseif "%3" == "is a critical puncture." then
SetVariable("Critat",(GetVariable("Critat") + 1))
elseif "%3" == "is a critical strike." then
SetVariable("Critat",(GetVariable("Critat") + 1))
elseif "%3" == "is a critical blow." then
SetVariable("Critat",(GetVariable("Critat") + 1))
else
SetVariable("Misses",(GetVariable("Misses") + 1))
SetVariable("Misstot",(GetVariable("Misstot") + 1))
end --if
SetVariable("AttackTot",(GetVariable("AttackTot") + 1))
SetVariable("GrandTot",(GetVariable("GrandTot") + 1))</send>
</trigger>
</triggers>