--[[ Options start here ]]
local M="CHAT_MSG_SYSTEM"
function MS(msg)
SendChatMessage(msg)
end
function yz()
if (event==M) then
local zj=string.find(arg1, "答题时间")
if(zj) then
end
local s1=arg1
local zj=string.find(s1, "+")
if(zj) then
local s=arg1
local z="+"
local y="?="
local param1, param2 = string.find(s, z)
local m = string.len(s)
s=string.sub(s,param2+1)
local ts = string.reverse(s)
local param1, param2 = string.find(ts, y)
local m = string.len(s) - param2 + 1
local hou
if (y == false) then
hou = string.sub(s, m+1, string.len(s))
else
hou = string.sub(s, 1-1, m-1)
end
local s=arg1
local z=":"
local y="+"
local param1, param2 = string.find(s, z)
local m = string.len(s)
s=string.sub(s,param2+1)
local ts = string.reverse(s)
local param1, param2 = string.find(ts, y)
local m = string.len(s) - param2 + 1
local qian
if (strchar == false) then
qian = string.sub(s, m+11, string.len(s))
else
qian = string.sub(s, 1+10, m-1)
end
print(qian,"+",hou,"=",qian+hou)
MS(tostring(qian+hou))
else
local s=arg1
local z="-"
local y="?="
local param1, param2 = string.find(s, z)
local m = string.len(s)
s=string.sub(s,param2+1)
local ts = string.reverse(s)
local param1, param2 = string.find(ts, y)
local m = string.len(s) - param2 + 1
local hou
if (strchar == false) then
hou = string.sub(s, m+1, string.len(s))
else
hou = string.sub(s, 1-1, m-1)
end
local s=arg1
local z=":"
local y="-"
local param1, param2 = string.find(s, z)
local m = string.len(s)
s=string.sub(s,param2+1)
local ts = string.reverse(s)
local param1, param2 = string.find(ts, y)
local m = string.len(s) - param2 + 1
local qian
if (strchar == false) then
qian = string.sub(s, m+10, string.len(s))
else
qian = string.sub(s, 1+10, m-1)
end
print(qian,"-",hou,"=",qian-hou)
MS(tostring(qian-hou))
end
end
end
local F=CreateFrame("Frame")
F:SetScript("OnEvent",yz)
F:RegisterEvent(M)