Debuff macro

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Debuff macro

#21 Post by Draakje » Fri Aug 16, 2013 3:56 am

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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Debuff macro

#22 Post by rock5 » Fri Aug 16, 2013 6:17 am

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
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests