dragon-bot/app/diff.py
Luke Robles ea6d09b350 im so dumb. fix the docker file
Fix order of comparisons

Update app/tarkov.py

Fix order of boss spawn comparison

Trying to fix the spawn rate logic agani

I dont even know anymore man

some more funky shit for the boss sapwn comaprison

I dunno man, what the fuck is a kilometer

Flip percents again

Try flipping it AGAIN

fuck man i dont know

Dont cache boss spawns
2024-11-10 15:55:25 -08:00

28 lines
957 B
Python
Executable File

import json
from deepdiff import DeepDiff
with open("/tmp/boss_spawns.json", "r") as f:
old_spawns = json.load(f)
with open("/tmp/spawn.json", "r") as f:
new_spawns = json.load(f)
diff = DeepDiff(old_spawns, new_spawns, ignore_order=True, verbose_level=2)
# Get the differences between the two JSON blobs
# Iterate through the diff to find spawnChance differences
for key, changes in diff.items():
if key == "values_changed":
for path, change in changes.items():
# Access the level and boss name directly from the path
level, boss = (
path.split("[")[1].split("]")[0],
path.split("[")[2].split("]")[0],
)
# Print the relevant difference in spawnChance
if "new_value" in change:
print(
f"Level: {level}, Boss: {boss}, Diff in spawnChance: {change['old_value']} -> {change['new_value']}"
)