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
- registerScholar - registers a scholar who calls you when the log changes
- unregisterScholar - removes the scholar you registered
- validateScholar - confirms a scholar is valid
- requestHistory - returns the player's quest log
- requestRecord - returns detailed information about a single quest in the player's requested history
Libram Data Types
- Libram Scholar - the scholar who will call you when things change
- Libram History - the player's history (quest log)
- Libram Record - the detailed information on a specific history item
- Libram Action - the action that the scholar informs you has occurred
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.

