From 47108703fa744850652715dabc85f90d203c8673 Mon Sep 17 00:00:00 2001 From: lBaah <40009702+lBaah@users.noreply.github.com> Date: Tue, 29 Oct 2019 03:21:03 -0300 Subject: [PATCH] Initial commit --- spawnTagRemove.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 spawnTagRemove.py diff --git a/spawnTagRemove.py b/spawnTagRemove.py new file mode 100644 index 0000000..98a3a2f --- /dev/null +++ b/spawnTagRemove.py @@ -0,0 +1,11 @@ +import xml.etree.ElementTree as ET +tree = ET.parse('spawn.xml') +root = tree.getroot() + +#remove npc spawn from spawns.xml +spawns = root.findall('spawn') +for spawn in spawns: + npcs = spawn.findall('npc') # change to monster to select monster + for npc in npcs: + spawn.remove(npc) # remove npc tag from spawns.xml +tree.write('out.xml') # write a new file without selected tags