• Q&A 已解决
  • 为什么同样的代码有的骰子用得了有的用得了

file = getDiceDir().."//plugin//Draw.lua"
file = io.open(file,"a")
file:write([[...]])

plugin\Draw.lua:12: attempt to index a nil value (global ‘file’)
报错是这样的,file:write([[…]])是第12行
一个骰子可以用,还有一个会报错
612的

    乐某人
    msg_order = {}

    function cs(msg)
    if(tonumber(msg.fromQQ) ~= 2083497680 and tonumber(msg.fromQQ) ~= 3388126692)then
    return “{nick}没有权限”
    end
    num = getUserConf(12345678900,“a”,0)
    num = num + 1
    name = “luaDraw”..num
    file = getDiceDir()..“//plugin//luaDraw.lua”
    file = io.open(file,“a”)
    rest = string.match(msg.fromMsg,“^[%s](.+)[%s]$”,#“.add牌堆”+1)
    if(rest == "" or rest == nil)then
    return “请{nick}输入牌堆名称”
    end
    file:write([[

    function ]]..name..[[(msg)
    return eventMsg(“.draw]]..rest..[[”,msg.fromGroup,msg.fromQQ)
    end
    msg_order[“]]..rest..[[”] = “]]..name..[[”]])
    file:close()
    setUserConf(12345678900,“a”,num)
    eventMsg(“.system load”, msg.fromGroup, msg.fromQQ)
    return “已添加快捷抽取”..rest
    end
    msg_order[“.add牌堆”] = “cs”

      乐某人
      plugin\Draw.lua:12: attempt to index a nil value (global ‘file’)
      报错是这样的,file:write([[…]])是第12行
      一个骰子可以用,还有一个会报错

        Deep Sea DogBird 我是可以使用的,嗯……你可以直接将路径写在io.open的第一个参数那里再试试,或者将//改成/,另外,建议先下载一个Userdate[dice路径],让你朋友试试能不能用,不能就说明是骰子本身的问题,该找色子姐√,能的话,就是脚本的问题

          说点什么吧...