Kage9951 / Destiny2ItemManager

Python script to quickly sort through armor in Destiny 2 using Destiny Item Managers csv Export/Import and tags
23 stars 5 forks source link

Script does not mark for infuse #3

Open WindedHero opened 5 years ago

WindedHero commented 5 years ago

Running the script does not tag items to infuse.

arm.power is a string, whereas maxPower is an integer, so comparing them fails and will never tag for infusion. arm.tag is never None and so will never tag items for infusion.

To correct the issue: 1) skip header row during CSV read -- if you don't do this, int() in next step will croak by trying to int("Power") 2) use int() on arm.power so arm.power == maxPower functions correctly later on 3) change if statement during infusion tagging to match changes above 4) add headers to output csv code, since step 1 removes header from data.

if (row[4] != 'Exotic') and (row[0] !='Name'): ... arm.power = int(row[8]) ... if arm.tag is '' and arm.power == maxPower: ... data.writerow([ "Hash", "Id", "Tag", "Notes" ])