LUA Trouble
Need a little help with some slash commands.
Everything functions as intended but I wanted to use some slash commands to toggle the mod on and off as well as set a user defined value to Warning_Interval (how do I tell if an interger has been entered?)
This is what I have so far:
function PetNotify_Onload()
SLASH_PETNOTIFY1 = "/petnotify";
SLASH_PETNOTIFY2 = "/pn";
SlashCmdList["PETNOTIFY"] = PetNotify_Command;
end
function PetNotify_Command(cmd)
if (cmd == "" or cmd == nil) then
DEFAULT_CHAT_FRAME:AddMessage(helptext);
end
if (cmd == "on") then
DEFAULT_CHAT_FRAME:AddMessage(toggleOntext);
enable = true;
end
if (cmd == "off") then
DEFAULT_CHAT_FRAME:AddMessage(toggleOfftext);
enable = false;
end
if (cmd == ??) then
DEFAULT_CHAT_FRAME:AddMessage(Delaytext);
Warning_Interval = ??;
end
end
Last edited by mulesh : 01-07-07 at 11:45 PM.
|