31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
|
|
import re, os
|
||
|
|
|
||
|
|
def extract_items(path):
|
||
|
|
with open(path, 'r', encoding='utf-8', errors='ignore') as f:
|
||
|
|
content = f.read()
|
||
|
|
return set(re.findall(r"\['([a-zA-Z0-9_]+)'\]\s*=\s*\{\s*\['name'\]", content))
|
||
|
|
|
||
|
|
preload_path = r'E:\FiveMserver\server\_preLoad\qs-inventory\[inventory]\qs-inventory\shared\items.lua'
|
||
|
|
qbcore_path = r'E:\FiveMserver\server\resources\[framework]\[core]\qb-core\shared\items.lua'
|
||
|
|
|
||
|
|
if not os.path.exists(preload_path):
|
||
|
|
print(f'PRELOAD NOT FOUND: {preload_path}')
|
||
|
|
else:
|
||
|
|
pi = extract_items(preload_path)
|
||
|
|
qi = extract_items(qbcore_path)
|
||
|
|
|
||
|
|
only_preload = sorted(pi - qi)
|
||
|
|
only_qbcore = sorted(qi - pi)
|
||
|
|
|
||
|
|
print(f'Preload items: {len(pi)}')
|
||
|
|
print(f'QBCore items: {len(qi)}')
|
||
|
|
print(f'Common: {len(pi & qi)}')
|
||
|
|
print()
|
||
|
|
print(f'=== ONLY IN PRELOAD ({len(only_preload)}) ===')
|
||
|
|
for item in only_preload:
|
||
|
|
print(f' + {item}')
|
||
|
|
print()
|
||
|
|
print(f'=== ONLY IN QBCORE ({len(only_qbcore)}) ===')
|
||
|
|
for item in only_qbcore:
|
||
|
|
print(f' - {item}')
|