From 38c60388926da889d602f954a8b65927214aa78c Mon Sep 17 00:00:00 2001 From: ccubed Date: Mon, 17 Jun 2024 03:52:13 -0400 Subject: [PATCH] Switch to tempregextriggers --- src/aliases/bashmatic/BM_Config.lua | 28 ++++++++++++------------ src/scripts/bashmatic/bashmatic_init.lua | 7 +++--- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/aliases/bashmatic/BM_Config.lua b/src/aliases/bashmatic/BM_Config.lua index e7e607e..ddaba3b 100644 --- a/src/aliases/bashmatic/BM_Config.lua +++ b/src/aliases/bashmatic/BM_Config.lua @@ -4,40 +4,40 @@ cecho("See bm help for information on configuration.") cecho("") cecho("\nBattle Commands:") if Bashmatic.commands.start then - cecho("-- Start : " .. Bashmatic.commands.start) + cecho("\n-- Start : " .. Bashmatic.commands.start) else - cecho("-- Start : Not Set.") + cecho("\n-- Start : Not Set.") end if Bashmatic.commands.before then - cecho("-- Before : " .. Bashmatic.commands.before) + cecho("\n-- Before : " .. Bashmatic.commands.before) else - cecho("-- Before : Not Set.") + cecho("\n-- Before : Not Set.") end if Bashmatic.commands.during then - cecho("-- During : " .. Bashmatic.commands.during .. "(Every " .. Bashmatic.commands.duringTime .. "s)") + cecho("\n-- During : " .. Bashmatic.commands.during .. "(Every " .. Bashmatic.commands.duringTime .. "s)") else - cecho("-- During : Not Set.") + cecho("\n-- During : Not Set.") end if Bashmatic.commands.after then - cecho("-- After : " .. Bashmatic.commands.after) + cecho("\n-- After : " .. Bashmatic.commands.after) else - cecho("-- After : Not Set.") + cecho("\n-- After : Not Set.") end cecho("\n\nDeath Trigger:") if Bashmatic.death.phrase then - cecho("-- Phrase: " .. Bashmatic.death.phrase) + cecho("\n-- Phrase: " .. Bashmatic.death.phrase) else - cecho("-- Phrase: Not Set.") + cecho("\n-- Phrase: Not Set.") end if Bashmatic.death.event then - cecho("-- Activated?: Yes") + cecho("\n-- Activated?: Yes") else - cecho("-- Activated?: No") + cecho("\n-- Activated?: No") end cecho("\n\nEnemies:") if Bashmatic.enemies.group then - cecho("-- Grouping Enemies by Areas: Yes") + cecho("\n-- Grouping Enemies by Areas: Yes") else - cecho("-- Grouping Enemies by Areas: No") + cecho("\n-- Grouping Enemies by Areas: No") end cecho("") \ No newline at end of file diff --git a/src/scripts/bashmatic/bashmatic_init.lua b/src/scripts/bashmatic/bashmatic_init.lua index 8e00052..a5eb3c2 100644 --- a/src/scripts/bashmatic/bashmatic_init.lua +++ b/src/scripts/bashmatic/bashmatic_init.lua @@ -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