Some fixes
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Charles Click 2024-06-17 01:57:13 -04:00
parent f49d426ccf
commit b779bc560c
Signed by: roryejinn
GPG Key ID: EDECB89DEDB998C0
3 changed files with 28 additions and 28 deletions

View File

@ -1,11 +1,11 @@
if not bashmatic.death.event then if not Bashmatic.death.event then
cecho("<firebrick>BASHMATIC: You must configure the death trigger first. Please see bm help for more info.") cecho("<firebrick>Bashmatic: You must configure the death trigger first. Please see bm help for more info.")
else else
if bashmatic.enemies.group then if Bashmatic.enemies.group then
-- grouping enemies by area -- grouping enemies by area
local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil
if area == nil then if area == nil then
cecho("<firebrick>BASHMATIC: We tried to add that enemy but got a bad area.\nGot: " .. area .. "<reset>") cecho("<firebrick>Bashmatic: We tried to add that enemy but got a bad area.\nGot: " .. area .. "<reset>")
else else
inlineAddTarget(matches[2], area) inlineAddTarget(matches[2], area)
end end

View File

@ -2,32 +2,32 @@ local which = matches[2]:lower()
if which == "phrase" then if which == "phrase" then
-- death phrase -- death phrase
if Bashmatic.death.event ~= nil then if Bashmatic.death.event then
killTrigger(Bashmatic.death.event) killTrigger(Bashmatic.death.event)
end end
Bashmatic.death.phrase = matches[2] Bashmatic.death.phrase = matches[3]
Bashmatic.death.event = tempTrigger(Bashmatic.death.phrase,handleMobDeath) Bashmatic.death.event = tempTrigger(Bashmatic.death.phrase,handleMobDeath)
cecho("<DarkSlateBlue>Bashmatic: Reset the death event trigger phrase to " .. matches[2] .. ".<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
Bashmatic.commands.start = matches[2] Bashmatic.commands.start = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Set battle start command to " .. matches[2] .. " target.<reset>") cecho("<DarkSlateBlue>Bashmatic: Set battle start command to " .. matches[3] .. " target.<reset>")
elseif which == "before" then elseif which == "before" then
-- before battle command -- before battle command
Bashmatic.commands.before = matches[2] Bashmatic.commands.before = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[2] .. " before battle start.<reset>") cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[3] .. " before battle start.<reset>")
elseif which == "during" then elseif which == "during" then
-- during battle command -- during battle command
Bashmatic.comands.during = matches[2] Bashmatic.comands.during = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[2] .. " during battle every " .. Bashmatic.commands.duringTime .. " seconds.<reset>") cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[3] .. " during battle every " .. Bashmatic.commands.duringTime .. " seconds.<reset>")
elseif which == "duringTime" then elseif which == "duringTime" then
-- during battle command time frame -- during battle command time frame
Bashmatic.commands.duringTime = tonumber(mathces[2]) Bashmatic.commands.duringTime = tonumber(mathces[3])
cecho("<DarkSlateBlue>Bashmatic: Will send " .. Bashmatic.commands.during .. " during battle every " .. tonumber(matches[2]) .. " seconds.<reset>") cecho("<DarkSlateBlue>Bashmatic: Will send " .. Bashmatic.commands.during .. " during battle every " .. tonumber(matches[3]) .. " seconds.<reset>")
elseif which == "after" then elseif which == "after" then
-- after battle command -- after battle command
Bashmatic.commands.after = matches[2] Bashmatic.commands.after = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[2] .. " after combat.<reset>") cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[3] .. " after combat.<reset>")
elseif which == "group" then elseif which == "group" then
-- group by area -- group by area
if #getRooms() == 0 then if #getRooms() == 0 then
@ -46,5 +46,5 @@ elseif which == "group" then
end end
end end
else else
cecho("<firebrick>Bashmatic: Unrecognized option " .. matches[2] .. ". See bm help for a list of options.") cecho("<firebrick>Bashmatic: Unrecognized option " .. matches[3] .. ". See bm help for a list of options.")
end end

View File

@ -2,15 +2,15 @@ local ourTables = require("Bashmatic.ftext").TableMaker
Bashmatic = Bashmatic or { Bashmatic = Bashmatic or {
["commands"] = { ["commands"] = {
start = nil, start = false,
before = nil, before = false,
during = nil, during = false,
duringTime = nil, duringTime = 2,
after = nil after = false
}, },
["death"] = { ["death"] = {
phrase = nil, phrase = false,
event = nil event = false
}, },
["enemies"] = { ["enemies"] = {
group = false, group = false,
@ -32,11 +32,11 @@ registerAnonymousEventHandler("sysInstallPackage", handleInstall)
function handleShutdown() function handleShutdown()
if Bashmatic.death.event ~= nil then killTrigger(Bashmatic.death.event) end if Bashmatic.death.event ~= false then killTrigger(Bashmatic.death.event) end
killBashingTriggers() killBashingTriggers()
bmDisable() bmDisable()
toggleBashing(false) toggleBashing(false)
Bashmatic.death.event = nil Bashmatic.death.event = false
table.save(getMudletHomeDir() .. "/Bashmatic.lua", Bashmatic) table.save(getMudletHomeDir() .. "/Bashmatic.lua", Bashmatic)
@ -49,7 +49,7 @@ function handleLoadEvent()
table.load(getMudletHomeDir() .. "/Bashmatic.lua", Bashmatic) table.load(getMudletHomeDir() .. "/Bashmatic.lua", Bashmatic)
end end
if Bashmatic.death.phrase ~= nil then if Bashmatic.death.phrase ~= false then
Bashmatic.death.event = tempTrigger(Bashmatic.death.phrase,handleMobDeath) Bashmatic.death.event = tempTrigger(Bashmatic.death.phrase,handleMobDeath)
end end