Quantcast
Download
(25 Kb)
Download
Updated: 10/21/18 10:25 PM
Compatibility:
Murkmire (4.2)
Updated:10/21/18 10:25 PM
Created:02/05/17 10:02 PM
Monthly downloads:526
Total downloads:8,228
Favorites:18
MD5:
4.2
LibLazyCrafting  Popular! (More than 5000 hits)
Version: 2.31
by: Dolgubon [More]
Crafting for addons anywhere! NOT a standalone addon. This is a meant ONLY for addon developers. Seriously, why are there 4.4k downloads on this?


Addons currently utilizing this Library:


Dolgubon's Lazy Writ Crafter
Dolgubon's Lazy Set Crafter
Writ Worthy

What does LibLazyCrafting Do?
  • Allows addons to create and upgrade a piece of gear with just one function
  • Allows addons to request items to be crafted anywhere, not just at the relevant crafting station
  • Abstracts away the confusing material index and material amount Smithing parameters
  • Provides functions to determine all the materials required to create a piece of gear
  • Extends CraftSmithingItem to allow the specification of crafting set and quality
  • Extends crafting functions to allow the use of itemIds in consumables
  • Allows addons to queue multiple crafts of the same type with one function call
  • Allows addons to use some crafting related functions anywhere, not just at a crafting station
  • Tells you when an item your addon requested is crafted, and where in the bag it is located
If you want your addon to craft items, LibLazyCrafting can help!


General Usage

Note: The usage section is incomplete at this time. If you wish to use this library, let me know and I can help you out.
Add the following to your manifest.txt file:
Libs/LibLazyCrafting/LibLazyCrafting.lua


Then, add the module(s) which you will be using:
Libs/LibLazyCrafting/Smithing.lua
Libs/LibLazyCrafting/Enchanting.lua
Libs/LibLazyCrafting/Provisioning.lua
Libs/LibLazyCrafting/Alchemy.lua

Next, register your addon with LibLazyCrafting (LLC) in the addon initialized function:
local LibLazyCrafting = LibStub:GetLibrary("LibLazyCrafting")
local interactionTable = LibLazyCrafting:AddRequestingAddon(String addonName, boolean autoCraft, function callbackFunction)
String addonName: The name of the requesting addon.
boolean autoCraft: Whether requests from this addon should by default be crafted as soon as possible
function callbackFunction ( String event, integer CraftingType, String addon, table requestTable) : The function that should be called when a requested craft is either complete, or failed for some reason.
returns: An interaction table with which your addon can call the various functions provided by LLC. This interaction table contains most of the functions LLC provides.


Smithing

Functions available:
InteractionTable:isSmithingLevelValid(boolean isCP, integer lvl)
returns boolean isValidSmithingLevel -- This returns true if equipment can be created at that level
CraftSmithingItem( integer patternIndex, integer materialIndex, integer materialQuantity, integer styleIndex, integer traitIndex, boolean useUniversalStyleItem, integer:nilable stationOverride, integer:nilable setIndex, integer:nilable quality, boolean:nilable autocraft, anything:nilable reference)
This is the main function in this module. patternIndex, materialIndex, materialQuantity, styleIndex, traitIndex, and useUniversalStyleItem act in the same way as the ZOS provided CraftSmithingItem's parameters do.
stationOverride: Allows you to set a specific crafting station. Default is the station you are at. If you are not at a station the function will fail.
setIndex: An integer determining the crafted set you wish to create. The default is 1, which signifies no set. A list of set indexes can be found in the Smithing.lua file, or with GetSetIndexes()
quality: One of the ITEM_QUALITY global constants. The default is white quality.
autocraft: Determines if the library will craft the item. If it is false, the library will keep it in queue until the requesting addon tells it to craft the item.
reference: This can be any type of data. It lets your addon to identify the request, to delete it, craft it, and know when it is complete. The default is the empty string.
returns: The request table, which contains all the information about the craft request.


CraftSmithingItemByLevel -- The second and third parameters are replaced by boolean isCP, integer level. The materialIndex and materialQuantity conversions are handled internally by LLC.
ImproveSmithingItem
GetCurrentSetInteractionIndex
GetMatRequirements
compileRequirements
GetSetIndexes
GetSmithingResultLink -- IN PROGRESS


Provisioning

CraftProvisioningItemByRecipeId


Alchemy

CraftAlchemyPotion


Enchanting

CraftEnchantingGlyph



Examples


Note: LLC_Global is a global queue meant only for testing and exploration.

/script LLC_Global:CraftSmithingItemByLevel(3, true, 150,3 ,1 ,false, CRAFTING_TYPE_CLOTHIER, 0, 3,true) -- crafts a blue CP150 shoes
/script for i= 2, 25 do LLC_Global:CraftSmithingItemByLevel(3, false, i*2,3 ,1 ,false, CRAFTING_TYPE_CLOTHIER, 0, 3,true) end -- Crafts lvl 4,6, 8, 10, etc. up to lvl 50. The items will be blue shoes.

/script LLC_Global:CraftEnchantingItemId(45830, 45838, 45851) -- Crafts a Monumental Glyph of Flame Resist
Version 2.31:

Fixed a type causing lua errors: CRAFTING_TYPE_JEWELRY -> CRAFTING_TYPE_JEWELRYCRAFTING

Version 2.3:

Added Murkmire sets.
Added a debug option and a throw error function in the addon. Not really used yet, but might add more error throwing to help debugging in the future.

Version 2.21:

Fixed a bug where improving a jewelry item to green would use 2 improvement mats rather than one.
Fixed a bug where the number of improvement mats for jewelry given by the Compile Requirements would use the old amounts (Thanks to @Ziggr)

Version 2.2:

Crown Mimic Stones will now be used even if the style stone is missing.
Old versions of the widgets will no longer be overwritten by a new version.
Will now work on PTS.
Code cleanup: Some unnecessary code has been deleted, and some previously global fields are now local.

Version 2.1:

Improvement level checking now uses textures, which is non language dependent.
Now checks the crafting skill for Blacksmithing, Clothing, and Woodworking to see if the user has a high enough skill to make an item.
Compiling mats now works for Jewelry Crafting.
Jewelry Crafting will no longer fail due to lack of style mats.
Added a new field to the Craft Request tables, craftNow. By default not set (i.e. set to nil) if it is true, the library will craft the item when at a station. It can only be set to true while at a station, and if the user exits the station it will be set back to false automatically. CraftAllItems and CraftItem now change this new field, and their old functionality has been taken over by the new functions SetAllAutoCraft and SetAutoCraft.
Added craftInteract to the function table. This is the function which is called when the player interacts with a crafting station. An addon can call it to force the library to rescan the queue and see if there is something it can craft.
Enchanting file added back in.

Version 2.0: (Jewelry Crafting)

Preliminary support for jewelry crafting. - Ziggr
Refactored checks for style and trait knowledge. - Ziggr
Fixed the check for the improvement skill in languages other than English. - Ziggr
Added checks to determine if the user has enough mats to craft Alchemy and Provisioning items.
Changed to use GetItemLinkItemId instead of the custom version. If not on PTS, it will still use the custom version.

Version 1.9: (Release #2 - Smithing update)

Moved smithing timestamps to a unique identifier. The identifiers are integers, and incremented each time an item is added to the queue.
Fixed issues with backwards compatibility - if an old version was loaded before a newer version, an event handler would not be properly overridden. The old version would then change a local variable in the old version, but not a local variable in the new version which should have been changed.

Version 1.9:

Uses of sortCraftQueue have been removed, in favour of sticking solely with table.remove and table.insert. table.sort is unstable, which caused a rare double crafting issue when multiple items were added at the exact same timestamp while at a crafting station.
Fixed a bug where incorrect material requirements (light materials) would be returned for medium armour.

Version 1.8:

Created a new function to throw events to clean up some code.
Added two new events: LLC_NO_FURTHER_CRAFT_POSSIBLE and LLC_INITIAL_CRAFT_SUCCESS.
LLC_NO_FURTHER_CRAFT_POSSIBLE: Thrown when no more items can be made at the current station
LLC_INITIAL_CRAFT_SUCCESS: Thrown when the white item is created, but must be further improved before being complete.
Fixed a bug where creating multiple items with green or higher quality would cause some white items to be made too many times.
The EndInteraction function was previously removed from the main LLC.lua file, and has been added back in.
Added a check to determine if a CP and level combination is valid.
Added the return of the requestTable to more craft event places.
Fixed a bug where the wrong improvement mat requirements would be given.
Fixed a bug where sometimes the wrong ability would be checked when determining the improvement skill level.

Version 1.7:

Added Material totals for Smithing.
Changed the interaction tables to be slightly more OOP by taking in self.
Removed double crafting bugs. (Pretty confident about this one!)
Fixed an off by one error in smithing
Added a return of the request table to the smithing functions.

Version 1.6:

Possibly fixed a double crafting issue.
Added LibLazyCrafting:IsPerformingCraftProcess()

Version 1.5:

Fixed a bug in provisioning and alchemy whereby the library would fail to recognize an item was crafted if it created a new stack. - fix by ziggr

Version 1.4:

Added the Clockwork City sets.

Version 1.3:

Fixed various typos in the Alchemy file.
Went back to GetTimeStamp() in the smithing file (as it should have been. Sorry!)
Added back timesToMake as an optional parameter in the Alchemy file.
Replaced the body of the crafting complete function with the stackableCraftingComplete function in the alchemy file.
Removed the FindIncreasedSlotIndex from the Alchemy file, as it was already contained in the main LLC file.

Version 1.2:

Fixed a LUA error that would appear when using Provisioning functions.

Version 1.1:

Now supports all types of crafting! (Minus furniture) - Thank you to Ziggr for creating the functions required to support it!
Updating current version. Probably has various bugfixes. The library has been updated over time as needed with various bugfixes and changes, and has just not been updated here on esoui.


Version 1:

Various changes, bugfixes, and improvements, mostly based on what I needed. Not a comprehensive list.
- Added an option reference when you create a craft request
- Added the ability to cancel craft requests based on position in queue or by reference
- Fixed an error where the craft queue was not updating properly
-
Optional Files (0)


Archived Files (17)
File Name
Version
Size
Uploader
Date
2.23
25kB
Dolgubon
10/21/18 08:56 PM
2.21
25kB
Dolgubon
08/19/18 03:57 PM
2.2
22kB
Dolgubon
07/21/18 09:19 PM
2.1
25kB
Dolgubon
05/21/18 02:44 AM
2.0
22kB
Dolgubon
05/01/18 11:58 AM
1.9
22kB
Dolgubon
12/22/17 11:29 AM
1.9
22kB
Dolgubon
12/15/17 10:39 AM
1.8
21kB
Dolgubon
12/14/17 11:54 AM
1.7
21kB
Dolgubon
12/13/17 10:44 AM
1.6
19kB
Dolgubon
12/10/17 10:47 AM
1.5
18kB
Dolgubon
11/04/17 01:13 PM
1.4
18kB
Dolgubon
10/22/17 12:10 AM
1.3
17kB
Dolgubon
08/27/17 07:10 AM
1.2
19kB
Dolgubon
08/24/17 01:53 PM
1.1
16kB
Dolgubon
08/14/17 03:27 AM
1
14kB
Dolgubon
05/20/17 05:24 PM
0.1
12kB
Dolgubon
02/05/17 10:02 PM


Post A Reply Comment Options
Unread 05/21/18, 02:45 AM  
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view AddOns

Forum posts: 316
File comments: 534
Uploads: 12
Re: Re: Re: Enchanting.lua ?

Originally Posted by Anceane
Originally Posted by Dolgubon
Originally Posted by Anceane
did you remove the Enchanting.lua from the folder by mistake or is this a change ?

because the two addons i have using liblazycrafting, have the file enchanting.lua in their .txt

Aka Dolgubonkazycrafter and writworthy.

Thank you
That's by mistake. It shouldn't matter for you as a user though, even if you have it downloaded through minion (that doesn't do anything btw, game won't load a standalone version)
I know but i am curious by nature ... :P so i like to check the differences between version from time to time not that i would be able to do it myself, but still ... :P
The Enchanting.Lua file has been added back in.
Report comment to moderator  
Reply With Quote
Unread 05/01/18, 06:45 PM  
Anceane
 
Anceane's Avatar

Forum posts: 166
File comments: 620
Uploads: 0
Re: Re: Enchanting.lua ?

Originally Posted by Dolgubon
Originally Posted by Anceane
did you remove the Enchanting.lua from the folder by mistake or is this a change ?

because the two addons i have using liblazycrafting, have the file enchanting.lua in their .txt

Aka Dolgubonkazycrafter and writworthy.

Thank you
That's by mistake. It shouldn't matter for you as a user though, even if you have it downloaded through minion (that doesn't do anything btw, game won't load a standalone version)
I know but i am curious by nature ... :P so i like to check the differences between version from time to time not that i would be able to do it myself, but still ... :P
__________________
Report comment to moderator  
Reply With Quote
Unread 05/01/18, 05:49 PM  
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view AddOns

Forum posts: 316
File comments: 534
Uploads: 12
Re: Enchanting.lua ?

Originally Posted by Anceane
did you remove the Enchanting.lua from the folder by mistake or is this a change ?

because the two addons i have using liblazycrafting, have the file enchanting.lua in their .txt

Aka Dolgubonkazycrafter and writworthy.

Thank you
That's by mistake. It shouldn't matter for you as a user though, even if you have it downloaded through minion (that doesn't do anything btw, game won't load a standalone version)
Report comment to moderator  
Reply With Quote
Unread 05/01/18, 05:41 PM  
Anceane
 
Anceane's Avatar

Forum posts: 166
File comments: 620
Uploads: 0
Enchanting.lua ?

did you remove the Enchanting.lua from the folder by mistake or is this a change ?

because the two addons i have using liblazycrafting, have the file enchanting.lua in their .txt

Aka Dolgubonkazycrafter and writworthy.

Thank you
__________________
Report comment to moderator  
Reply With Quote
Unread 04/30/18, 02:36 AM  
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view AddOns

Forum posts: 316
File comments: 534
Uploads: 12
Re: improvement doesn't work for non English user

Originally Posted by qoqo
skillIndex in function LLC_SmithingCraftInteraction() is different other than English.


http://www.esoui.com/forums/showthread.php?t=5341
Thanks for letting me know. I'll try and get this fixed.
Report comment to moderator  
Reply With Quote
Unread 04/14/18, 04:33 AM  
qoqo
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 7
Uploads: 1
improvement doesn't work for non English user

skillIndex in function LLC_SmithingCraftInteraction() is different other than English.


http://www.esoui.com/forums/showthread.php?t=5341
Report comment to moderator  
Reply With Quote
Unread 12/13/17, 11:01 AM  
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view AddOns

Forum posts: 316
File comments: 534
Uploads: 12
Re: Anchanting.lua??

Originally Posted by tomtomhotep
In your LLC.txt you have a file listed which is not in the zip file:

Anchanting.lua

You also have instructions on how to use the missing file:
Hey sorry I never saw this. Didn't really think anyone would comment on this It was a typo and should have been Enchanting.lua, and has been fixed. Thanks!
Report comment to moderator  
Reply With Quote
Unread 11/05/17, 09:40 AM  
tomtomhotep
 
tomtomhotep's Avatar
AddOn Author - Click to view AddOns

Forum posts: 21
File comments: 168
Uploads: 6
Question Anchanting.lua??

In your LLC.txt you have a file listed which is not in the zip file:

Anchanting.lua

You also have instructions on how to use the missing file:

;------------
;Enchanting:
;As consumables are much simpler than smithing, Enchanting is just another way to craft the items. You can call the functions as you normally would,
;with bag and slot IDs, or additionally you can call it by passing itemIds.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: