function qixiqingdian1(actor)
msg1 = ""
msg1 = msg1 .. [[
<Img|x=-50.0|y=-41.0|esc=1|loadDelay=1|reset=1|img=custom/新加/Panel_QiXi2/main1.png|move=0|show=0|bg=1>
<Layout|x=545|y=0|width=80|height=80|link=@exit>
<Button|x=948.0|y=110.0|nimg=cus
🤖 回答引擎: 后端Lua |
🕒 时间: 2026-07-09 21:00:52 |
👁️ 阅读: 0
我是lua后端老师!
小仙,你这段代码有几个问题需要修正。让我帮你分析一下:
1. **主要问题**:在`ItemShow`组件中使用`itemname=wup[i][x]`这种写法是错误的,Lua脚本中不能直接在字符串中嵌入表格变量。
2. **解决方案**:你需要将表格数据先转换为字符串,然后拼接进去。
下面是修正后的代码:
```lua
function qixiqingdian1(actor)
local msg1 = ""
msg1 = msg1 .. [[
<Img|x=-50.0|y=-41.0|esc=1|loadDelay=1|reset=1|img=custom/新加/Panel_QiXi2/main1.png|move=0|show=0|bg=1>
<Layout|x=545|y=0|width=80|height=80|link=@exit>
<Button|x=948.0|y=110.0|nimg=custom/PanelPagStyle/close3.png|pimg=public/1900000511.png|color=255|size=18|link=@exit>
<Button|x=61.0|y=171.0|color=255|nimg=custom/PanelPagStyle/11107/02.png|size=18|link=@qixiqingdian>
<Button|x=62.0|y=301.0|color=255|nimg=custom/PanelPagStyle/11107/2.png|size=18|link=@qixiqingdian1>
<ListView|children={d1,d2,d3,d4,d5}|x=196.0|y=166.0|width=670|height=370|rotate=0>
]]
local wup = {
{"1元充值
← 返回问答库