Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import sys, os
- import json
- from nbtlib import nbt
- from nbtlib.tag import *
- from pprint import pprint
- selfPath = os.path.dirname(sys.argv[0]) + "/"
- # Black, Blue, Green, Cyan, Red, Magenta, Yellow, LightGray, Gray, LightBlue, LightGreen, LightCyan, LightRed, LightMagenta, LightYellow, White
- lotrToMCColors = {48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 97: "a", 98: "b", 99: "c", 100: "d", 101: "e", 102: "f"}
- dataFileName = "LoTRCircles/LOTR/players/" + sys.argv[1] + ".dat"
- with open('pyscripts/titles.json', 'r') as fp:
- titleMap = json.load(fp)
- #
- # Load the main player data file
- nbtfile = nbt.load(dataFileName)
- title = ""
- color = "f"
- if 'PlayerTitle' in nbtfile['']:
- title = titleMap[nbtfile['']['PlayerTitle']]
- color = lotrToMCColors[nbtfile['']['PlayerTitleColor']]
- #if title == "":
- # title = "Untitled"
- print(title + "_" + color, end='', flush=True)
- sys.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement