Untitled

Anonymous
38 x views • 1 year ago
def generate_entry(
entry_type, object_id, mod_origin,
target, attributes, requirements, traits,
count, chance
):
# Format ID
if object_id.startswith("0x") or object_id.startswith("0X"):
full_id = f"{object_id}~{mod_origin}" if mod_origin else object_id
else:
full_id = object_id if not mod_origin else f"{object_id}~{mod_origin}"

parts = [full_id, target, attributes, requirements, traits, count, chance]
# Remove empty parts from the right
while parts and (parts[-1] is None or parts[-1] == ""):
parts.pop()

return f"{entry_type} = {'|'.join(parts)}"

def main():
print("== SPID DISTR.ini Generator ==")

entry_type = input("Type (Spell/Perk/Item/Outfit/etc): ").strip()
object_id = input("Object ID (e.g., Healing or 0x0D65): ").strip()
mod_origin = input("Mod file (e.g., Skyrim.esm or leave blank): ").strip()
target = input("Target NPC(s) (e.g., ActorTypeNPC or *Guard): ").strip()
attributes = input("Attributes (Race, Class, Faction, etc. or NONE): ").strip()
requirements = input("Requirements (e.g., 9(20/50) or NONE): ").strip()
traits = input("Traits (M/F/U/S or combination or NONE): ").strip()
count = input("Item count (if not item, press Enter): ").strip()
chance = input("Chance % (default 100): ").strip() or "100"

entry = generate_entry(
entry_type, object_id, mod_origin,
target, attributes, requirements, traits,
count, chance
)

print("\nGenerated Entry:")
print(entry)

save = input("\nSave to DISTR.ini? (y/n): ").strip().lower()
if save == 'y':
with open("DISTR.ini", "a") as f:
f.write(entry + "\n")
print("✅ Saved to DISTR.ini")
else:
print("❌ Entry not saved.")

if __name__ == "__main__":
main()
Safefileku