undrgrnd
30-10-2006, 10:47 PM
I haven't really made any working UI mods yet so I'm sure I'm doing something stupid and ovbiously wrong lol, can someome just take a look at this and point it out? The point of this mod is so that when I whisper a person with it (A Priest) that he automatically targets me and casts Greater Heal. If you need more info just ask!
function ZMod_OnLoad()
this:RegisterEvent("CHAT_MSG_WHISPER");
SLASH_ZMOD1 = "/zmod";
SLASH_ZMOD2 = "/zm";
SlashCmdList["ZMOD"] = function(msg)
ZMod_SlashCommandHandler(msg);
end
DEFAULT_CHAT_FRAME:AddMessage("ZMod Running!");
end
function ZMod_SlashCommandHandler(msg)
if( msg ) then
local command = string.lower(msg);
if( command == "reload" ) then
ReloadUI();
end
if( command == "two" ) then
DEFAULT_CHAT_FRAME:AddMessage("Numbah 2");
end
end
end
function ZMod_OnEvent(event)
if( event == "CHAT_MSG_WHISPER" ) then
ZMod_ReadWhisper(arg2, arg1);
end
end
function ZMod_ReadWhisper(name, content)
if ( (string.find(string.lower(content))) == "cast heal") then
ZMod_Cast("Greater Heal", name);
end
end
function ZMod_Cast(spell, name)
TargetByName(name);
CastSpellByName(spell);
end
function ZMod_OnLoad()
this:RegisterEvent("CHAT_MSG_WHISPER");
SLASH_ZMOD1 = "/zmod";
SLASH_ZMOD2 = "/zm";
SlashCmdList["ZMOD"] = function(msg)
ZMod_SlashCommandHandler(msg);
end
DEFAULT_CHAT_FRAME:AddMessage("ZMod Running!");
end
function ZMod_SlashCommandHandler(msg)
if( msg ) then
local command = string.lower(msg);
if( command == "reload" ) then
ReloadUI();
end
if( command == "two" ) then
DEFAULT_CHAT_FRAME:AddMessage("Numbah 2");
end
end
end
function ZMod_OnEvent(event)
if( event == "CHAT_MSG_WHISPER" ) then
ZMod_ReadWhisper(arg2, arg1);
end
end
function ZMod_ReadWhisper(name, content)
if ( (string.find(string.lower(content))) == "cast heal") then
ZMod_Cast("Greater Heal", name);
end
end
function ZMod_Cast(spell, name)
TargetByName(name);
CastSpellByName(spell);
end