-
Notifications
You must be signed in to change notification settings - Fork 9
/
syncTransmog.py
53 lines (46 loc) · 1.57 KB
/
syncTransmog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import mysql.connector
# Change these values to connect to your Character database
acore_db = mysql.connector.connect(
host="localhost",
user="acore",
password="acore",
database="acore_characters"
)
# Change this number to your account ID, or leave as -1 to be prompted for character name
account_id = -1
acore_cursor = acore_db.cursor()
if account_id == -1:
input_data = input("Please input your account_id or character name:")
try:
account_id = int(input_data)
except ValueError:
acore_cursor.execute("SELECT account FROM characters WHERE name = \"{}\"".format(
input_data
))
results = acore_cursor.fetchall()
if len(results) != 1:
print("Unable to find character with name {}".format(
input_data
))
exit(0)
else:
account_id = results[0][0]
acore_cursor.execute("SELECT item_template_id FROM custom_unlocked_appearances WHERE account_id = {}".format(
account_id
))
results = acore_cursor.fetchall()
if len(results) == 0:
print("No transmog results found! No syncing necessary.")
exit(0)
output_file = open("transmogTip.lua", 'w', encoding='utf-8')
output_file.write("\nTransmogTipList = {\n")
counter = 0
for item in results:
counter += 1
output_file.write("\t{}, -- [{}]\n".format(
item[0],
counter
))
output_file.write("}")
output_file.close()
print("SUCCESS! Please place transmogTip.lua in <WoW Dir>/WTF/Account/<AccountName>/<CharName>/SavedVariables")