Switch to tempregextriggers
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Charles Click 2024-06-17 03:52:13 -04:00
parent d9e43baf4a
commit 38c6038892
Signed by: roryejinn
GPG Key ID: EDECB89DEDB998C0
2 changed files with 18 additions and 17 deletions

View File

@ -4,40 +4,40 @@ cecho("<DarkSlateBlue>See bm help for information on configuration.")
cecho("<DarkSlateBlue>") cecho("<DarkSlateBlue>")
cecho("<MediumPurple>\nBattle Commands:") cecho("<MediumPurple>\nBattle Commands:")
if Bashmatic.commands.start then if Bashmatic.commands.start then
cecho("<DarkSlateBlue>-- Start : " .. Bashmatic.commands.start) cecho("\n<DarkSlateBlue>-- Start : " .. Bashmatic.commands.start)
else else
cecho("<DarkSlateBlue>-- Start : Not Set.") cecho("\n<DarkSlateBlue>-- Start : Not Set.")
end end
if Bashmatic.commands.before then if Bashmatic.commands.before then
cecho("<DarkSlateBlue>-- Before : " .. Bashmatic.commands.before) cecho("\n<DarkSlateBlue>-- Before : " .. Bashmatic.commands.before)
else else
cecho("<DarkSlateBlue>-- Before : Not Set.") cecho("\n<DarkSlateBlue>-- Before : Not Set.")
end end
if Bashmatic.commands.during then if Bashmatic.commands.during then
cecho("<DarkSlateBlue>-- During : " .. Bashmatic.commands.during .. "(Every " .. Bashmatic.commands.duringTime .. "s)") cecho("\n<DarkSlateBlue>-- During : " .. Bashmatic.commands.during .. "(Every " .. Bashmatic.commands.duringTime .. "s)")
else else
cecho("<DarkSlateBlue>-- During : Not Set.") cecho("\n<DarkSlateBlue>-- During : Not Set.")
end end
if Bashmatic.commands.after then if Bashmatic.commands.after then
cecho("<DarkSlateBlue>-- After : " .. Bashmatic.commands.after) cecho("\n<DarkSlateBlue>-- After : " .. Bashmatic.commands.after)
else else
cecho("<DarkSlateBlue>-- After : Not Set.") cecho("\n<DarkSlateBlue>-- After : Not Set.")
end end
cecho("<MediumPurple>\n\nDeath Trigger:") cecho("<MediumPurple>\n\nDeath Trigger:")
if Bashmatic.death.phrase then if Bashmatic.death.phrase then
cecho("<DarkSlateBlue>-- Phrase: " .. Bashmatic.death.phrase) cecho("\n<DarkSlateBlue>-- Phrase: " .. Bashmatic.death.phrase)
else else
cecho("<DarkSlateBlue>-- Phrase: Not Set.") cecho("\n<DarkSlateBlue>-- Phrase: Not Set.")
end end
if Bashmatic.death.event then if Bashmatic.death.event then
cecho("<DarkSlateBlue>-- Activated?: Yes") cecho("\n<DarkSlateBlue>-- Activated?: Yes")
else else
cecho("<DarkSlateBlue>-- Activated?: No") cecho("\n<DarkSlateBlue>-- Activated?: No")
end end
cecho("<MediumPurple>\n\nEnemies:") cecho("<MediumPurple>\n\nEnemies:")
if Bashmatic.enemies.group then if Bashmatic.enemies.group then
cecho("<DarkSlateBlue>-- Grouping Enemies by Areas: Yes") cecho("\n<DarkSlateBlue>-- Grouping Enemies by Areas: Yes")
else else
cecho("<DarkSlateBlue>-- Grouping Enemies by Areas: No") cecho("\n<DarkSlateBlue>-- Grouping Enemies by Areas: No")
end end
cecho("<reset>") cecho("<reset>")

View File

@ -90,19 +90,20 @@ end
-- Functions for handling inline matching -- Functions for handling inline matching
function handleBashingMatches(match) function handleBashingMatches()
local keyword = matches[1]
if not Bashmatic.enabled or Bashmatic.bashing then if not Bashmatic.enabled or Bashmatic.bashing then
-- bashing is disabled or we're currently bashing something, so clear the triggers -- bashing is disabled or we're currently bashing something, so clear the triggers
killBashingTriggers() killBashingTriggers()
else else
if Bashmatic.commands.before then send(Bashmatic.commands.before) end if Bashmatic.commands.before then send(Bashmatic.commands.before) end
send(Bashmatic.commands.start .. match) send(Bashmatic.commands.start .. " " .. keyword)
if Bashmatic.commands.during then tempTimer(Bashmatic.commands.duringTime,handleDuringTick) end if Bashmatic.commands.during then tempTimer(Bashmatic.commands.duringTime,handleDuringTick) end
end end
end end
function bmCreateTrigger(keyword) function bmCreateTrigger(keyword)
table.insert(Bashmatic.hunting.events, tempTrigger(keyword, handleBashingMatches(keyword), 1)) table.insert(Bashmatic.hunting.events, tempRegexTrigger(".*" .. keyword .. ".*", handleBashingMatches, 1))
end end
-- Functions for handling adding targets -- Functions for handling adding targets