2018-10-28 12:02:55 +01:00
|
|
|
### Import our module
|
2018-10-28 12:26:00 +01:00
|
|
|
from mcuuid.mcuuid import GetPlayerData
|
2015-03-11 20:16:17 +01:00
|
|
|
|
2018-10-28 12:02:55 +01:00
|
|
|
### Import some other necessary modules
|
|
|
|
import sys
|
2015-03-11 20:16:17 +01:00
|
|
|
|
2018-10-28 12:02:55 +01:00
|
|
|
### Which username should we use?
|
|
|
|
# Are there some arguments brought by the console use the first after the filename as username
|
|
|
|
if len(sys.argv) > 1:
|
|
|
|
username = sys.argv[1]
|
|
|
|
# Else, ask for a username by userinput
|
|
|
|
else:
|
|
|
|
print("Please enter a username: ")
|
|
|
|
username = raw_input()
|
2015-03-11 20:16:17 +01:00
|
|
|
|
2018-10-28 12:02:55 +01:00
|
|
|
### Obtaining the playerinformation using our module
|
|
|
|
player = GetPlayerData(username)
|
|
|
|
# Check if the request was valid and the user exists
|
|
|
|
if player.valid is True:
|
|
|
|
# Getting UUID
|
|
|
|
uuid = player.uuid
|
|
|
|
# Getting real Username
|
|
|
|
name = player.username
|
2015-03-11 20:16:17 +01:00
|
|
|
|
2018-10-28 12:02:55 +01:00
|
|
|
# Print everything
|
|
|
|
print('UUID: ' + uuid)
|
|
|
|
print('correct name: ' + name)
|
|
|
|
# Error message
|
2015-03-11 20:16:17 +01:00
|
|
|
else:
|
|
|
|
print("That player was not found.")
|