Creating a plugin

Back

So how do I make a plugin?

The simplest way to get started, is to inspect one of the plugins distributed with the rotation helper, as the plugins are generally quite small and simple (typically around 100lines of code), then you should be able to decode it, quite quickly.

Also these will without a doubt be up-to-date, while this page may not be.

In order to register a plugin with SkeenCore, you'll need the following piece of code;

local SkeenPlugin = {}
SkeenPlugin.Name = "Warrior: Arms" -- Name of the plugin, please include the class and spec combination
SkeenPlugin.Class = "WARRIOR"      -- The class, this plugin applies to (needs to be in CAPS)
SkeenPlugin.Spec = 1               -- The specialization number, this plugin applies to
SkeenPlugin.Rotation = Rotation    -- The rotation function (more on this below)
SkeenPlugin.Cooldown = Cooldown    -- The cooldown function (more on this below)

local SkeenCore3 = _G["SkeenCore3"]      -- Get the SkeenCore3 from the global table
SkeenCore3:RegisterPlugin(SkeenPlugin)   -- Register the plugin

So what is needed now is the Rotation function, this is actually where all of the plugin code goes, the function takes no arguments, and returns an argument of type 'spells';

local function Rotation()
    local spells = {}
    spell.current = nil -- The spellID of the spell to be shown in the middle frame of the rotation frame
    spell.next = nil    -- The spellID of the spell to be shown in the right (next) frame of the rotation frame

    ... -- code to set the above variables

    return spells
end

Then there's the cooldown function;

local function Cooldowns()
    local some_cooldown_spellid = ...
    local some_other_cooldown_spellid = ...

    return {some_cooldown_spellid, some_other_cooldown_spellid,
    function()
         -- Do some logic, then return either a spellid (to show a cooldown), or nil to hide the cooldown frame).
    end
    }

end

So what should be in the SkeenPlugin table?

Mandatory:

  • SkeenPlugin.Name = (Variable) The name of the plugin (barely used)
  • SkeenPlugin.Class = (Variable) The class this rotation applies to (WARRIOR, ROGUE, ect)
  • SkeenPlugin.Spec = (Variable) The spec this rotation applies to (spec number (1,2 or 3))
  • SkeenPlugin.Rotation = (Function) The function to be called on each update (should return a table of spells('.current', '.next'))
  • SkeenPlugin.Cooldown = (Function) This function to be called on each update (should return an array of spellids, to be checked, or functions to be run)

Optional

  • SkeenPlugin.Version = (Variable) The plugin version
  • SkeenPlugin.Plugin_Active = (Function) A function called once the plugin goes active (each time), no return
  • SkeenPlugin.Plugin_Registed = (Function) A function called once the plugin is registed (one time), the plugin could handle this itself, if wanted, no return
  • SkeenPlugin.Option_Frame = (Function) A function called once the module is registed (one time) (should return a frame, to be put as a child of SkeenCore3 into the optionsframe).

So how do I get my plugin included in SkeenCore?

If you think your plugin in ready for inclusion into the Core, please contact me (SkeenCore), here at curseforge.

Once the plugin is accepted, it will be registered with the SkeenCore release system, and all you have to do is to release your own updates, which will automatically trigger a re-release of SkeenCore.


Comments

Posts Quoted:
Reply
Clear All Quotes