Skip to content

Instantly share code, notes, and snippets.

@Mijago
Mijago / destiny2_extract_armor_focus.py
Last active July 10, 2023 14:09
A very simple script to see which Destiny 2 exotic has which intrinsic stat focus.
import requests, os, json
#######################################################
# First, download the manifest overview
# https://www.bungie.net/Platform/Destiny2/Manifest/
# Define the required tables. We need InventoryItem and the Plugs
requiredTables = [
"DestinyInventoryItemDefinition",
"DestinyPlugSetDefinition"
@Mijago
Mijago / armorCalculation.py
Last active July 9, 2024 15:34
Theoretical Destiny 2 armor stat calculator
import configparser
import json
import os.path
import numpy as np
import pulp as pl
####################################################
# THEORETICAL Stat Optimizer by Mijago
# - You tell the script which stats you want (DESIRED_STATS)
@Mijago
Mijago / gist:41df85fb13b09d6fcb77ab5780438af6
Created July 4, 2022 22:15
Destiny 2 Crucible stats distribution from 07/02/2022 and 04/26/2022, about 20k entries each
This file has been truncated, but you can view the full file.
light,mobility,resilience,recovery,discipline,intellect,strength,class,mode,date,tiers_mob,tiers_res,tiers_rec,tiers_dis,tiers_int,tiers_str,tiers,total
1574,57,33,103,41,101,60,Warlock,Survival,07/02/2022,5,3,10,4,10,6,38,395
1578,77,47,65,52,37,58,Hunter,Rumble,07/02/2022,7,4,6,5,3,5,30,336
1590,28,90,113,53,82,47,Warlock,Control,07/02/2022,2,9,11,5,8,4,39,413
1577,91,48,66,94,42,49,Hunter,Control,07/02/2022,9,4,6,9,4,4,36,390
1575,40,103,42,61,51,59,Titan,Control,07/02/2022,4,10,4,6,5,5,34,356
1531,38,88,29,43,35,63,Titan,Control,07/02/2022,3,8,2,4,3,6,26,296
1561,70,60,101,71,83,62,Hunter,Trials,07/02/2022,7,6,10,7,8,6,44,447
1567,83,25,104,57,75,39,Hunter,Trials,07/02/2022,8,2,10,5,7,3,35,383
1592,100,32,100,59,100,56,Hunter,Survival,07/02/2022,10,3,10,5,10,5,43,447
@Mijago
Mijago / README.md
Last active February 10, 2022 17:22
Get armor pieces from your vault that are as close as possible to a certain roll

Download your destinyArmor.csv from DIM, place it in the same directory as the script, and go! You may need to install: pandas, scipy

The result for [2, 16, 16, 2, 16, 16] looks like this for my vault:

Result
                       ItemID      Score  mob  res  rec  dis  int  str
0    id:"6917529566280381859"   3.605551    2   13   16    2   14   16
1    id:"6917529413158318975"   5.656854    2   12   20    2   16   16
2    id:"6917529404154264966"   7.071068    3   16   15    6   12   12
@Mijago
Mijago / armorStatSolver.newest..py
Last active February 6, 2022 01:39
Test the Possibility of certain Armor Stat Distribuion with Linear Programming
import numpy as np
import pulp as pl
# %%% CONFIG
MINIMUM_TIERS = 28
MAXIMUM_WASTE = 15
AVAILABLE_MODS = 5
AVAILABLE_BONUS = [
20, # PF
@Mijago
Mijago / manifestToMongoDB.py
Created October 30, 2021 12:28
Import the Destiny2 manifest into a MongoDB installation
# python -m pip install pymongo
from pymongo import MongoClient
import urllib.request
import sqlite3, os, zipfile, json
# %% Settings
#################
# Language can be: en, fr, es, es-mx, de, it, ja, pt-br, ru, pl, ko, zh-cht, zh-chs
MANIFEST_LANGUAGE = "en"
@Mijago
Mijago / discord.lua
Last active July 31, 2018 10:11
Lua interface for discord webhooks. It needs no external libraries, but sends the webhook using os.execute and curl.
DiscordWebhook = {}
DiscordWebhook_metatable = { __index = DiscordWebhook }
function DiscordWebhook:new(webhook)
return setmetatable({
webhook = webhook,
enableTTS = false,
content = nil,
username = nil,
avatar_url = nil,