allObjID, errorLog = result directExtractFile, couldRepeatGetFileList, allMobID, allApcID = getEmptyList( 4) directExtractFile, allObjID, allMobID, errorLog = repeatGet( allObjID, objLst, allMobID, mobLst, couldRepeatGetFileList, directExtractFile, allApcID, port, errorLog) # 去重排序 allObjID = reCSort(allObjID) allMobID = reCSort(allMobID) directExtractFile = list(set(directExtractFile)) # 导出文件 objName = 'obj' + "_".join(allObjID) lstDict = { "passiveObject": [allObjID, objLst], "monster": [allMobID, mobLst] } newSaveMainDir = saveMainDir + '\\特效\\{name}\\'.format(name=objName) imgList, errorLog = outPutFileAndNPK(newSaveMainDir, lstDict, imgDir, npk, directExtractFile, errorLog, port) # 写出日志 if len(errorLog) > 0: errorLogPath = outPutErrorLog(errorLog, newSaveMainDir) # 退出 flag = confirmExit() if flag == 0: print("程序已退出。") break system("pause")
# ------------写出文件 newSaveMainDir = saveMainDir + '\\消耗品_装备\\{name}\\'.format(name=allItemID[0]) iep(newSaveMainDir[:-1]) # 写出列表 lstSavePath = newSaveMainDir + "\\提取列表.txt" lstDict = {"stackable": [allStkID, stkLst], "equipment": [allEquID, equLst], "aicharacter": [allApcID, apcLst], "appendage": [allApdID, apdLst], "creature": [allCreID, creLst], "passiveObject": [allObjID, objLst], "monster": [allMobID, mobLst]} # ------------导出整合IMG imgList, errorLog = outPutFileAndNPK(newSaveMainDir, lstDict, imgDir, npk, directExtractFiles, errorLog, port, [trueVars, icons]) if len(setPartContent) > 0: with open(lstSavePath, 'a', encoding="utf-8") as lst: lst.write("------etc/equipmentpartset.etc-----\n" + setPartContent.replace('\r', '')) # ------------写出错误日志 errorLogPath = outPutErrorLog(errorLog, newSaveMainDir) # ------------退出 flag = confirmExit() if flag == 0: print("程序已退出。") break system("pause")
itemIDFilePath = saveMainDir + name + "\\商店物品列表.txt" iep(saveMainDir + name) with open(itemIDFilePath, 'w', encoding='utf-8') as f: f.write('**所有商店物品代码**\n') items = ','.join(allItemID) f.write('-' * (len(items) + 4) + '\n') f.write('+ ' + items + ' +\n') f.write('-' * (len(items) + 4) + '\n\n') f.write('\n\n**对应NPC/ItemShop商店物品代码**\n') for npc, item in npcItemDIct.items(): f.write('npcName:' + item[2] + '\n' + 'npcID:\t' + npc + '\n' + 'itemShopID:\t' + item[0] + '\n') items = ','.join(item[1]) f.write('-' * (len(items) + 4) + '\n') f.write('+ ' + items + ' +\n') f.write('-' * (len(items) + 4) + '\n\n') imgList, errorLog = outPutFileAndNPK(saveMainDir + name + "\\", lstDict, imgDir, npk, directExtractFiles, errorLog, port) # ------------写出错误日志 errorLogPath = outPutErrorLog(errorLog, saveMainDir + name) # ------------退出 flag = confirmExit() if flag == 0: print("程序已退出。") break system("pause") # -----------------------------------------------------------------------------------------------------------------------
file.replace('key/key/', 'key/') for file in allDirectFile ] # 写出物品TXT exLstText = apcExLst(stkList, newCashShopList, allItems, apcNameList) lstDict = { "aicharacter": [allApcID, apcLst], "passiveObject": [allObjID, objLst], "monster": [allMobID, mobLst] } imgList, errorLog = outPutFileAndNPK(apcSaveDir, lstDict, imgDir, npk, allDirectFile, errorLog, port, exLstT=exLstText) # 写出日志 if len(errorLog) > 0: errorLogPath = outPutErrorLog(errorLog, apcSaveDir) if extractMode: break # ------------退出 flag = confirmExit() if flag == 0: print("程序已退出。") break system("pause")