新手,看的mushclient函数手册,还有更简单方式,目前不会...
触发抓的武当龟泉, lua脚本
function getcolor(name,line,wildcards,styles)
local line_num=GetLinesInBufferCount()
--Note("获取目标行数 line_num="..line_num)
t = GetStyleInfo (line_num) -- get all styles, all types for line line_num
for k, v in pairs (t) do
--Note ("style run = ", k) -- this is one style
for a, b in pairs (v) do -- display all info types for style
--Note (" item = ", a, " value = ", b)
if a=="textcolour" then
yanse_num=b
end
if a=="text" and b=="龟泉" then
yanse_cn=RGBColourToName(yanse_num)
Execute("say 这是龟泉 色号:"..yanse_num.." 色名:"..yanse_cn)
end
end
end
end |