Showing MC/TAQ instead of NAX/TAQ for Some Players
chy8803 opened this issue · 1 comments
The addon is showing MC/TAQ instead of NAX/TAQ for some players.
I write a python script that automatically replaces the correct raid indicator.
Please check the below code for references.
Thanks.
import os
path="I:/Program Files (x86)/World of Warcraft/_classic_/Interface/Addons/iWclPlayerScore/Data/"
for file in os.listdir(path):
if file.endswith(".lua"):
print(path+file)
with open(path+file, "r", encoding="utf-8") as fr:
line=fr.readlines()
for i in range(2,len(line)-2):
try:
# Not replacing since MC is the only score
if len(line[i].split("=")[1].split("%")) ==2:
continue
else: #replacing if M\T\B or M\T or M\B
line[i]=line[i].replace("\"AM","\"AX")\
.replace("\"LM","\"LX")\
.replace("\"SM","\"SX")\
.replace("\"NM","\"NX")\
.replace("\"EM","\"EX")\
.replace("\"RM","\"RX")\
.replace("\"UM","\"UX")\
.replace("\"CM","\"CX")
except:
print("Non-Data Line Detected")
fw = open(path+file, 'w', encoding="utf-8")
fw.writelines(line)
fw.close()