dfbb / iWclPlayerScore

Wcl Player Score Support EU/US/TW/KR Server
MIT License
0 stars 1 forks source link

Showing MC/TAQ instead of NAX/TAQ for Some Players #1

Open chy8803 opened 3 years ago

chy8803 commented 3 years ago

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()
chy8803 commented 3 years ago

求NAXX数据正确显示