CREATE and FUCK your own AI GIRLFRIEND TRY FOR FREE
x

VAM VaM meta.json dependency list, extractor script

mcwiki

New Member
Jan 23, 2024
12
32
Hello

I'm planning to optimize var packages for performance reasons also for saving hard drive space & speed up loading.
1st I'm trying to find out what's the most referenced package so I can set my priorities based on that.

I have wrote a Python script that scans directory of your VARs, (with refs) and EXPORT LIST OF DEPENDECIES into TXT file for futher analysys.
If you want to test it youself.. grab it here:

Python:
#!/bin/python3

import json
import os
import zipfile
import zipfile
import json

metaFilename='meta.json'
outputFileName='debuglist.txt'

print('Enter pull path to source directory of VARs, without trailing slash')
print('Scan include subdirectories.')
print('i.e: d:/mygame/assetsvars')
scanPath = input("FullPath to vars:")

of = open(outputFileName, 'a+')

varfiles = []

for root, dirs, files in os.walk(scanPath):
    for file in files:
        if file.endswith(".var"):
            varfiles.append(root+'\\'+file)

for varfile in varfiles:
    with zipfile.ZipFile(varfile, 'r') as zip_ref:
        zip_ref.extract(metaFilename)

    with open(metaFilename,'r') as file:
        jsondata = {}
        try:
            jsondata = json.loads(file.read())
        except:
            print('error parsing json:'+varfile+"\n")
        else:
            for i in jsondata['dependencies']:
                of.write(i+"\n")


of.close()
os.remove(metaFilename)
 

mcwiki

New Member
Jan 23, 2024
12
32
Hi guys
I have updated VarMetaScanner

source code (python) and .exe you can download from

instructions:

1. run the .exe or and run .py script

2. enter path to your directory of VARs and press enter

1730215113731.png
3. app will quickly scan and extract meta.json to its location and analize it

4. the output file will be created at app's location debuglistSorted.txt

5. open it with text editor

1730215258021.png

You see list of dependency packages ordered by occurrence.

Enjoy!