Download
(12 Kb)
Download
Updated: 08/23/21 03:28 PM
Compatibility:
Ascending Tide (7.3.5)
Deadlands (7.2.5)
Waking Flame (7.1.5)
Updated:08/23/21 03:28 PM
Created:01/27/18 09:16 AM
Monthly downloads:2,617
Total downloads:294,879
Favorites:157
MD5:
LibFoodDrinkBuff  Popular! (More than 5000 hits)
Version: 18
by: Baertram [More]
Optional dependencies
LibAsync
LibChatMessage
LibDebugLogger


For Players
Install this Library, if an addon tells you to install. Otherwise it's mostly for addon authors.

For Developers
This Library includes a list of all current food and drinks buff along with their type (food or drink, special food, etc.).
It includes functions to get information about group member's and/or player food statuses. The Library can be used by itself or packaged in an Add-on without the standalone.lua file.
You can also check your inventory for consumable items and use (consume) them.


Supported Addons (known)
  • FCO Starve Stop
  • Scootworks HUD
  • Grubmaster
  • Group Buffs
  • ExoYs Quickslot Assistant
  • The Elder Bar


Functions

You need to create an instance of this lib with:
Lua Code:
  1. local lib = LibFoodDrinkBuff
  2.  
  3. -- or
  4. local lib = LIB_FOOD_DRINK_BUFF



Use the variable lib to call the following functions then:


lua Code:
  1. function lib:GetTimeLeftInSeconds(timeInMilliseconds)
Parameter: number timeInMilliseconds - any number in milliseconds
Returns: time in seconds rounded up


lua Code:
  1. function lib:GetFoodBuffInfos(unitTag)
Parameter: string unitTag - any unitTag (http://wiki.esoui.com/UnitTag)
Returns: number buffType, bool isDrink, number abilityId, string buffName, number timeStarted, number timeEnds, textureString iconTexture


lua Code:
  1. function lib:IsFoodBuffActive(unitTag)
Parameter: string unitTag - any unitTag (http://wiki.esoui.com/UnitTag)
Returns: bool isBuffActive


lua Code:
  1. function lib:IsFoodBuffActiveAndGetTimeLeft(unitTag)
Parameter: string unitTag - any unitTag (http://wiki.esoui.com/UnitTag)
Returns: bool isBuffActive, number timeLeftInSeconds , number abilityId


lua Code:
  1. function lib:IsAbilityAFoodBuff(abilityId)
Parameter: number abilityId - any valid ability in the game
Returns: nilable:bool isAbilityAFoodBuff, or nil if not a food or drink buff


lua Code:
  1. function lib:IsAbilityADrinkBuff(abilityId)
Parameter: number abilityId - any valid ability in the game
Returns: nilable:bool isAbilityADrinkBuff, or nil if not a food or drink buff


lua Code:
  1. function lib:RegisterAbilityIdsFilterOnEventEffectChanged(addonEventNameSpace, callbackFunc, filterType, filterParameter)
Parameters: addonEventNameSpace - prefered to insert your addon name. if you want to call this function twice, make sure the second/third/... addonEventNameSpace has anotehr name. example `addonName.."_01"`, `addonName.."_02"`
callbackFunc - any global function you want to run when the event is firing
filterType - choose any filter type from here: http://wiki.esoui.com/AddFilterForEvent
filterParameter - choose any filter parameter from here: http://wiki.esoui.com/AddFilterForEvent


lua Code:
  1. function lib:UnRegisterAbilityIdsFilterOnEventEffectChanged()
To Unregister the function above.



lua Code:
  1. function lib:GetVersion()

Returns: lib version


lua Code:
  1. function lib:GetEvents()

Returns: eventList from added eventnames from lib:RegisterAbilityIdsFilterOnEventEffectChanged


lua Code:
  1. function lib:GetAddonVersionFromManifest(addOnNameString)

Parameter: string addOnNameString (optional) - any addOnName like "AwesomeGuildStore"
Returns: number nilable:addOnVersion


lua Code:
  1. function lib:IsConsumableItem(bagId, slotIndex, ignoreBlacklistItems)

Returns: isConsumableItem (ignoreBlacklistItems will filter items that contain strings from table lib.BLACKLIST_STRING_PATTERN)


lua Code:
  1. function lib:ConsumeItemFromInventory(slotIndex)

Returns: bool successfulConsummation


lua Code:
  1. function lib:GetConsumablesItemListFromInventory()

Returns: table consumableItemsInInventory
v18 Scootworks
- Updated API to Waking Flame
- Fixed error message in API.lua
- Added optional dependencies: LibDebugLogger, LibChatMessage

v17
- added new function: IsAbilityAFoodOrDrinkBuff
- removed function: GetAddonVersionFromManifest
- added new buff

v16
- API update
- added new blacklist items (new cyrodiil buffs)

v15
- splitted the lib into different files
- new global to access the lib: LibFoodDrinkBuff + LIB_FOOD_DRINK_BUFF
- buffTypes are now global constants and not local anymore -> check _Constants.lua
- minor code changes
- works with Greymoor patch

v14
fixed a problem with function lib:IsAbilityADrinkBuff()

v13
Pack Leader's Bone Broth is a drink buff now and not a food buff

v12
- added 3 more functions: lib:IsConsumableItem(bagId, slotIndex), lib:ConsumeItemFromInventory(slotIndex) and lib:GetConsumablesItemListFromInventory()
- the lib is able now to add more than just one filterType in function lib:RegisterAbilityIdsFilterOnEventEffectChanged

v11
- changed how the collector works (hwo to collect and savedVars)
- implemented LibChatMessage (optional)
- added two more functions: lib:GetVersion() and lib:GetEvents()

v10
- minor code changes for collect modus
- api update
v9
- minor code changes for collect modus
- api update
v8
- use global LIB_FOOD_DRINK_BUFF to call the addon
- api update
v7
- fixed two buffs
- tiny code changes
v6
- New AddOn structure (removed subfolder)
v5
- Fixed optional LibAsync call via LibStub (no error message anymore if library is missing).
- Fixed APIVersion in manifest txt file
v4
- Recoded standalone.lua -> if LibAsync is available, then use it for dump food/drink abilities.
- Changed DEBUG_ACTIVE_BUFFS() slightly
v3
- Added UnRegisterAbilityIdsFilterOnEventEffectChanged()
- Corrected one recipe to food instead drink buff
v2
- Added 2 more foods for api 100023 (4.0 summerset)
Optional Files (0)


Archived Files (16)
File Name
Version
Size
Uploader
Date
17
12kB
Scootworks
04/14/21 11:07 AM
16
11kB
Scootworks
11/23/20 12:04 PM
15
11kB
Scootworks
04/23/20 03:47 AM
14
8kB
Scootworks
01/16/20 07:02 AM
13
8kB
Scootworks
12/25/19 05:11 AM
11
8kB
Scootworks
12/08/19 09:33 PM
10
7kB
Scootworks
10/21/19 09:22 AM
9
7kB
Scootworks
08/05/19 09:46 AM
8
7kB
Scootworks
05/20/19 08:28 AM
7
7kB
Scootworks
04/20/19 03:50 PM
6
7kB
Scootworks
03/10/19 01:10 PM
5
8kB
Baertram
11/12/18 03:18 PM
4
7kB
Scootworks
11/05/18 11:49 AM
3
7kB
Scootworks
05/23/18 06:46 PM
2
7kB
Scootworks
04/26/18 09:25 AM
1
6kB
Scootworks
01/27/18 09:16 AM


Post A Reply Comment Options
Unread 06/05/23, 11:44 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4903
File comments: 5974
Uploads: 78
Oh, sad to read this was reported on PTS as it seems but made it to live though
Last edited by Baertram : 06/05/23 at 11:52 AM.
Report comment to moderator  
Reply With Quote
Unread 06/05/23, 07:03 AM  
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view AddOns

Forum posts: 185
File comments: 666
Uploads: 18
IsFoodBuffActiveAndGetTimeLeft is apparently not working anymore on update 38?
EDIT:
bug on ZOS side:
https://forums.elderscrollsonline.co...omment/7884327
Last edited by Masteroshi430 : 06/05/23 at 10:07 AM.
Report comment to moderator  
Reply With Quote
Unread 04/29/22, 05:01 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4903
File comments: 5974
Uploads: 78
Todo:
Change GetSlot* functions to use the proper hotbar_category (if quickslot e.g.)
for PTS API 101034 High Isle
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.