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
cecho("<firebrick>BASHMATIC: You must configure the death trigger first. Please see bm help for more info.")
if not Bashmatic.death.event then
cecho("<firebrick>Bashmatic: You must configure the death trigger first. Please see bm help for more info.")
else
if bashmatic.enemies.group then
if Bashmatic.enemies.group then
-- grouping enemies by area
local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil
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
inlineAddTarget(matches[2], area)
end

View File

@ -2,32 +2,32 @@ local which = matches[2]:lower()
if which == "phrase" then
-- death phrase
if Bashmatic.death.event ~= nil then
if Bashmatic.death.event then
killTrigger(Bashmatic.death.event)
end
Bashmatic.death.phrase = matches[2]
Bashmatic.death.phrase = matches[3]
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
-- starting battle command
Bashmatic.commands.start = matches[2]
cecho("<DarkSlateBlue>Bashmatic: Set battle start command to " .. matches[2] .. " target.<reset>")
Bashmatic.commands.start = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Set battle start command to " .. matches[3] .. " target.<reset>")
elseif which == "before" then
-- before battle command
Bashmatic.commands.before = matches[2]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[2] .. " before battle start.<reset>")
Bashmatic.commands.before = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[3] .. " before battle start.<reset>")
elseif which == "during" then
-- during battle command
Bashmatic.comands.during = matches[2]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[2] .. " during battle every " .. Bashmatic.commands.duringTime .. " seconds.<reset>")
Bashmatic.comands.during = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[3] .. " during battle every " .. Bashmatic.commands.duringTime .. " seconds.<reset>")
elseif which == "duringTime" then
-- during battle command time frame
Bashmatic.commands.duringTime = tonumber(mathces[2])
cecho("<DarkSlateBlue>Bashmatic: Will send " .. Bashmatic.commands.during .. " during battle every " .. tonumber(matches[2]) .. " seconds.<reset>")
Bashmatic.commands.duringTime = tonumber(mathces[3])
cecho("<DarkSlateBlue>Bashmatic: Will send " .. Bashmatic.commands.during .. " during battle every " .. tonumber(matches[3]) .. " seconds.<reset>")
elseif which == "after" then
-- after battle command
Bashmatic.commands.after = matches[2]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[2] .. " after combat.<reset>")
Bashmatic.commands.after = matches[3]
cecho("<DarkSlateBlue>Bashmatic: Will send " .. matches[3] .. " after combat.<reset>")
elseif which == "group" then
-- group by area
if #getRooms() == 0 then
@ -46,5 +46,5 @@ elseif which == "group" then
end
end
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

View File

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