Quantcast Libram (Library) - WoWWiki - Your guide to the World of Warcraft
Recent changes Random page
GAMING
Gaming
 
StarCraft Wiki
Super Smash Wiki
Halopedia
Diablo Wiki
FFXIclopedia
Grand Theft Wiki
See more...

Libram (Library)

From WoWWiki

Jump to: navigation, search
For info regarding the in-game item known as a Libram, see this page.

"DRY - Don't Repeat Yourself." - David Thomas & Andrew Hunt

Libram is a QuestLog notification system. It will tell you exactly what changed, when it changes. This addon is a function library. This means that it doesn't have any UI on its own, but rather provides functionality for other addons. If you are an addon user and not an addon developer all you need to do is to leave this addon turned on if you have any other addons that depend on it.


Examples:

myCallback = function(action, questInfo) 
  if (action==LIBRAM_QUEST_ADDED) then
    Sea.io.print("New Quest Found: ", questInfo.title);
  end
end;

Libram.registerScholar({id="MyScholar";callback=myCallback;description="My New Quest Announcer"});

Will print "New Quest Found: [Quest Title Here]" when a new quest is added to the quest log.

Contents

Libram Documentation

If you modify something that will require an update to the source code, leave a note on Alex's talk page (click new note to leave message there).

Libram Functions

Libram Data Types

Using Libram

Libram is designed to make watching the quest log a lot easier. For instance, lets say you wanted to know when a new quest was added to the quest log. You could either a) iterate through every quest or b) register a scholar and watch for the LIBRAM_QUEST_ADD event from your scholar. Plus, if you use Libram.requestRecord, you ensure you don't accidentally refresh the player's quest log.

Important Points about Libram

Do not do a gui update as a result of the Scholar's callback. If you do, you ensure your addon will cause lag for your users. Instead, record the action and update your gui later, after a delay.

Rate this article:
Share this article: