1: package.path = [[.\lua_lib\?.lua;]] .. package.path
2: package.cpath = [[.\lua_lib\?.dll;]] .. package.cpath
3: local 字集码互转库 = require("u8_to_a")
4: local u8 = 字集码互转库.u8_to_a
5: local f = require(u8("常用库"))
6: local d_3 = {}
7: --~ 文件路
8: --~ 普常量文件名
9: function d_3.产普常量文件(u1, u2)
f1bea6a75e 2024-02-13 10: local k1, k2
11: local h1_0
12: --~ 文
f1bea6a75e 2024-02-13 13: k1 = f.读文件(u1)
f1bea6a75e 2024-02-13 14: k1 = string.gsub(k1, "%-%-" .. "[^\n]*", "")
f1bea6a75e 2024-02-13 15: k1 = string.gsub(k1, "[ \t]", "")
16: --~ 常量排
f1bea6a75e 2024-02-13 17: h1_0 = f.历文(k1, string.gmatch, "[^\n]+")
18: for u1 = 1, #h1_0 do
19: h1_0[u1] = f.加前缀(h1_0[u1], [[h1_0.]])
20: end
21: --~ 文
f1bea6a75e 2024-02-13 22: k2 = f.加对限(h1_0)
f1bea6a75e 2024-02-13 23: f.写文件(k2, u2)
24: end
25: --~ 文件路
26: --~ 字段名文件名
27: function d_3.产字段名文件(u1, u2)
f1bea6a75e 2024-02-13 28: local k1, k2
29: local h1_0
30: --~ 文
f1bea6a75e 2024-02-13 31: k1 = f.读文件(u1)
32: --~ 常量排
f1bea6a75e 2024-02-13 33: h1_0 = f.历文(k1, string.gmatch, "[^\n]+")
34: h1_0 = f.历排(h1_0, f.全筛文, "^!setname")
35: for u3 = 1, #h1_0 do
36: h1_0[u3] = f.删左右空白(h1_0[u3])
37: h1_0[u3] = string.gsub(h1_0[u3], "^!setname ", "")
38: h1_0[u3] = string.gsub(h1_0[u3], "[|\t].+", "")
39: h1_0[u3] = string.gsub(h1_0[u3], " ", "=", 1)
40: h1_0[u3] = string.gsub(h1_0[u3], "[0-9a-z]+", "h1_0[%1]", 1)
41: h1_0[u3] = string.gsub(h1_0[u3], "=([^\n]+)", [[="%1"]], 1)
42: end
43: --~ 文
f1bea6a75e 2024-02-13 44: k2 = f.加对限(h1_0)
f1bea6a75e 2024-02-13 45: f.写文件(k2, u2)
46: end
47: d_3.产普常量文件([[D:\install\YGOPro/script/constant.lua]], u8("普常量.lua"))
48: d_3.产字段名文件([[D:\install\YGOPro/strings.conf]], u8("字段名.lua"))