I use loot hog and would like to send custom messages to specific users who try and slash roll something other than 1-100.
This is the Function from Loot Hog with out modification that works:
Code:
function loothog_ProcessRoll(player, roll, min_roll, max_roll)
roll = tonumber(roll)
min_roll = tonumber(min_roll)
max_roll = tonumber(max_roll)
--call to update internal statistic
loothog_updateRollStatistics(roll)
-- Reject cheaters: at this position should be the new function loothog_validRoll(...)
--if ((min_roll ~= 1) or (max_roll > 100)) and (loothog_settings["reject"]) then
if (not loothog_validRoll(roll, min_roll, max_roll) and (loothog_settings["reject"])) then
local cheat_msg = string.format(LOOTHOG_MSG_CHEAT, player, roll, min_roll, max_roll)
if (loothog_settings["reject_announce"]) then
-- Bust the cheater if configured to announce rejects:
loothog_chat(cheat_msg)
else
-- Otherwise just notify the local client:
if (DEFAULT_CHAT_FRAME) then
DEFAULT_CHAT_FRAME:AddMessage(cheat_msg)
end
end
return
end
This is the code with my modification that does not work:
Code:
function loothog_ProcessRoll(player, roll, min_roll, max_roll)
roll = tonumber(roll)
min_roll = tonumber(min_roll)
max_roll = tonumber(max_roll)
--call to update internal statistic
loothog_updateRollStatistics(roll)
-- Reject cheaters: at this position should be the new function loothog_validRoll(...)
--if ((min_roll ~= 1) or (max_roll > 100)) and (loothog_settings["reject"]) then
if (not loothog_validRoll(roll, min_roll, max_roll) and (loothog_settings["reject"])) then
if (player["Keflem"]) then
local cheat_msg = string.format(LOOTHOG_MSG_CHEAT1, player, roll, min_roll, max_roll)
end
--local cheat_msg = string.format(LOOTHOG_MSG_CHEAT, player, roll, min_roll, max_roll)
if (loothog_settings["reject_announce"]) then
-- Bust the cheater if configured to announce rejects:
loothog_chat(cheat_msg)
else
-- Otherwise just notify the local client:
if (DEFAULT_CHAT_FRAME) then
DEFAULT_CHAT_FRAME:AddMessage(cheat_msg)
end
end
return
end
I have tried adding it many different ways and cannot get it to work as i intended. Any help would be greatly appreciated.
Thank you,
Keflem