Hi ive been trying to set up slash commands for my mod to lock n unlock the frames without having to edit the lau or rl ui but im getting nxt to no were i get the slash commands to show but dnt no how to set up the code to change them can some 1 please help me
.
what im using.
Code:
local oUF_nubsy = CreateFrame("Frame")
local settings = {
"move_player",
"lock_player",
}
oUF_nubsyDB = 2
function oUF_nubsy.SlashCommand(msg)
local self = oUF_nubsy
if strlen(msg) > 0 then
local command = string.lower(msg)
local help = true
if ( type(command) == "string" ) then
for i,v in ipairs(settings) do
if ( command == string.lower(v) ) then
self:Update(i)
DEFAULT_CHAT_FRAME:AddMessage("oUF_nubsy: "..string.lower(v))
help = false
end
end
elseif ( type(command) == "number" ) then
if settings[command] ~= nil then
self:Update(command)
DEFAULT_CHAT_FRAME:AddMessage("oUF_nubsy: "..string.lower(settings[command]))
help = false
end
end
if ( help == true ) then
for i,v in ipairs(settings) do
DEFAULT_CHAT_FRAME:AddMessage("oUF_nubsy: /nubsy "..v)
end
end
else
for i,v in ipairs(settings) do
DEFAULT_CHAT_FRAME:AddMessage("oUF_nubsy: /nubsy "..v)
end
end
end
SLASH_NUBSY1 = "/nubsy"
SlashCmdList["NUBSY"] = oUF_nubsy.SlashCommand