490477db61 2024-02-03 1: package.path = [[.\lua_lib\?.lua;]] .. package.path
490477db61 2024-02-03 2: package.cpath = [[.\lua_lib\?.dll;]] .. package.cpath
490477db61 2024-02-03 3: local 字集码互转库 = require("u8_to_a")
490477db61 2024-02-03 4: local u8 = 字集码互转库.u8_to_a
490477db61 2024-02-03 5: local f = require(u8("常用库"))
13cd0daf30 2024-02-03 6: local 简文件库 = require("lfs")
a8787a258d 2024-02-03 7: local 简数据库库 = require("lsqlite3")
490477db61 2024-02-03 8: local d_5 = {}
b2d67bda64 2024-02-03 9: do
023be319b7 2024-02-03 10: local TYPE_SPELL = 0x2
023be319b7 2024-02-03 11: local TYPE_TRAP = 0x4
023be319b7 2024-02-03 12: local TYPE_EFFECT = 0x20
023be319b7 2024-02-03 13: local 有效果卡类排 = {
023be319b7 2024-02-03 14: TYPE_SPELL
023be319b7 2024-02-03 15: , TYPE_TRAP
023be319b7 2024-02-03 16: , TYPE_EFFECT
023be319b7 2024-02-03 17: }
023be319b7 2024-02-03 18: local 无效果灵摆怪兽排 = {
023be319b7 2024-02-03 19: 28363749 --火蛋白石头龙头领
023be319b7 2024-02-03 20: , 19474136 --曼陀林草龙
023be319b7 2024-02-03 21: , 17390179 --闪光之骑士
023be319b7 2024-02-03 22: , 83980492 --铜锣龙
023be319b7 2024-02-03 23: }
b2d67bda64 2024-02-03 24: --~ 卡对
023be319b7 2024-02-03 25: function d_5.筛有效果卡(o1_5)
b2d67bda64 2024-02-03 26:
b2d67bda64 2024-02-03 27: end
b2d67bda64 2024-02-03 28: end
b2d67bda64 2024-02-03 29: --~ 卡对排
023be319b7 2024-02-03 30: function d_5.筛有效果卡的卡数(o1_8)
d8075946c6 2024-02-03 31: local k1_8
b2d67bda64 2024-02-03 32: --~ 卡排
023be319b7 2024-02-03 33: k1_8 = f.历排(o1_8, d_5.筛有效果卡的卡数)
b2d67bda64 2024-02-03 34: return #k1
d8075946c6 2024-02-03 35: end
a8787a258d 2024-02-03 36: --~ 卡编排
a8787a258d 2024-02-03 37: function d_5.筛卡对_一维(o1_8)
a8787a258d 2024-02-03 38: return f.历排(o1_8, d_5.筛卡对)
a8787a258d 2024-02-03 39: end
a8787a258d 2024-02-03 40: --~ 卡编
a8787a258d 2024-02-03 41: function d_5.筛卡对(o1_8)
a8787a258d 2024-02-03 42: for o1_5 in 数据库:nrows("select * from datas where id = " .. o1_8) do
a8787a258d 2024-02-03 43: return o1_5
a8787a258d 2024-02-03 44: end
a8787a258d 2024-02-03 45: end
a8787a258d 2024-02-03 46: --~ 文
a8787a258d 2024-02-03 47: function d_5.局筛卡编(o1)
a8787a258d 2024-02-03 48: local k1_9
a8787a258d 2024-02-03 49: --~ 卡编排
a8787a258d 2024-02-03 50: k1_9 = f.历文(o1, string.gmatch, "[^\n]+")
a8787a258d 2024-02-03 51: k1_9 = f.历排(k1_9, f.全筛前缀, "Debug.AddCard")
a8787a258d 2024-02-03 52: return f.历排(k1_9, string.match, "[0-9]+")
a8787a258d 2024-02-03 53: end
d7e39f5d2e 2024-02-03 54: --~ 文
d7e39f5d2e 2024-02-03 55: function d_5.局筛则数(o1)
81015f535b 2024-02-03 56: local k1
81015f535b 2024-02-03 57: local k1_9
81015f535b 2024-02-03 58: --~ 则数排
81015f535b 2024-02-03 59: k1_9 = f.历文(o1, string.gmatch, "[^\n]+")
81015f535b 2024-02-03 60: k1_9 = f.历排(k1_9, f.全筛前缀, "Debug.ReloadFieldBegin")
a8787a258d 2024-02-03 61: --~ 则数
81015f535b 2024-02-03 62: k1 = string.match(k1_9[1], "[0-9]")
81015f535b 2024-02-03 63: return k1 or 3
d7e39f5d2e 2024-02-03 64: end
13cd0daf30 2024-02-03 65: --~ 目对
13cd0daf30 2024-02-03 66: function d_5.残局改名(o1)
a8787a258d 2024-02-03 67: local k1_9, k2_9, k3_9, k4_9, k5_9
3a58d8f06c 2024-02-03 68: --~ 文件排
13cd0daf30 2024-02-03 69: k1_9 = f.历文(o1.文件目, 简文件库.dir)
81015f535b 2024-02-03 70: k1_9 = f.历排(k1_9, f.全筛后缀, ".lua")
4d150d683b 2024-02-03 71: for o2 = 1, #k1_9 do
81015f535b 2024-02-03 72: k1_9[o2] = f.加前缀(k1_9[o2], o1.文件目)
81015f535b 2024-02-03 73: k1_9[o2] = f.读文件(k1_9[o2])
81015f535b 2024-02-03 74: k1_9[o2] = string.gsub(k1_9[o2], "%-%-" .. "%[(=*)%[" .. ".-" .. "%]%1%]", "")
81015f535b 2024-02-03 75: k1_9[o2] = string.gsub(k1_9[o2], "%-%-" .. "[^\n]*", "")
4d150d683b 2024-02-03 76: end
4d150d683b 2024-02-03 77: --~ 则数排
4d150d683b 2024-02-03 78: k2_9 = f.历排(k1_9, d_5.局筛则数)
a8787a258d 2024-02-03 79: --~ 各文件的卡编排
a8787a258d 2024-02-03 80: k3_9 = f.历排(k1_9, d_5.局筛卡编)
a8787a258d 2024-02-03 81: _G.数据库 = 简数据库库.open(o1.数据库路)
a8787a258d 2024-02-03 82: --~ 各文件的卡对排
a8787a258d 2024-02-03 83: k4_9 = f.历排(k3_9, d_5.筛卡对_一维)
023be319b7 2024-02-03 84: --~ 有效果卡的卡数排
023be319b7 2024-02-03 85: k5_9 = f.历排(k4_9, d_5.筛有效果卡的卡数)
13cd0daf30 2024-02-03 86: end
9cdbbb717e 2024-02-03 87: d_5.目对 = {
13cd0daf30 2024-02-03 88: ["文件目"] = "../single/"
13cd0daf30 2024-02-03 89: , ["数据库路"] = [[D:\install\YGOPro\cards.cdb]]
9cdbbb717e 2024-02-03 90: }
3a58d8f06c 2024-02-03 91: for o1, o2 in pairs(d_5.目对) do
3a58d8f06c 2024-02-03 92: d_5.目对[o1] = f.操类(o2, "string", u8)
13cd0daf30 2024-02-03 93: end
13cd0daf30 2024-02-03 94: d_5.残局改名(d_5.目对)