All pastes #30801 Raw Edit

Unnamed

public text v1 · immutable
#30801 ·published 2005-11-24 00:55 UTC
rendered paste body
AceAdlibber = {}

if not ace:LoadTranslation("AceAdlibber") then

    AceAdlibber.Const = {

        ChatCmd = { "/adlib" },

        ChatOpt = {
            {
                option = "options",
                desc = "set mod options.",
                method = "Options",
                args = {
                    {
                        option = "help",
                        desc = "set up the adlibber options, e.g. cooldown, phrases."
                    }
                }
            }
        },
        Title = "AceAdlibber",
        Version = "v0.6.1800",
        Desc = "Adds random skill-based chatter to your character.",
        Chat = {
            Enable = "Adlibber enabled",
            Disable = "Adlibber disabled"
        }
    }

end

local const = AceAdlibber.Const

AceAdlibber.Obj = AceAddon:new({
        name          = const.Title,
        description   = const.Desc,
        version       = const.Version,
        releaseDate   = "11-19-2005",
        aceCompatible = "102",
        author        = "Tasaxkal / Paz",
        email         = "wowaddons@matryx.org.uk",
        website       = "http://",
        category      = "others",
        optionsFrame  = "AceAdlibberOptionsFrame",
        db            = AceDatabase:new("AceAdlibberDB"),
        defaults      = const.Defaults,
        cmd           = AceChatCmd:new(const.ChatCmd, const.ChatOpt),


        Initialize = function(self)
        end,

        Enable = function(self)
            self:RegisterEvent("SPELLCAST_STOP")
            self:Set("LastAdlib",0)
            self:Msg(const.Chat.Enable)
            self:Hook("UseAction","OnUseAction")
        end,

        Disable = function(self)
            self:UnregisterEvent("SPELLCAST_STOP")
            self:Set("LastAdlib",0)
            self:Msg(const.Chat.Disable)
        end,

        Options = function(self)
        end,

        OnUseAction = function(a,b,c)
            ace:print("testing")
            self:CallHook("UseAction",a,b,c)
        end
    })


    AceAdlibber.Obj:RegisterForLoad()

ace:RegisterFunctions(AceAdlibber.Obj, {
   version = 1.0,

--<< ================================================= >>--
-- Page I: The Addon Closures.                           --
--<< ================================================= >>--

   Msg   = function(self, ...)
      self.cmd:msg(unpack(arg))
   end,
   Get   = function(self, var)
      return self.db:get(self.profilePath, var)
   end,
   Set   = function(self, var, val)
      self.db:set(self.profilePath, var, val)
   end,
   Reset = function(self, i)
      if i == "" then self:Msg(ACEG_RESETINFO,
                               self.cmd._cmdList[1])
      else self:Msg(ACEG_DORESET)
         self.db:reset(self.profilePath,
                       self.defaults)
      end
   end,

--<< ================================================= >>--
-- Page II: The String Handlers.                        --
--<< ================================================= >>--

   ExecuteChatCommand = function(...)
      if not DEFAULT_CHAT_FRAME then return end
      DEFAULT_CHAT_FRAME.editBox:SetText(ace.concat(arg))
      ChatEdit_SendText(DEFAULT_CHAT_FRAME.editBox)
   end

--<< ================================================= >>--
-- Page Omega: Closure.                                  --
--<< ================================================= >>--

})