CraftBagger
The CraftBagger addon is an Elder Scrolls Online utility with a singular purpose: To export the contents of your craftbag(s) to disk so that the data can be pulled into Excel or other tools for analysis.
This addon uses the following optional libraries:
NOTE: This was designed for Windows PCs, though if your computer can run Powershell, it should work as well. (Powershell is available for MAC and Linux). If you DO get this to work on a mac or linux machine, please let me know!
As a crafter in Elder Scrolls Online, I am always looking for resources. I have target amounts of things that I wish to manufacture in order to meet whatever profit goal I currently have, and determining how many resources I need is a monumental effort to do manually. This is why this addon was created. Instead of manually picking through my craft bag in game and keeping track in excel of how many of each item I have and what their cost is, with CraftBagger, I can export that data and then easily import it into Excel.
CraftBagger has two components; the lua based addon code which will cause Elder Scrolls Online to dump your craft bag contents (across all accounts) to a 'saved variables' file. The second component is a command line based powershell script that will parse the non-standard output of the saved variables .lua file and save the contents as .CSV files (one per account).
Elder Scrolls Online does not allow addons to create their own files, so CraftBagger is unable to export your craft bag contents directly to CSV. Because of this, using CraftBagger is a multi-step process:
- enter the command /savecraftbag from the in-game chat window.
This will dump your craft bag to a saved variable.
- enter the command /reloadui, or simply logout (or wait up to 3 minutes).
This will cause Elder Scrolls Online to save the 'saved variables' to disk.
- execute the batch file 'run.cmd' from your AddOns\CraftBagger folder, located in %HOMEDRIVE%%HOMEPATH%\Documents\Elder Scrolls Online\live\AddOns\CraftBagger
This will create a CraftBagger-{AccountName}.csv file in this folder. You can then import that CSV file into excel or your spreadsheet software of choice. (It will create one file per account, assuming each account has contents in the craftbag)
If you have the library 'LibPrice' installed, then the csv file will contain 'suggested price' information, pulled from which ever pricing addon you use (Master Merchant, Tamriel Trade Center, Arkadius Trade Tools). As of v7.01, these are the only three pricing addons supported.
Windows Help
Windows sometimes knows when you download a file from the internet and sets a security flag on the file to block it from being executed. If you get a warning about running files from the internet, you may have to unblock the .ps1 and .cmd files. To do so, from windows explorer right click on the CraftBaggerCSVExport.ps1 script and select 'properties', then check the 'Unblock' box in the bottom 'security' section of the dialog. Do the same for the run.cmd file.
Windows should stop blocking you from executing the script now.
Creating a Desktop Shortcut
Unfortunately, Windows does not support easily 'pinning' a batch file (.cmd or .bat) to your start menu or taskbar. However, there is a workaround that will allow you to create a desktop shortcut to running the run.cmd file.
Step 1: Right-click on an empty space on your desktop, select 'New', and then click on 'Shortcut'
Step 2: Enter the following text:
cmd /c "%HOMEDRIVE%%HOMEPATH%\Documents\Elder Scrolls Online\live\AddOns\CraftBagger\run.cmd"
Step 3: Give the shortcut a name and click on 'finish'
This will put an icon on your desktop so now all you have to do is click on the icon to refresh the CSV.
DateTime Appended to CSV file
As of v1.07.0 there are two options in the CraftBagger settings window in-game that control how the CSV file is created. By default, a csv file is created unique to each account, but this file is overwritten each time you run the batch file (or run the powershell script). There are two settings that allow you to append a date/time stamp to the filename instead of overwriting it. The first of this is "Append DateTime stamp to CSV". This is a TRUE/FALSE value that controls if the file is overwritten (FALSE), or if TRUE, appends a date/time stamp. The second setting 'Date Time Format String' gives you control over the specific date/time stamp format that is used. This string must be a powershell date/time format string. For more information, see: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-date?view=powershell-7
NOTE: If you remove the TIME from the format string, then only the date portion will be included in the filename. This may cause your file to be overwritten if you output more than one file per day per account.
The powershell script will read your chosen settings from the saved variables file and create the csv accordingly. You can also override the settings on the command line when running the powershell script directly, please see the included powershell help file for more information.
NOTE: If you provide AppendDateTime or DateTimeFormatStr arguments directly on the powershell command line, these values will override anything contained within the game settings.
Credits
I have reviewed the lua script for several addons to see how a particular addon implemented something. I want to give credit here to the most influential.
CombatMetrics by Solinur for assistance with settings configurations.
MiniMap by Fyrakin for inspiration with debug output coloring and displaying the add-on version at load.
Tamriel Trade Center by Cyxui for convincing me that an addon requiring a separate executable could work.
I want to especially thank
Sirinsidiator &
Seerah for
LibAddonMenu and
Ziggr for
LibPrice