北大侠客行MUD论坛

 找回密码
 注册
搜索
热搜: 新手 wiki 升级
查看: 1385|回复: 0

MushClient提取颜色-我是新手

[复制链接]
发表于 2022-6-10 08:29:38 | 显示全部楼层 |阅读模式
新手,看的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
北大侠客行Mud(pkuxkx.net),最好的中文Mud游戏!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|北大侠客行MUD ( 京ICP备16065414号-1 )

GMT+8, 2024-4-26 05:11 AM , Processed in 0.010371 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表