Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --returns true or false depending on whether a trigger, alias, or timer is enabled or not.
- --
- -- usage examples "isEnabled("alias","target)"
- --
- --or in a script:
- --
- -- if isEnabled("alias","target") then
- -- disableAlias("target")
- -- end
- --
- --NOTE: the name of the trigger, alias, or timer is case-sensitive and can have non-alpha characters
- function isEnabled(type,name)
- local p = isActive(name,type:lower())
- if type:lower() == "trigger" then
- enableTrigger(name)
- if p == isActive(name,type:lower()) then
- return true
- else
- disableTrigger(name)
- return false
- end
- elseif type:lower() == "alias" then
- enableAlias(name)
- if p == isActive(name,type:lower()) then
- return true
- else
- disableAlias(name)
- return false
- end
- elseif type:lower() == "timer" then
- enableTimer(name)
- if p == isActive(name,type:lower()) then
- return true
- else
- disableTimer(name)
- return false
- end
- end
- end--isEnabled
Advertisement
Add Comment
Please, Sign In to add comment