Added a new lowercase option
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Charles Click 2024-06-17 13:01:44 -04:00
parent 45f52cd640
commit ee3bbdb2f8
Signed by: roryejinn
GPG Key ID: EDECB89DEDB998C0
5 changed files with 21 additions and 6 deletions

View File

@ -12,6 +12,7 @@ Again, it's very generic. Because of that it supports pretty much anywhere that
* Supports detecting areas using the mudlet mapper * Supports detecting areas using the mudlet mapper
* Supports detecting enemies by creating temp triggers based on target names * Supports detecting enemies by creating temp triggers based on target names
* Provides a function `bmDisable()` that will disable the basher so you can rig a flee/wimpy trigger/alias * Provides a function `bmDisable()` that will disable the basher so you can rig a flee/wimpy trigger/alias
* Can convert targets to lowercase for some weird muds that use proper casing in display but not in targetting
# Can I use this on my mud? # Can I use this on my mud?
I don't know. Many muds have rules against this kind of script. Just as many muds don't care if you use a script like this. Yet more sit somewhere in the middle. It's your responsibility to know where the rules on your mud stand. I don't know. Many muds have rules against this kind of script. Just as many muds don't care if you use a script like this. Yet more sit somewhere in the middle. It's your responsibility to know where the rules on your mud stand.

View File

@ -40,4 +40,9 @@ if Bashmatic.enemies.group then
else else
cecho("\n<DarkSlateBlue>-- Grouping Enemies by Areas: No") cecho("\n<DarkSlateBlue>-- Grouping Enemies by Areas: No")
end end
if Bashmatic.enemies.lowercase then
cecho("\n<DarkSlateBlue>-- Sending Targets Lowercase: Yes")
else
cecho("\n<DarkSlateBlue>-- Sending Targets Lowercase: No")
end
cecho("<reset>") cecho("<reset>")

View File

@ -6,7 +6,7 @@ if which == "phrase" then
killTrigger(Bashmatic.death.event) killTrigger(Bashmatic.death.event)
end end
Bashmatic.death.phrase = matches[3] Bashmatic.death.phrase = matches[3]
Bashmatic.death.event = tempTrigger(Bashmatic.death.phrase,handleMobDeath) Bashmatic.death.event = tempRegexTrigger(".*" .. Bashmatic.death.phrase .. ".*",handleMobDeath)
cecho("<DarkSlateBlue>Bashmatic: Reset the death event trigger phrase to " .. matches[3] .. ".<reset>") cecho("<DarkSlateBlue>Bashmatic: Reset the death event trigger phrase to " .. matches[3] .. ".<reset>")
elseif which == "start" then elseif which == "start" then
-- starting battle command -- starting battle command
@ -28,6 +28,14 @@ elseif which == "after" then
-- after battle command -- after battle command
Bashmatic.commands.after = matches[3] Bashmatic.commands.after = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[3] .. " after combat.<reset>") cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[3] .. " after combat.<reset>")
elseif which == "lowercase" then
-- Converting target to lowercase in battle start command
Bashmatic.enemies.lowercase = not Bashmatic.enemies.lowercase
if Bashmatic.enemies.lowercase then
cecho("<DarkSlateBlue>Bashmatic: Will now convert targets to lowercase in starting command.")
else
cecho("<DarkSlateBlue>Bashmatic: Will no longer convert targets to lowercase in starting command.")
end
elseif which == "group" then elseif which == "group" then
-- group by area -- group by area
if #getRooms() == 0 then if #getRooms() == 0 then

View File

@ -22,6 +22,7 @@ bmc during - commands to execute during combat.
bmc duringTime - time delay between during command execution. Default 2 seconds. Wants a number. bmc duringTime - time delay between during command execution. Default 2 seconds. Wants a number.
bmc after - commands to execute after the death trigger fires. bmc after - commands to execute after the death trigger fires.
bmc group - set to yes or no to toggle grouping enemies by mudlet mapper areas on or off bmc group - set to yes or no to toggle grouping enemies by mudlet mapper areas on or off
bmc lowercase - This will convert your target to lowercase before starting the fight (So Kill Rat becomes Kill rat)
Aliases Available Aliases Available
----------------- -----------------

View File

@ -14,7 +14,8 @@ Bashmatic = Bashmatic or {
}, },
["enemies"] = { ["enemies"] = {
group = false, group = false,
targets = {} targets = {},
lowercase = false
}, },
["enabled"] = false, ["enabled"] = false,
["bashing"] = false, ["bashing"] = false,
@ -24,9 +25,7 @@ Bashmatic = Bashmatic or {
} }
function handleInstall(_, name) function handleInstall(_, name)
if name:lower() == "Bashmatic" then cecho("\n<MediumPurple>Bashmatic: Welcome to Bashmatic. See bm help to get started.")
cecho("<MediumPurple>Bashmatic: Welcome to Bashmatic. See bm help to get started.")
end
end end
registerAnonymousEventHandler("sysInstallPackage", handleInstall) registerAnonymousEventHandler("sysInstallPackage", handleInstall)
@ -50,7 +49,7 @@ function handleLoadEvent()
end end
if Bashmatic.death.phrase ~= false then if Bashmatic.death.phrase ~= false then
Bashmatic.death.event = tempTrigger(Bashmatic.death.phrase,handleMobDeath) Bashmatic.death.event = tempRegexTrigger(".*" .. Bashmatic.death.phrase .. ".*",handleMobDeath)
end end
cecho("<DarkSlateBlue>Bashmatic: Loaded settings. Let's bash some mobs.") cecho("<DarkSlateBlue>Bashmatic: Loaded settings. Let's bash some mobs.")
@ -97,6 +96,7 @@ function handleBashingMatches()
killBashingTriggers() killBashingTriggers()
else else
if Bashmatic.commands.before then send(Bashmatic.commands.before) end if Bashmatic.commands.before then send(Bashmatic.commands.before) end
if Bashmatic.enemies.lowercase then keyword = keyword:lower() end
send(Bashmatic.commands.start .. " " .. keyword) 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