Libram

From WoWDev

  • 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.

You can download the pre-release version from here. (You will also need Sea and Chronos).

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


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.