Created
November 1, 2017 13:59
-
-
Save dlew/d21d700634a4fb9cfa05ebfc089be111 to your computer and use it in GitHub Desktop.
Simple Python script that tells you all the current artifact spots on a Stardew Valley save
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
tree = ET.parse('/path/to/save/file') | |
root = tree.getroot() | |
locations = root.find('locations') | |
for location in locations: | |
name = location.find('name').text | |
objects = location.find('objects') | |
for thing in objects: | |
data = thing.find('value').find('Object') | |
thingName = data.find('name').text | |
if thingName == 'Artifact Spot': | |
tileLocation = data.find('tileLocation') | |
x = tileLocation.find('X').text | |
y = tileLocation.find('Y').text | |
print name + ": " + "x=" + x + " y=" + y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment