Simple iLevel

Addons
824,717 Downloads Last Updated: Aug 5, 2018 Game Version: 7.1.0

API

This is a WIP! if you need to know something specific send me a PM.

Getting Started

Make sure you addon has either Dependencies: SimpleILevel or OptionalDeps: SimpleILevel so that it gets loaded after SIL.

Fetching Data

  • SIL:NameToGUID(name, realm) Gets the GUID of someone if we have them in the cache
  • name, realm = SIL:GUIDtoName(guid) Gets the name and realm of someone if we have seen them
  • SIL:AddHook(hookType, callback) Add a hook! You may catch something good

Hook Types

purge
(guid) purge the guid from your cache
inspect
(guid, score, totalItems, age, items) someone has been inspected and we now have a score for them, do what you will. items is a table of all there items as itemLink

Plugging In

  • SIL:AddMenuItem(where, info, level, parent) Add a menu item to LDB
    • where top, middle or bottom
    • info info table for UIDropDownMenu_AddButton(info) wiith a few additions, fmi see "List of button attributes"
      • info.textFunc, a function that is run on every display to update info.text
      • info.enabled, a function that is run to see if the option to be shown at all. if it is omitted the item is shown.
    • level numeric level to show the item on, default is 1
    • parent used for sub levels to match up with info.value

Misc

  • dest, to, color = SIL:GroupDest(dest, to) Sanitize user input for use in SIL:PrintTo()
    • dest desitnation channel, output is the channel for SendChatMessage()
    • to passed through for whispers
    • color boolean for if the channel supports color
  • SIL:PrintTo(message, channel, to) Sends a message to the specified channel, channel is the same one for SendChatMessage()
  • SIL:ColorText(low, high) Prints a rainbow of scores to the chat frame from low to high

Load on Demand

In order for your addon to be listed inside SIL as a module it needed to be in Interface\AddOns as a folder SimpleILevel_ and for best results use the title "Simple iLevel - Whatever". The module list will remove "Simple iLevel - " and just show "Whatever". Be sure to also have LoadOnDemand: 1 in your toc.


Comments

Posts Quoted: