Hiya,
I'm trying to write a plugin that will compact multi line damage output into a single line, ie:
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
---> [7] Your hammering blow does UNIMAGINABLE things to Barney the Loser! [1753] [250]
To do this, I have 2 triggers, one to detect when it's a line of damage output, and one to detect when it's not a line of damage output. I'm using omit_from_output for both, and also need to do so for the latter, because I want the compressed line to appear above the triggering non-damageoutput line.
The problem is however, that sometimes the 2nd trigger does not seem to omit the output properly.
Something like:
You daze Barney the Loser with a series of hammering blows!
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [248]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [247]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [247]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [247]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [247]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [248]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [248]
[10] Your pierce does UNBELIEVABLE things to Barney the Loser! [20770]
becomes
You daze Barney the Loser with a series of hammering blows!
[8] Your pierce does UNBELIEVABLE things to Barney the Loser! [16626]
[7] Your hammering blow does UNIMAGINABLE things to Barney the Loser! [1753] [250]
[8] Your pierce does UNBELIEVABLE things to Barney the Loser! [16626]
as opposed to (as the line above should be omitted)
[7] Your hammering blow does UNIMAGINABLE things to Barney the Loser! [1753] [250]
[8] Your pierce does UNBELIEVABLE things to Barney the Loser! [16626]
The strange thing is that this does not always happen. When I tried to fix it before by messing with triggers etc, sometimes it magically starts to omit properly, and continues to do so despite changing it back to the original code that did not work.
Thanks for any help :)
I'm trying to write a plugin that will compact multi line damage output into a single line, ie:
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
Your hammering blow <->*<=> WASTES <=>*<-> Barney the Loser! [214]
---> [7] Your hammering blow does UNIMAGINABLE things to Barney the Loser! [1753] [250]
To do this, I have 2 triggers, one to detect when it's a line of damage output, and one to detect when it's not a line of damage output. I'm using omit_from_output for both, and also need to do so for the latter, because I want the compressed line to appear above the triggering non-damageoutput line.
<trigger
enabled="y"
match="^(.+) (hammering blow|frenzied attack|whipping|faith|heavenly balance) (?:lotsofverbshere) (.+) \[(\d+)\]$"
regexp="y"
name="CombatRoundtrig"
script="CombatRound"
keep_evaluating="y"
omit_from_output="y"
sequence="100"
> </trigger>
<trigger
enabled="n"
match="^((?!.+ (?:hammering blow|frenzied attack|whipping|faith|heavenly balance) (?:lotsofverbsheretoo) (?:.+) \[(?:\d+)\]).)*$"
regexp="y"
name="NotCombatRound"
script="CombatRoundEnd"
omit_from_output="y"
keep_evaluating="y"
sequence="100"
> </trigger>
function CombatRound (name,line,wildcards)
EnableTrigger("NotCombatRound",true)
Rounds = Rounds+1
User = wildcards[1]
Skilltype=wildcards[2]
Target = wildcards[3]
DamageDone = DamageDone+wildcards[4]
end
function CombatRoundEnd(name,line,wildcards,styles)
if User=="Your" then
linecolour="lime"
elseif Target=="you!" or Target=="you." then
linecolour="red"
else
linecolour="silver"
end
ColourTell(linecolour,"black","["..Rounds.."] "..User.." "..Skilltype.." ")
OutputDamverb(DamageDone)
ColourTell(linecolour,"black"," "..Target.." ","red","black","["..DamageDone.."] ["..string.format( "%.0f",DamageDone/Rounds).."]")
Note("")
for _, v in ipairs (styles) do
ColourTell (RGBColourToName (v.textcolour),RGBColourToName (v.backcolour),v.text)
end
Note ("")
EnableTrigger("NotCombatRound",false)
Rounds = 0
Target = ""
User = ""
Skilltype = ""
DamageDone = 0
end
The problem is however, that sometimes the 2nd trigger does not seem to omit the output properly.
Something like:
You daze Barney the Loser with a series of hammering blows!
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [248]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [247]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [247]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [247]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [247]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [248]
Your hammering blow <*><*><*><*> ANNIHILATES <*><*><*><*> Barney the Loser! [248]
[10] Your pierce does UNBELIEVABLE things to Barney the Loser! [20770]
becomes
You daze Barney the Loser with a series of hammering blows!
[8] Your pierce does UNBELIEVABLE things to Barney the Loser! [16626]
[7] Your hammering blow does UNIMAGINABLE things to Barney the Loser! [1753] [250]
[8] Your pierce does UNBELIEVABLE things to Barney the Loser! [16626]
as opposed to (as the line above should be omitted)
[7] Your hammering blow does UNIMAGINABLE things to Barney the Loser! [1753] [250]
[8] Your pierce does UNBELIEVABLE things to Barney the Loser! [16626]
The strange thing is that this does not always happen. When I tried to fix it before by messing with triggers etc, sometimes it magically starts to omit properly, and continues to do so despite changing it back to the original code that did not work.
Thanks for any help :)