Quote:
Originally Posted by nosoop
|
Yo! That is lit. I had to use 9 lines of code in python to get list of all items with respected names.
PHP Code:
import vdf
import json
d = vdf.parse(open('items_game.txt'))
items = {}
for l in d["items_game"]["items"]:
print(l + " " +d["items_game"]["items"][l]["name"])
items[l] = d["items_game"]["items"][l]["name"]
with open('allitems.json', 'w') as json_file:
json.dump(items, json_file)
result here in attachment, and as usual just change name from txt to json.
Nosoop you are the best!
Fallowup questions. How often does items_game change? Every update or whenever they change something inside? Is the structure of items_game consistent? Did they ever change structure of the data inside?
Thanks again!
I will still be working on how to make it generic tho