47e0a87646 2024-02-10 1: package.path = [[.\lua_lib\?.lua;]] .. package.path
47e0a87646 2024-02-10 2: package.cpath = [[.\lua_lib\?.dll;]] .. package.cpath
47e0a87646 2024-02-10 3: local 字集库 = require("u8_to_a")
47e0a87646 2024-02-10 4: local 文件系库 = require("lfs")
47e0a87646 2024-02-10 5: local 基算库 = require(字集库.u8_to_a("算机_程语_月_基类_数_基算"))
47e0a87646 2024-02-10 6: local 前缀库 = require(字集库.u8_to_a("算机_程语_月_基类_文_前缀"))
413d4284fd 2024-02-11 7: local 文库 = require(字集库.u8_to_a("算机_程语_月_基类_文"))
47e0a87646 2024-02-10 8: local 后缀库 = require(字集库.u8_to_a("算机_程语_月_基类_文_后缀"))
47e0a87646 2024-02-10 9: local 历排库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_表_排_取全"))
47e0a87646 2024-02-10 10: local 历对库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_表_对_取全"))
47e0a87646 2024-02-10 11: local 历文库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_文_取全"))
47e0a87646 2024-02-10 12: local 数库 = require(字集库.u8_to_a("算机_程语_月_基类_数"))
47e0a87646 2024-02-10 13: local 基类库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_基类"))
47e0a87646 2024-02-10 14: local 筛卡库 = require(字集库.u8_to_a("游戏王_则拟器_原版_残局_卡_全筛"))
7641d52a05 2024-02-12 15: local 卡档库 = require(字集库.u8_to_a("游戏王_则拟器_原版_卡档"))
47e0a87646 2024-02-10 16: local 排算库 = require(字集库.u8_to_a("算机_程语_月_基类_表_排_基类_数"))
47e0a87646 2024-02-10 17: local 读文件库 = require(字集库.u8_to_a("算机_基统_窗群_文件系_小文件_读"))
47e0a87646 2024-02-10 18: local 写文件库 = require(字集库.u8_to_a("算机_基统_窗群_文件系_小文件_写"))
47e0a87646 2024-02-10 19: local string = string
47e0a87646 2024-02-10 20: local os = os
0bb276043b 2024-02-11 21: local table = table
47e0a87646 2024-02-10 22: local d = {}
47e0a87646 2024-02-10 23: local 卡档
0bb276043b 2024-02-11 24: --~ 卡对排
0bb276043b 2024-02-11 25: function d.筛有效果卡(o1_0)
07463271f6 2024-02-11 26: return 历排库.历排(o1_0, 筛卡库.筛有效果卡)
47e0a87646 2024-02-10 27: end
0bb276043b 2024-02-11 28: --~ 卡编排
47e0a87646 2024-02-10 29: function d.取卡对_一维(o1_0)
7641d52a05 2024-02-12 30: return 历排库.历排(o1_0, 卡档库.取卡对)
47e0a87646 2024-02-10 31: end
47e0a87646 2024-02-10 32: --~ 文
47e0a87646 2024-02-10 33: function d.局筛卡编(o1)
47e0a87646 2024-02-10 34: local k1_0
47e0a87646 2024-02-10 35: --~ 卡编排
47e0a87646 2024-02-10 36: k1_0 = 历文库.历文(o1, string.gmatch, "[^\n]+")
07463271f6 2024-02-11 37: k1_0 = 历排库.历排(k1_0, string.match, "Debug%.AddCard.+")
07463271f6 2024-02-11 38: return 历排库.历排(k1_0, string.match, "[0-9]+")
95b5664d69 2024-02-10 39: end
95b5664d69 2024-02-10 40: --~ 文
95b5664d69 2024-02-10 41: function d.局筛血(o1)
95b5664d69 2024-02-10 42: local k1_0
95b5664d69 2024-02-10 43: --~ 血排
95b5664d69 2024-02-10 44: k1_0 = 历文库.历文(o1, string.gmatch, "[^\n]+")
07463271f6 2024-02-11 45: k1_0 = 历排库.历排(k1_0, string.match, "Debug%.SetPlayerInfo.+")
07463271f6 2024-02-11 46: k1_0 = 历排库.历排(k1_0, string.gsub, "[0-9]+", "", 1)
07463271f6 2024-02-11 47: return 历排库.历排(k1_0, string.match, "[0-9]+")
47e0a87646 2024-02-10 48: end
47e0a87646 2024-02-10 49: --~ 文
47e0a87646 2024-02-10 50: function d.局筛则数(o1)
47e0a87646 2024-02-10 51: local k1
47e0a87646 2024-02-10 52: local k1_0
47e0a87646 2024-02-10 53: --~ 则数排
47e0a87646 2024-02-10 54: k1_0 = 历文库.历文(o1, string.gmatch, "[^\n]+")
07463271f6 2024-02-11 55: k1_0 = 历排库.历排(k1_0, 前缀库.全筛前缀, "Debug.ReloadFieldBegin")
47e0a87646 2024-02-10 56: --~ 则数
47e0a87646 2024-02-10 57: k1 = string.match(k1_0[1], "[0-9]")
47e0a87646 2024-02-10 58: return k1 or 3
47e0a87646 2024-02-10 59: end
47e0a87646 2024-02-10 60: --~ 卡对排
95b5664d69 2024-02-10 61: --~ 血排
95b5664d69 2024-02-10 62: function d.荐名(o1_0, o2_0)
95b5664d69 2024-02-10 63: local k1, k2, k3
95b5664d69 2024-02-10 64: local k1_0
95b5664d69 2024-02-10 65: --~ 攻击力排
07463271f6 2024-02-11 66: k1_0 = 历排库.历排(o1_0, 筛卡库.筛怪兽卡)
07463271f6 2024-02-11 67: k1_0 = 历排库.历排(k1_0, 筛卡库.筛攻击力)
95b5664d69 2024-02-10 68: --~ 总攻
95b5664d69 2024-02-10 69: k1 = 排算库.总和(k1_0)
95b5664d69 2024-02-10 70: --~ 总血
95b5664d69 2024-02-10 71: k2 = 排算库.总和(o2_0)
95b5664d69 2024-02-10 72: --~ 荐名
95b5664d69 2024-02-10 73: k3 = 基算库.除法(k1, k2)
95b5664d69 2024-02-10 74: k3 = 数库.指数次(k3, 2)
ed6d06d03d 2024-02-12 75: if 数库.是否错值(k3) then
95b5664d69 2024-02-10 76: return 0
95b5664d69 2024-02-10 77: else
95b5664d69 2024-02-10 78: k3 = 数库.几位小数(k3, 1)
ed6d06d03d 2024-02-12 79: return tostring(基算库.乘法(k3, 1000))
413d4284fd 2024-02-11 80: end
413d4284fd 2024-02-11 81: end
413d4284fd 2024-02-11 82: --~ 文件
413d4284fd 2024-02-11 83: --~ 编号
413d4284fd 2024-02-11 84: --~ 文件路
413d4284fd 2024-02-11 85: function d.察编号(o1, o2, o3)
413d4284fd 2024-02-11 86: local k1
413d4284fd 2024-02-11 87: k1 = string.gsub(o1, 文库.连("Debug", "%.", "SetAIName", "[^\n]+"), 文库.连([[Debug.SetAIName("]], o2, [[")]]), 1)
413d4284fd 2024-02-11 88: if k1 == o1 then
413d4284fd 2024-02-11 89: else
413d4284fd 2024-02-11 90: 写文件库.写文件(o3, k1)
40dd3ddbfb 2024-02-11 91: end
47e0a87646 2024-02-10 92: end
47e0a87646 2024-02-10 93: --~ 目对
47e0a87646 2024-02-10 94: function d.残局改名(o1_0)
47e0a87646 2024-02-10 95: local k1_0, k2_0, k3_0, k4_0, k5_0, k6_0, k7_0, k8_0, k9_0
413d4284fd 2024-02-11 96: local k10_0, k11_0, k12_0
47e0a87646 2024-02-10 97: --~ 文件名排
47e0a87646 2024-02-10 98: k1_0 = 历文库.历文(o1_0.文件目, 文件系库.dir)
07463271f6 2024-02-11 99: k1_0 = 历排库.历排(k1_0, 后缀库.全筛后缀, ".lua")
47e0a87646 2024-02-10 100: --~ 文件排
07463271f6 2024-02-11 101: k2_0 = 历排库.历排(k1_0, 后缀库.全筛后缀, ".lua")
07463271f6 2024-02-11 102: k2_0 = 历排库.历排(k2_0, 前缀库.加前缀, o1_0.文件目)
07463271f6 2024-02-11 103: k2_0 = 历排库.历排(k2_0, 读文件库.读文件)
07463271f6 2024-02-11 104: k2_0 = 历排库.历排(k2_0, string.gsub, 文库.连("%-%-", "%[", "(=*)", "%[", ".-", "%]", "%1", "%]"), "")
07463271f6 2024-02-11 105: k2_0 = 历排库.历排(k2_0, string.gsub, 文库.连("%-%-", "[^\n]*"), "")
47e0a87646 2024-02-10 106: --~ 则数排
07463271f6 2024-02-11 107: k3_0 = 历排库.历排(k2_0, d.局筛则数)
47e0a87646 2024-02-10 108: --~ 各文件的卡编排
07463271f6 2024-02-11 109: k4_0 = 历排库.历排(k2_0, d.局筛卡编)
47e0a87646 2024-02-10 110: --~ 各文件的卡对排
07463271f6 2024-02-11 111: k5_0 = 历排库.历排(k4_0, d.取卡对_一维)
47e0a87646 2024-02-10 112: --~ 有效果卡的卡对排
07463271f6 2024-02-11 113: k6_0 = 历排库.历排(k5_0, d.筛有效果卡)
47e0a87646 2024-02-10 114: --~ 有效果卡的张数排
07463271f6 2024-02-11 115: k7_0 = 历排库.历排(k6_0, table.maxn)
95b5664d69 2024-02-10 116: --~ 血排
07463271f6 2024-02-11 117: k11_0 = 历排库.历排(k2_0, d.局筛血)
47e0a87646 2024-02-10 118: --~ 荐名排
07463271f6 2024-02-11 119: k8_0 = 历排库.历二排(k6_0, k11_0, d.荐名)
0bb276043b 2024-02-11 120: --~ 新名排
07463271f6 2024-02-11 121: k9_0 = 历排库.历排(k1_0, string.gsub, 字集库.u8_to_a(文库.连(" ", ".+")), "")
413d4284fd 2024-02-11 122: --~ 编号排
07463271f6 2024-02-11 123: k10_0 = 历排库.历排(k1_0, string.gsub, 字集库.u8_to_a(文库.连(" ", ".+")), "")
07463271f6 2024-02-11 124: k9_0 = 历排库.历排(k9_0, string.gsub, 文库.连("%.", "lua", "$"), "")
413d4284fd 2024-02-11 125: for o1 = 1, #k1_0 do
413d4284fd 2024-02-11 126: k9_0[o1] = 文库.连(字集库.a_to_u8(o1_0.文件目), 字集库.a_to_u8(k9_0[o1]), " ", k3_0[o1], "_", 数库.几位整数(k7_0[o1], 2))
ed6d06d03d 2024-02-12 127: --~ print(k9_0[o1], "_", k8_0[o1], ".", "lua")
413d4284fd 2024-02-11 128: if k8_0[o1] == 0 then
413d4284fd 2024-02-11 129: k9_0[o1] = 文库.连(k9_0[o1], ".", "lua")
413d4284fd 2024-02-11 130: else
413d4284fd 2024-02-11 131: k9_0[o1] = 文库.连(k9_0[o1], "_", k8_0[o1], ".", "lua")
413d4284fd 2024-02-11 132: end
413d4284fd 2024-02-11 133: end
07463271f6 2024-02-11 134: k1_0 = 历排库.历排(k1_0, 前缀库.加前缀, o1_0.文件目)
07463271f6 2024-02-11 135: k9_0 = 历排库.历排(k9_0, 字集库.u8_to_a)
413d4284fd 2024-02-11 136: 历排库.历二排(k1_0, k9_0, os.rename)
07463271f6 2024-02-11 137: k10_0 = 历排库.历排(k10_0, 字集库.a_to_u8)
413d4284fd 2024-02-11 138: --~ 文排
07463271f6 2024-02-11 139: k12_0 = 历排库.历排(k9_0, 读文件库.读文件)
413d4284fd 2024-02-11 140: 历排库.历三排(k12_0, k10_0, k9_0, d.察编号)
47e0a87646 2024-02-10 141: end
47e0a87646 2024-02-10 142: d.目对 = {
47e0a87646 2024-02-10 143: ["文件目"] = "../single/"
47e0a87646 2024-02-10 144: , ["卡档路"] = [[D:\install\YGOPro\cards.cdb]]
47e0a87646 2024-02-10 145: }
0bb276043b 2024-02-11 146: d.目对 = 历对库.历值(d.目对, 基类库.操类, "string", 字集库.u8_to_a)
7641d52a05 2024-02-12 147: 卡档库.启卡档(d.目对.卡档路)
47e0a87646 2024-02-10 148: d.残局改名(d.目对)