TX79664738 发表于 2024-7-6 21:44:52

【分享】sendmsg 9 的扩展,自定义颜色显示

本帖最后由 TX79664738 于 2024-7-11 20:37 编辑

sendmsg 9 命令的自定义颜色显示 简单包装


------------------------------------------------------------
三端LUA中,当命令使用:
sendmsg9 250 我显示的是绿色tips信息
------------------------------------------------------------

可选颜色为引擎中 0-255 的颜色

--sendmsg 9 的扩展,自定义颜色显示
-- 参数1[可选颜色(0-255)]参数2[发送的消息]
-- author:绿色风 QQ79664738
function sendmsg9(actor,cid,str)
    local colors ={
      ="#000000",="#e1675f",="#8c4a31",="#946b4a",="#7b4a18",="#d6c6ad",="#94845a",="#a5b5ad",="#8c8c84",="#104ade",="#182100",="#008800",="#8c7b9c",
      ="#800000",="#ff5a5a",="#942900",="#734a29",="#944a00",="#524229",="#524218",="#6b7373",="#f7f7de",="#292921",="#183100",="#009400",="#7722cc",
      ="#008000",="#ff3131",="#bd3100",="#523118",="#8c847b",="#946318",="#6b5a29",="#182929",="#000818",="#4a4a39",="#183910",="#00de00",="#ddaaff",
      ="#808000",="#d65a52",="#c67352",="#8c4a18",="#6b635a",="#efd6ad",="#7b6321",="#18424a",="#081839",="#292918",="#63844a",="#00ee00",="#f0b42a",
      ="#000080",="#941000",="#6b3118",="#884411",="#4a4239",="#a58c63",="#9c7b21",="#31424a",="#081029",="#4a4a29",="#6bbd4a",="#00fb00",="#df009f",
      ="#800080",="#942918",="#c66b42",="#4a2100",="#292118",="#635a4a",="#dea500",="#63c6de",="#081800",="#7b7b42",="#63b54a",="#4a5a94",="#e317b3",
      ="#008080",="#390800",="#ce4a00",="#211810",="#463929",="#bda57b",="#5a5239",="#44ddff",="#082900",="#9c9c4a",="#63bd4a",="#6373b5",="#fffbf0",
      ="#c0c0c0",="#731000",="#a56339",="#d6945a",="#b5a594",="#5a4218",="#312910",="#8cd6ef",="#0052a5",="#5a5a29",="#5a9c4a",="#7b8cd6",="#a0a0a4",
      ="#558097",="#b51800",="#5a3118",="#c66b21",="#7b6b5a",="#bd8c31",="#cebd7b",="#736b39",="#007bde",="#424214",="#4a8c39",="#6b7bd6",="#808080",
      ="#9db9c8",="#bd6352",="#2a1000",="#ef6b00",="#ceb194",="#353129",="#635a39",="#f7de39",="#10294a",="#393900",="#63c64a",="#7788ff",="#ff0000",
       ="#7b7373",="#421810",="#150800",="#ff7700",="#a58c73",="#948463",="#94844a",="#f7ef8c",="#10396b",="#595900",="#63d64a",="#c6c6ce",="#00ff00",
       ="#2d2929",="#ffaa99",="#3a1800",="#a59484",="#8c735a",="#7b6b4a",="#c6a529",="#f7e700",="#10528c",="#ca352c",="#52844a",="#94949c",="#ffff00",
       ="#5a5252",="#5a1000",="#080000",="#423121",="#b59473",="#a58c5a",="#109c18",="#6b6b5a",="#215aa5",="#6b7321",="#317329",="#9c94c6",="#0000ff",
       ="#635a5a",="#733929",="#290000",="#181008",="#d6a573",="#5a4a29",="#428c4a",="#5a8ca5",="#10315a",="#293100",="#63c65a",="#313139",="#ff00ff",
       ="#423939",="#a54a31",="#4a0000",="#291808",="#efa54a",="#9c7b39",="#318c42",="#39b5ef",="#104284",="#313910",="#52bd4a",="#291884",="#00ffff",
       ="#1d1818",="#947b73",="#9d0000",="#211000",="#efc68c",="#423110",="#109429",="#4a9cce",="#315284",="#313918",="#10ff00",="#180084",="#ffffff",
       ="#181010",="#bd5231",="#dc0000",="#392918",="#7b6342",="#efad21",="#081810",="#3184b5",="#182131",="#424a00",="#182918",="#4a4252",
       ="#291818",="#522110",="#de0000",="#8c6339",="#6b5639",="#181000",="#081818",="#31526b",="#4a5a7b",="#526318",="#4a884a",="#52427b",
       ="#100808",="#7b3118",="#fb0000",="#422910",="#bd945a",="#292100",="#082910",="#deded6",="#526ba5",="#5a7329",="#4ae74a",="#635a73",
       ="#f27971",="#2d1810",="#9c7352",="#6b4218",="#633900",="#9c6b00",="#184229",="#bdbdb5",="#293963",="#314a18",="#005a00",="#ceb5f7"
       }
    local msg
    local cid_number = tonumber(cid)
    if cid_number and (cid_number >= 0) and (cid_number <= 255) then
      msg = string.format('{"Msg":"<font color=%s>%s</font>","Type":9}',"'"..colors.."'",str)
    else
       msg = string.format('{"Msg":"<font color=%s>%s</font>","Type":9}',"'"..colors.."'",str)
    end
    sendmsg(actor, 1,msg )
end

TX79664738 发表于 2024-7-11 20:29:15

本帖最后由 TX79664738 于 2024-7-11 20:37 编辑



   新更改
**** Hidden Message *****


我只是路过 发表于 2024-7-19 01:24:59

谢谢博主博主博主博主谢谢

121381910 发表于 2024-7-19 13:40:09

RE: 【分享】sendmsg 9 的扩展,自定义颜色显示 [修改

往事 发表于 2024-8-1 01:52:28

:handshake

lybaiyy 发表于 2024-8-7 05:59:53

dasdasdsasdfsd

aneno 发表于 2024-8-8 20:47:49

谢谢~~~~~~~~~~~~~~~~~

love5132235 发表于 2024-8-10 19:21:37

:):):):):):):):):)

wangxz2022 发表于 2024-8-12 17:59:32

66666666666

猫头鹰 发表于 2024-8-15 15:44:38

gerwgwe风个人国企我隔热个人情味广哥给
页: [1] 2 3
查看完整版本: 【分享】sendmsg 9 的扩展,自定义颜色显示