Skip to content

Instantly share code, notes, and snippets.

@wein3967
wein3967 / DIM Armor Export.js
Last active April 6, 2017 13:18
This is a DIM specific script that is run from the Chrome developer tools console in an active DIM tab
// This is a DIM specific script that can be run in the Developer Console in Chrome on a DIM tab.
// it writes out a csv string with stats and perks for armor, ghosts, and artifacts.
// FUNCTIONS
function isArmor(myItem) {
return (myItem.type === "Helmet" ||
myItem.type === "Gauntlets" ||
myItem.type === "Chest" ||
myItem.type === "Leg" ||
myItem.type === "ClassItem") &&
@wein3967
wein3967 / DIM Getting Started
Last active July 30, 2016 00:20
This is a script that grabs all your DIM items across all characters and puts them into a single array. From there you can examine, filter, etc.
// MAIN CODE
var stuff = angular.element(document.body).injector().get('dimStoreService').getStores();
var guardian1_Items = (stuff.length >= 2) ? stuff[0].items : [];
var guardian2_Items = (stuff.length >= 3) ? stuff[1].items : [];
var guardian3_Items = (stuff.length >= 4) ? stuff[2].items : [];
var vaultItems = stuff[stuff.length - 1].items;
var allItems = guardian1_Items.concat(guardian2_Items, guardian3_Items, vaultItems);
@wein3967
wein3967 / DIM Weapon Export.js
Last active April 6, 2017 13:18
This is a DIM specific script that is run from the Chrome developer tools console in an active DIM tab
// This is a DIM specific script that can be run in the Developer Console in Chrome on a DIM tab.
// it writes out a csv string with name and perks for weapons.
// FUNCTIONS
function isWeapon(myItem) {
return myItem.type === "Primary" ||
myItem.type === "Special" ||
myItem.type === "Heavy" &&
myItem.name.indexOf("Engram") == -1; // Filtering out various Engrams
};
DirectionCosines = LAMBDA(xl, yl, [zl], [xt], [yt], [zt],
SplitString(
IF(
OR(ISOMITTED(zl), ISOMITTED(xt), ISOMITTED(yt), ISOMITTED(zt)),
LET(
thetaz, xl,
phi, yl,
1 * SIN(RADIANS(thetaz)) * COS(RADIANS(phi)) & "," &
1 * SIN(RADIANS(thetaz)) * SIN(RADIANS(phi)) & "," &
1 * COS(RADIANS(thetaz)) & "," & thetaz & "," &