Page 2 of 2
Re: Debuff macro
Posted: Fri Aug 16, 2013 3:56 am
by Draakje
Uhm one more thing, is it hard to place an activate/deactive in this macro?
If i type ingame like /VNfear on it activates, and /VNfear off to deactivate
Re: Debuff macro
Posted: Fri Aug 16, 2013 6:17 am
by rock5
You would have to add the functionality to disable it first. Probably the best place is the first point of entry which is the OnUpdate function. Add this to the top of the function.
Code: Select all
function VNfear:OnUpdate(elapsed)
if disabled == true then
return
end
Then you want to control it with a slash command, right? I'll copy some slash command code from somewhere else and edit it. Add this to the top of your lua file.
Code: Select all
local disabled = false -- Starting value
SLASH_VNFEAR1 = "/VNfear"
SLASH_VNFEAR2 = "/vnf" -- Add as many variations as you like just increment the number
SlashCmdList["VNFEAR"] = function(editBox, msg)
if msg then
msg = string.lower(msg)
if msg == "on" then -- on
disabled = false
elseif msg == "off" then -- off
disabled = true
else
disabled = not disabled -- Toggles addon if 'on' or 'off' is not used.
end
if disabled then
SendSystemChat("VNfear is disabled")
else
SendSystemChat("VNfear is enabled")
end
end
end