diff --git a/src/aliases/bashmatic/BM_Addtarget.lua b/src/aliases/bashmatic/BM_Addtarget.lua index d0f6be5..1fb74a4 100644 --- a/src/aliases/bashmatic/BM_Addtarget.lua +++ b/src/aliases/bashmatic/BM_Addtarget.lua @@ -1,11 +1,11 @@ if not Bashmatic.death.event then - cecho("Bashmatic: You must configure the death trigger first. Please see bm help for more info.") + cecho("\nBashmatic: You must configure the death trigger first. Please see bm help for more info.") else if Bashmatic.enemies.group then -- grouping enemies by area local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil if area == nil then - cecho("Bashmatic: We tried to add that enemy but got a bad area.\nGot: " .. area .. "") + cecho("\nBashmatic: We tried to add that enemy but got a bad area.\nGot: " .. area .. "") else inlineAddTarget(matches[2], area) end diff --git a/src/aliases/bashmatic/BM_Clear.lua b/src/aliases/bashmatic/BM_Clear.lua index d45f237..144c24e 100644 --- a/src/aliases/bashmatic/BM_Clear.lua +++ b/src/aliases/bashmatic/BM_Clear.lua @@ -5,16 +5,16 @@ bmDisable() if Bashmatic.enemies.group then local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil if area == nil then - cecho("Bashmatic: Attempted to clear area targets but got a bad area.\nGot: " .. area .. "") + cecho("\nBashmatic: Attempted to clear area targets but got a bad area.\nGot: " .. area .. "") return end if not table.contains(Bashmatic.enemies.targets, area) then - cecho("Bashmatic: You don't have any enemies for the area " .. area .. "") + cecho("\nBashmatic: You don't have any enemies for the area " .. area .. "") return end Bashmatic.enemies.targets.area = nil - cecho("Bashmatic: Cleared target list for area " .. area .. "") + cecho("\nBashmatic: Cleared target list for area " .. area .. "") else Bashmatic.enemies.targets = {} - cecho("Bashmatic: Cleared target list.") + cecho("\nBashmatic: Cleared target list.") end \ No newline at end of file diff --git a/src/aliases/bashmatic/BM_Configset.lua b/src/aliases/bashmatic/BM_Configset.lua index a2da06d..47d9b46 100644 --- a/src/aliases/bashmatic/BM_Configset.lua +++ b/src/aliases/bashmatic/BM_Configset.lua @@ -7,52 +7,62 @@ if which == "phrase" then end Bashmatic.death.phrase = matches[3] Bashmatic.death.event = tempRegexTrigger(".*" .. Bashmatic.death.phrase .. ".*",handleMobDeath) - cecho("Bashmatic: Reset the death event trigger phrase to " .. matches[3] .. ".") + cecho("\nBashmatic: Reset the death event trigger phrase to " .. matches[3] .. ".") elseif which == "start" then -- starting battle command Bashmatic.commands.start = matches[3] - cecho("Bashmatic: Set battle start command to " .. matches[3] .. " target.") + cecho("\nBashmatic: Set battle start command to " .. matches[3] .. " target.") elseif which == "before" then -- before battle command Bashmatic.commands.before = matches[3] - cecho("Bashmatic: Will send " .. matches[3] .. " before battle start.") + cecho("\nBashmatic: Will send " .. matches[3] .. " before battle start.") elseif which == "during" then -- during battle command Bashmatic.comands.during = matches[3] - cecho("Bashmatic: Will send " .. matches[3] .. " during battle every " .. Bashmatic.commands.duringTime .. " seconds.") + cecho("\nBashmatic: Will send " .. matches[3] .. " during battle every " .. Bashmatic.commands.duringTime .. " seconds.") elseif which == "duringTime" then -- during battle command time frame Bashmatic.commands.duringTime = tonumber(mathces[3]) - cecho("Bashmatic: Will send " .. Bashmatic.commands.during .. " during battle every " .. tonumber(matches[3]) .. " seconds.") + cecho("\nBashmatic: Will send " .. Bashmatic.commands.during .. " during battle every " .. tonumber(matches[3]) .. " seconds.") elseif which == "after" then -- after battle command Bashmatic.commands.after = matches[3] - cecho("Bashmatic: Will send " .. matches[3] .. " after combat.") + cecho("\nBashmatic: Will send " .. matches[3] .. " after combat.") elseif which == "lowercase" then -- Converting target to lowercase in battle start command - Bashmatic.enemies.lowercase = not Bashmatic.enemies.lowercase + if not table.contains({"yes", "no"}, matches[3]:lower()) then + cecho("\nBashmatic: You need to set lowercase target conversion to yes or no.") + return + end + if matches[3]:lower() == "yes" then Bashmatic.enemies.lowercase = true end + if matches[3]:lower() == "no" then Bashmatic.enemies.lowercase = false end if Bashmatic.enemies.lowercase then - cecho("Bashmatic: Will now convert targets to lowercase in starting command.") + cecho("\nBashmatic: Will now convert targets to lowercase in starting command.") else - cecho("Bashmatic: Will no longer convert targets to lowercase in starting command.") + cecho("\nBashmatic: Will no longer convert targets to lowercase in starting command.") end elseif which == "group" then -- group by area if #getRooms() == 0 then Bashmatic.enemies.group = false - cecho("Bashmatic: No map detected. Did you make one? You need at least one room to use this feature.") + cecho("\nBashmatic: No map detected. Did you make one? You need at least one room to use this feature.") else - Bashmatic.enemies.group = not Bashmatic.enemies.group + if not table.contains({"yes", "no"}, matches[3]:lower()) then + cecho("\nBashmatic: You need to set enemy grouping by area to either yes or no.") + return + end + if matches[3]:lower() == "yes" then Bashmatic.enemies.group = true end + if matches[3]:lower() == "no" then Bashmatic.enemies.group = false end if Bashmatic.enemies.group then -- we've just turned on enemy grouping Bashmatic.enemies.targets = {} - cecho("Bashmatic: Now grouping enemies by areas. Cleared previous enemies.") + cecho("\nBashmatic: Now grouping enemies by areas. Cleared previous enemies.") else -- we've just turned off enemy grouping squashTargetGroups() - cecho("Bashmatic: No longer grouping enemies by areas. Squashed previous enemies into one large table.\nYou can bm clear to erase them.") + cecho("\nBashmatic: No longer grouping enemies by areas. Squashed previous enemies into one large table.\nYou can bm clear to erase them.") end end else - cecho("Bashmatic: Unrecognized option " .. matches[3] .. ". See bm help for a list of options.") + cecho("\nBashmatic: Unrecognized option " .. matches[3] .. ". See bm help for a list of options.") end \ No newline at end of file diff --git a/src/aliases/bashmatic/BM_Delete.lua b/src/aliases/bashmatic/BM_Delete.lua index 792c584..b082af8 100644 --- a/src/aliases/bashmatic/BM_Delete.lua +++ b/src/aliases/bashmatic/BM_Delete.lua @@ -3,26 +3,26 @@ local ourIndex = tonumber(matches[2]) if Bashmatic.enemies.group then local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil if area == nil then - cecho("Bashmatic: Attempted to clear area targets but got a bad area.\nGot: " .. area .. "") + cecho("\nBashmatic: Attempted to clear area targets but got a bad area.\nGot: " .. area .. "") return end if not table.contains(Bashmatic.enemies.targets, area) then - cecho("Bashmatic: You don't have any enemies for the area " .. area .. "") + cecho("\nBashmatic: You don't have any enemies for the area " .. area .. "") return end local size = table.size(Bashmatic.enemies.targets.area) if ourIndex > size then - cecho("Bashmatic: Index out of range for this area. There are only " .. size .. " targets stored.") + cecho("\nBashmatic: Index out of range for this area. There are only " .. size .. " targets stored.") return end table.remove(Bashmatic.enemies.targets.area, ourIndex) - cecho("Bashmatic: Removed target from the area list.") + cecho("\nBashmatic: Removed target from the area list.") else local size = table.size(Bashmatic.enemies.targets) if ourIndex > size then - cecho("Bashmatic: Index out of range. There are only " .. size .. " targets stored.") + cecho("\nBashmatic: Index out of range. There are only " .. size .. " targets stored.") return end table.remove(Bashmatic.enemies.targets, ourIndex) - cecho("Bashmatic: Removed target from the list.") + cecho("\nBashmatic: Removed target from the list.") end \ No newline at end of file diff --git a/src/aliases/bashmatic/BM_Help.lua b/src/aliases/bashmatic/BM_Help.lua index 23229e7..5e959ca 100644 --- a/src/aliases/bashmatic/BM_Help.lua +++ b/src/aliases/bashmatic/BM_Help.lua @@ -1,4 +1,4 @@ -cecho([[ +cecho([[ Bashmatic Help File Let's Bash some Mobs! @@ -22,7 +22,7 @@ bmc during - commands to execute during combat. 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 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) +bmc lowercase - set to yes or no to toggle converting your target to lowercase before starting the fight (So Kill Rat becomes Kill rat) Aliases Available ----------------- diff --git a/src/aliases/bashmatic/BM_Listtargets.lua b/src/aliases/bashmatic/BM_Listtargets.lua index cb6010b..990aa73 100644 --- a/src/aliases/bashmatic/BM_Listtargets.lua +++ b/src/aliases/bashmatic/BM_Listtargets.lua @@ -2,16 +2,16 @@ if Bashmatic.enemies.group then -- grouped by areas local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil if area == nil then - cecho("Bashmatic: We got an invalid area.\nWe Got: " .. area .. "") + cecho("\nBashmatic: We got an invalid area.\nWe Got: " .. area .. "") return end if not table.contains(Bashmatic.enemies.targets, area) then - cecho("Bashmatic: No enemies added from the area " .. area .. "") + cecho("\nBashmatic: No enemies added from the area " .. area .. "") return end local size = table.size(Bashmatic.enemies.targets.area) if size == 0 then - cecho("Bashmatic: No enemies added from the area " .. area .. "") + cecho("\nBashmatic: No enemies added from the area " .. area .. "") return end if size <= 15 then @@ -26,7 +26,7 @@ else -- not grouped by area local size = table.size(Bashmatic.enemies.targets) if size == 0 then - cecho("Bashmatic: No enemies added.") + cecho("\nBashmatic: No enemies added.") return end if size <= 15 then diff --git a/src/aliases/bashmatic/BM_Listtargets_Pager.lua b/src/aliases/bashmatic/BM_Listtargets_Pager.lua index e9160f4..d1f5e7c 100644 --- a/src/aliases/bashmatic/BM_Listtargets_Pager.lua +++ b/src/aliases/bashmatic/BM_Listtargets_Pager.lua @@ -2,16 +2,16 @@ if Bashmatic.enemies.group then -- grouped by areas local area = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil if area == nil then - cecho("Bashmatic: We got an invalid area.\nWe Got: " .. area .. "") + cecho("\nBashmatic: We got an invalid area.\nWe Got: " .. area .. "") return end if not table.contains(Bashmatic.enemies.targets, area) then - cecho("Bashmatic: No enemies added from the area " .. area .. "") + cecho("\nBashmatic: No enemies added from the area " .. area .. "") return end local size = table.size(Bashmatic.enemies.targets.area) if size == 0 then - cecho("Bashmatic: No enemies added from the area " .. area .. "") + cecho("\nBashmatic: No enemies added from the area " .. area .. "") return end if size <= 15 then @@ -21,7 +21,7 @@ if Bashmatic.enemies.group then -- paginator local pages = math.floor(size/15)+1 if tonumber(matches[2]) > pages then - cecho("Bashmatic: There aren't that many pages. There are only " .. pages .. " pages.") + cecho("\nBashmatic: There aren't that many pages. There are only " .. pages .. " pages.") return end local startIndex = ((tonumber(matches[2]) - 1)*15)+1 @@ -33,7 +33,7 @@ else -- not grouped by area local size = table.size(Bashmatic.enemies.targets) if size == 0 then - cecho("Bashmatic: No enemies added.") + cecho("\nBashmatic: No enemies added.") return end if size <= 15 then @@ -43,7 +43,7 @@ else -- paginator local pages = math.floor(size/15)+1 if tonumber(matches[2]) > pages then - cecho("Bashmatic: There aren't that many pages. There are only " .. pages .. " pages.") + cecho("\nBashmatic: There aren't that many pages. There are only " .. pages .. " pages.") return end local startIndex = ((tonumber(matches[2]) - 1)*15)+1 diff --git a/src/aliases/bashmatic/BM_Toggle.lua b/src/aliases/bashmatic/BM_Toggle.lua index b95f194..482bd13 100644 --- a/src/aliases/bashmatic/BM_Toggle.lua +++ b/src/aliases/bashmatic/BM_Toggle.lua @@ -3,5 +3,5 @@ Bashmatic.enabled = not Bashmatic.enabled if Bashmatic.enabled and table.size(Bashmatic.hunting.events) == 0 and table.size(Bashmatic.enemies.targets) > 0 then -- we just turned ourself on, we have targets, and no triggers are running recreateTriggers() - cecho("Bashmatic: Bashmatic turned on. Let's go bash some mobs.") + cecho("\nBashmatic: Bashmatic turned on. Let's go bash some mobs.") end \ No newline at end of file diff --git a/src/scripts/bashmatic/bashmatic_init.lua b/src/scripts/bashmatic/bashmatic_init.lua index f6af3f9..c504ff3 100644 --- a/src/scripts/bashmatic/bashmatic_init.lua +++ b/src/scripts/bashmatic/bashmatic_init.lua @@ -52,7 +52,7 @@ function handleLoadEvent() Bashmatic.death.event = tempRegexTrigger(".*" .. Bashmatic.death.phrase .. ".*",handleMobDeath) end - cecho("Bashmatic: Loaded settings. Let's bash some mobs.") + cecho("\nBashmatic: Loaded settings. Let's bash some mobs.") end registerAnonymousEventHandler("sysLoadEvent", handleLoadEvent) @@ -110,14 +110,14 @@ end function inlineAddTarget(target, area) if area == nil then - cecho("Bashmatic: Added " .. target .. " to hunting targets.") + cecho("\nBashmatic: Added " .. target .. " to hunting targets.") if not table.contains(Bashmatic.enemies.targets, target) then table.insert(Bashmatic.enemies.targets, target) end end if area ~= nil then - cecho("Bashmatic: Added " .. target .. " to hunting targets in " .. area .. ".") + cecho("\nBashmatic: Added " .. target .. " to hunting targets in " .. area .. ".") if table.contains(Bashmatic.enemies.targets, area) then table.insert(Bashmatic.enemies.targets.area, target) else @@ -136,11 +136,11 @@ function recreateTriggers() -- Grouping enemies by areas local thisArea = GetRoomAreaName(GetRoomArea(GetPlayerRoom())) or nil if thisArea == nil then - cecho("Bashmatic: We attempted to locate your area but failed.\nGot: " .. thisArea .. "") + cecho("\nBashmatic: We attempted to locate your area but failed.\nGot: " .. thisArea .. "") return end if not table.contains(Bashmatic.enemies.targets, thisArea) then - cecho("Bashmatic: You haven't added any enemies for the area " .. thisArea .. "") + cecho("\nBashmatic: You haven't added any enemies for the area " .. thisArea .. "") return end for _, keyword in ipairs(Bashmatic.enemies.targets.thisArea) do @@ -189,7 +189,7 @@ function displayTargetList(start, endi, page, pages) end cecho(thisTable:assemble()) if page ~= nil then - cecho("Displaying " .. start .. " to " .. endi .. " (Page " .. page .. " of " .. pages .. ")") + cecho("\nDisplaying " .. start .. " to " .. endi .. " (Page " .. page .. " of " .. pages .. ")") end end @@ -217,9 +217,9 @@ function displayAreaTargetList(area, start, endi, page, pages) Bashmatic.enemies.targets.area[i] }) end - cecho("Target Listing for area " .. area .. "") + cecho("\nTarget Listing for area " .. area .. "") if page ~= nil then - cecho("Displaying " .. start .. " to " .. endi .. " (Page " .. page .. " of " .. pages .. ")") + cecho("\nDisplaying " .. start .. " to " .. endi .. " (Page " .. page .. " of " .. pages .. ")") end end