function 主体函数()
local aa
local i
local k1
-- local file = io.open("D:\\5.txt", "r")
local k2
local k3
local s1
local s2
local passcode
-- assert(file)
-- local data = file:read("*a")
-- file:close()
local data=NPC对话框内容
k3=string.find(data,"验证",1,true)
if k3~=nil then
local pp
s1=string.find(data,"<COLOR=",1,true)
s2=string.find(data,">",1,true)
pp=string.sub(data,s1,s2)
data=string.gsub(data,pp,"AA")
for i=1,3 do
k1=匹配内容(data,[[([^\x00-\xff])]])
if k1~="error.Null" then
data=string.gsub(data,k1,"BB")
end
end
-- 输出信息(data)
pp=string.sub(data,2,12)
--输出信息(pp)
pp=string.gsub(pp,"A","")
pp=string.gsub(pp,"B","")
pp=string.sub(pp,1,1)
输出信息(pp)
if pp~="" then
data=string.gsub(data,pp,"B")
end
pp=string.sub(data,2,12)
--输出信息(pp)
pp=string.gsub(pp,"A","")
pp=string.gsub(pp,"B","")
pp=string.sub(pp,1,1)
if pp~="" then
data=string.gsub(data,pp,"B")
end
local mosuzi={}
mosuzi[0]="AABBBBBBAABBAAAAAABBBBAAAAAABBBBAAAAAABBBBAAAAAABBBBAAAAAABBBBAAAAAABBAABBBBBBAA"
mosuzi[1]="AAAABBAAAAAABBBBAAAAAAAABBAAAAAAAABBAAAAAAAABBAAAAAAAABBAAAAAAAABBAAAAAABBBBBBAA"
mosuzi[2]="AABBBBBBAABBAAAAAABBBBAAAAAABBAAAAAABBAAAAAABBAAAAAABBAAAAAABBAAAAAAAABBBBBBBBBB"
mosuzi[3]="AABBBBBBAABBAAAAAABBAAAAAAAABBAAAABBBBAAAAAAAAAABBAAAAAAAABBBBAAAAAABBAABBBBBBAA"
mosuzi[4]="AAAAAABBAAAAAABBBBAAAABBAABBAAAABBAABBAABBAAAABBAAAABBBBBBBBAAAAAABBAAAAAAAABBBB"
mosuzi[5]="BBBBBBBBBBBBAAAAAAAABBAAAAAAAABBBBBBBBAAAAAAAAAABBAAAAAAAABBBBAAAAAABBAABBBBBBAA"
mosuzi[6]="AABBBBBBAABBAAAABBAABBAAAAAAAABBBBBBBBAABBAAAAAABBBBAAAAAABBBBAAAAAABBAABBBBBBAA"
mosuzi[7]="BBBBBBBBBBBBAAAABBAAAAAAAABBAAAAAABBAAAAAAAABBAAAAAAAABBAAAAAAAABBAAAAAAAABBAAAA"
mosuzi[8]="AABBBBBBAABBAAAAAABBBBAAAAAABBAABBBBBBAABBAAAAAABBBBAAAAAABBBBAAAAAABBAABBBBBBAA"
mosuzi[9]="AABBBBBBAABBAAAAAABBBBAAAAAABBBBAAAAAABBAABBBBBBBBAAAAAAAABBAABBAAAABBAABBBBBBAA"
local mosuzi2={}
mosuzi2[0]="BBAAAAAABBAABBBBBBAAAABBBBBBAAAABBBBBBAAAABBBBBBAAAABBBBBBAAAABBBBBBAABBAAAAAABB"
mosuzi2[1]="BBBBAABBBBBBAAAABBBBBBBBAABBBBBBBBAABBBBBBBBAABBBBBBBBAABBBBBBBBAABBBBBBAAAAAABB"
mosuzi2[2]="BBAAAAAABBAABBBBBBAAAABBBBBBAABBBBBBAABBBBBBAABBBBBBAABBBBBBAABBBBBBBBAAAAAAAAAA"
mosuzi2[3]="BBAAAAAABBAABBBBBBAABBBBBBBBAABBBBAAAABBBBBBBBBBAABBBBBBBBAAAABBBBBBAABBAAAAAABB"
mosuzi2[4]="BBBBBBAABBBBBBAAAABBBBAABBAABBBBAABBAABBAABBBBAABBBBAAAAAAAABBBBBBAABBBBBBBBAAAA"
mosuzi2[5]="AAAAAAAAAAAABBBBBBBBAABBBBBBBBAAAAAAAABBBBBBBBBBAABBBBBBBBAAAABBBBBBAABBAAAAAABB"
mosuzi2[6]="BBAAAAAABBAABBBBAABBAABBBBBBBBAAAAAAAABBAABBBBBBAAAABBBBBBAAAABBBBBBAABBAAAAAABB"
mosuzi2[7]="AAAAAAAAAAAABBBBAABBBBBBBBAABBBBBBAABBBBBBBBAABBBBBBBBAABBBBBBBBAABBBBBBBBAABBBB"
mosuzi2[8]="BBAAAAAABBAABBBBBBAAAABBBBBBAABBAAAAAABBAABBBBBBAAAABBBBBBAAAABBBBBBAABBAAAAAABB"
mosuzi2[9]="BBAAAAAABBAABBBBBBAAAABBBBBBAAAABBBBBBAABBAAAAAAAABBBBBBBBAABBAABBBBAABBAAAAAABB"
local kk
local i
local j
local k
local n
local abstring={}
local desuzi={}
local depass={}
local testab
local depasscode
local desuzi={}
local kab
kab=匹配内容(data,[[([A-B]{58})]])
if kab~="error.Null" then
n=1
for i=1,8 do
kk=匹配内容(data,[[([A-B]{58})]])
if kk~="error.Null" then
abstring[i]=kk
data=string.gsub(data,kk,"",1)
--输出信息(abstring[i])
end
end
for j=1,49 do
for i=1,8 do
depass[i]=string.sub(abstring[i],j,j+9)
end
if depass[8]~=nil then
depasscode=table.concat{depass[1],depass[2],depass[3],depass[4],depass[5],depass[6],depass[7],depass[8]}
end
for k=0,9 do
if depasscode==mosuzi[k] then
desuzi[n]=tostring(k)
输出信息(desuzi[n])
n=n+1
end
end
end
if desuzi[1]==nil then
n=1
for j=1,49 do
for i=1,8 do
depass[i]=string.sub(abstring[i],j,j+9)
end
if depass[8]~=nil then
depasscode=table.concat{depass[1],depass[2],depass[3],depass[4],depass[5],depass[6],depass[7],depass[8]}
end
for k=0,9 do
if depasscode==mosuzi2[k] then
desuzi[n]=tostring(k)
输出信息(desuzi[n])
n=n+1
end
end
end
end
if desuzi[5]~=nil then
passcode=table.concat{desuzi[1],desuzi[2],desuzi[3],desuzi[4],desuzi[5]}
输出信息(passcode)
发言(passcode)
end
end
kab=匹配内容(data,[[([A-B]{46})]])
if kab~="error.Null" then
n=1
for i=1,8 do
kk=匹配内容(data,[[([A-B]{46})]])
if kk~="error.Null" then
abstring[i]=kk
data=string.gsub(data,kk,"",1)
--输出信息(abstring[i])
end
end
for j=1,37 do
for i=1,8 do
depass[i]=string.sub(abstring[i],j,j+9)
end
if depass[8]~=nil then
depasscode=table.concat{depass[1],depass[2],depass[3],depass[4],depass[5],depass[6],depass[7],depass[8]}
end
for k=0,9 do
if depasscode==mosuzi[k] then
desuzi[n]=tostring(k)
输出信息(desuzi[n])
n=n+1
end
end
end
if desuzi[1]==nil then
n=1
for j=1,37 do
for i=1,8 do
depass[i]=string.sub(abstring[i],j,j+9)
end
if depass[8]~=nil then
depasscode=table.concat{depass[1],depass[2],depass[3],depass[4],depass[5],depass[6],depass[7],depass[8]}
end
for k=0,9 do
if depasscode==mosuzi2[k] then
desuzi[n]=tostring(k)
输出信息(desuzi[n])
n=n+1
end
end
end
end
if desuzi[4]~=nil then
passcode=table.concat{desuzi[1],desuzi[2],desuzi[3],desuzi[4]}
输出信息(passcode)
发言(passcode)
end
end
end
end