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("<MediumPurple>\nBattle Commands:")
if Bashmatic.commands.start then
cecho("<DarkSlateBlue>-- Start : " .. Bashmatic.commands.start)
cecho("\n<DarkSlateBlue>-- Start : " .. Bashmatic.commands.start)
else
cecho("<DarkSlateBlue>-- Start : Not Set.")
cecho("\n<DarkSlateBlue>-- Start : Not Set.")
end
if Bashmatic.commands.before then
cecho("<DarkSlateBlue>-- Before : " .. Bashmatic.commands.before)
cecho("\n<DarkSlateBlue>-- Before : " .. Bashmatic.commands.before)
else
cecho("<DarkSlateBlue>-- Before : Not Set.")
cecho("\n<DarkSlateBlue>-- Before : Not Set.")
end
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
cecho("<DarkSlateBlue>-- During : Not Set.")
cecho("\n<DarkSlateBlue>-- During : Not Set.")
end
if Bashmatic.commands.after then
cecho("<DarkSlateBlue>-- After : " .. Bashmatic.commands.after)
cecho("\n<DarkSlateBlue>-- After : " .. Bashmatic.commands.after)
else
cecho("<DarkSlateBlue>-- After : Not Set.")
cecho("\n<DarkSlateBlue>-- After : Not Set.")
end
cecho("<MediumPurple>\n\nDeath Trigger:")
if Bashmatic.death.phrase then
cecho("<DarkSlateBlue>-- Phrase: " .. Bashmatic.death.phrase)
cecho("\n<DarkSlateBlue>-- Phrase: " .. Bashmatic.death.phrase)
else
cecho("<DarkSlateBlue>-- Phrase: Not Set.")
cecho("\n<DarkSlateBlue>-- Phrase: Not Set.")
end
if Bashmatic.death.event then
cecho("<DarkSlateBlue>-- Activated?: Yes")
cecho("\n<DarkSlateBlue>-- Activated?: Yes")
else
cecho("<DarkSlateBlue>-- Activated?: No")
cecho("\n<DarkSlateBlue>-- Activated?: No")
end
cecho("<MediumPurple>\n\nEnemies:")
if Bashmatic.enemies.group then
cecho("<DarkSlateBlue>-- Grouping Enemies by Areas: Yes")
cecho("\n<DarkSlateBlue>-- Grouping Enemies by Areas: Yes")
else
cecho("<DarkSlateBlue>-- Grouping Enemies by Areas: No")
cecho("\n<DarkSlateBlue>-- Grouping Enemies by Areas: No")
end
cecho("<reset>")

View File

@ -90,19 +90,20 @@ end
-- Functions for handling inline matching
function handleBashingMatches(match)
function handleBashingMatches()
local keyword = matches[1]
if not Bashmatic.enabled or Bashmatic.bashing then
-- bashing is disabled or we're currently bashing something, so clear the triggers
killBashingTriggers()
else
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
end
end
function bmCreateTrigger(keyword)
table.insert(Bashmatic.hunting.events, tempTrigger(keyword, handleBashingMatches(keyword), 1))
table.insert(Bashmatic.hunting.events, tempRegexTrigger(".*" .. keyword .. ".*", handleBashingMatches, 1))
end
-- Functions for handling adding targets