@ -145,7 +158,10 @@ function processMobPercentRequest(arg)
end
end
function announceMobPercent()
if isFighting() then
if not isEnabled() then
cnote(("%s @wis @Rdisabled@w. Please use the '@Yeptoggle@w' command to enable before attempting to announce the enemy percentage."):format(getPrepend()))
end
if isFighting() and isEnabled() then
local mpmsg = ""
local percent = getEnemyPercent()
if percent > 40 then
@ -158,7 +174,10 @@ function announceMobPercent()
Send(("%s %s @D[@WRoom %d@D]@w %s is at @R%s%%@w"):format(getChannel(), getPrepend(), getRoomID(), getEnemyName(), mpmsg))
end
end
function toggleMobPercent()
toggleEnabled()
cnote(("%s @Wis now %s@w"):format(getPrepend(), isEnabled() and "@Genabled@w" or "@Rdisabled@w"))
end
--[[ Mushclient Plugin Functions ]]--
--[[
-- OnPluginLineReceived(s) is not in use for this plugin, commented out for now....
@ -168,13 +187,19 @@ end
function OnPluginBroadcast(msg, id, name, text)
if isGMCP(id) and isGMCPCommChannel(text) then
local comm_chan = gmcp('comm.channel.chan')
if isValidChannel(comm_chan) then
if isValidChannel(comm_chan) and isEnabled() then
local chan_msg = strip_colours(gmcp('comm.channel.msg'))