Skip to content

Instantly share code, notes, and snippets.

@valda
Created July 14, 2010 02:25
Show Gist options
  • Save valda/474912 to your computer and use it in GitHub Desktop.
Save valda/474912 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8-dos; mode: python -*-
import bosh
from bolt import GPath
bosh.initDirs()
bosh.initSettings(readOnly=True)
bosh.oblivionIni = bosh.OblivionIni()
bosh.modInfos = bosh.ModInfos()
bosh.modInfos.refresh()
fileInfo = bosh.ModInfo('.', GPath('Lovers with PK.esp'))
loadFactory = bosh.LoadFactory(True,*bosh.MreRecord.type_class.values())
modFile = bosh.ModFile(fileInfo,loadFactory)
modFile.load(True)
maxId = 0
for type in bosh.MreRecord.type_class.keys():
try:
for record in getattr(modFile, type).records:
maxId = max(maxId, record.fid)
print '%08X %s %s max:%08X' % (record.fid,type,record.eid,maxId)
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment