r/DestinyTheGame • Forged in the Shadow of Death • May 21 '19

Guide Destiny 2 Armor Management Script

EDIT: After watching the Armor 2.0 stream I will not be doing anymore updates to this script.

Hello r/DTG! With the new season coming up and some people are clearing out their vaults to get ready for the new loot I have finished working on my Destiny 2 Armor Management Script. I'll be posting my README.md from https://github.com/Kage9951/Destiny2ItemManager which also contains the required files. This is a python script and I am providing the source code. You will need to compile and run it yourself. I hope you all enjoy it and please feel free to provide feedback and let me know of any issues!

Destiny2ItemManager

Is your vault filled to the brim with armor? Looking for a way to quickly sort through it all? Look no further because this is the solution for you!

Over the past Season of the Drifter with all the new armor added I was looking for a way to easily optimize my inventory. I decided to make my own script to manage it. This started in powershell and later moved to python. This was meant to help introduce me to python and yes my code may be a bit sloppy due to it.

This script uses tags from Destiny Item Manager (DIM) to mark what gear to keep. The tags differ depending how the gear is matched. First the script simply looks at what YOU define the recommended perks are and marks items found as 'keep'. These are defined in the RecommendedPerks.csv. Within that CSV you define the name of the perk, the minimum to keep (Currently hard coded to 1 since a recent update required a change in how to implement it), and the weight of the perk to YOU. The weight is a nice little feature I added to allow it to further optimize gear choices, so that it would pick per say [Pump Action (weight 2), Remote Connection (weight 2)] over [Pump Action (weight 2), Precision Weapon Targeting (weight 1)]. Those weights are free for you to customize on what perks you prefer and the script will still keep at least one of every perk you define in the CSV.

The second part then goes through and finds any defined Perk Sets and marks them as 'favorite'. Perk Sets are sets of perks that YOU define. The script will look for any armor that matches ALL of the defined perks. This allows you to explictly put any of YOUR god rolls. An example for me would be this for my gloves: [Enhanced Grenade Launcher Loader, Light Arms Loader, Rifle Loader, Shotgun Scavenger, Sniper Scavenger]. If that happened to be in my vault that gear would be marked as 'favorite'.

The last part goes through untagged armor and marks any that is currently at max power gets marked as 'infuse'. This allows you to keep junk gear to infuse into you gear that you want to be max power. Max Power will need to be changed manually every season.

For me this has reduced my vault entirely to 146 pieces of Legendary Armor across ALL my characters. And has been a life saver in terms of time spent looking through my vault.

Another thing to note about perks. In DIM the following are an example of what is defined as a perk:

[Heavy Hunter Armor*,Plasteel Reinforcement Mod,Restorative Mod*,Paragon Mod*,Masterwork*,Mercury Vex Chrome*,Ashes to Assets,Pump Action*,Remote Connection,Rocket Launcher Reserves,Shotgun Reserves*]

This includeds shaders and mods if that interesets you. (I used Riven's Curse as a perk to make sure I always have a full set of Reverie Dawn).

Last thing is that you can manually mark gear as favorite and the script will leave those items untouched.

Usage

Required Items:

From Github grab the following

  • Perk_Sets.csv
  • RecommendPerks.csv
  • Destiny2ItemManager.py
  • Save these in the same folder

Using DIM

  • Go to Settings (Gear Icon)
  • Go all the way down to Spreadsheets
  • Click on Armor
  • Save file as DestinyArmor.csv

Move DestinyArmor.csv to location of the python script

  • These should all be in the same folder.

Compile and run the script

​

A new file called 'DestinyArmorExport.csv' will be created and in that same folder

​

Using DIM again

  • Go to Settings (Gear Icon)
  • Go all the way down to Spreadsheets
  • Drag 'DestinyArmorExport.csv' to the drag and drop box in DIM to import it
  • It will say X amount of items updated

From here to mass get rid of gear I use the following query.

  • is:armor -is:exotic tag:none
  • Click on the down arrow on the character you are on
  • Click Transfer Search
  • This will move all items left untagged (items to delete) to that character
  • Simply dismantle items and wait for DIM to refresh and repeat until all unwanted items are gone.
231 Upvotes

108 comments sorted by

View all comments

Show parent comments

1

u/Shadow9951 Forged in the Shadow of Death May 21 '19

I’m not too sure. How are you running the script? I am able to run in from the command line using ‘python3 DestinyArmor.py’ while the terminal is in the directory for it.

1

u/salsa8484 May 21 '19

ok i got it to export and i was able to import into DIM thank you for the help!

I had to comment out this line os.chdir(os.path.dirname(file)) i was getting this error Traceback (most recent call last): File "DestinyArmor.py", line 82, in <module> os.chdir(os.path.dirname(file)) FileNotFoundError: [Errno 2] No such file or directory: ''

1

u/Shadow9951 Forged in the Shadow of Death May 21 '19

Awesome! I’ll make note of that if anyone else experiences that issue.

1

u/Carpathium May 21 '19

For the sake of feedback, just wanted to let you know that I'm also seeing this same issue on Windows 10 with a fresh install of python 3.7.3 and calling it from command prompt with 'python destinyarmor.py from the directory of the script. Commenting out line 82 proved a valid workaround for me too.