From 1c43e92577eb6651a5f13ccf54e193174aa2df14 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 24 Aug 2021 01:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=9D=E8=AF=95=E6=8E=A5?= =?UTF-8?q?=E5=85=A5CC=E7=9A=84=E4=BB=A3=E7=A0=81=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=88=E6=B3=A8=E9=87=8A=EF=BC=89=EF=BC=8C=E7=AD=89=E5=BE=85?= =?UTF-8?q?=E5=90=8E=E7=BB=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/bot/init.lua | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/parts/bot/init.lua b/parts/bot/init.lua index 30485a66..71458734 100644 --- a/parts/bot/init.lua +++ b/parts/bot/init.lua @@ -29,18 +29,29 @@ function baseBot.update(bot) end end -local botMeta={__index=function(self,k) - MES.new('warn',"Undefined method: "..k) +local function undefMethod(self,k) + print('warn',"Undefined method: "..k) self[k]=NULL return NULL -end} +end +local botMeta={__index=undefMethod} return{ new=function(P,data) local bot={P=P} - if data.type=="/"then - -- - else + if data.type=="CC"then + -- local ccBot=require"parts.bot.cc_wrapper" + -- setmetatable(bot,{__index=function(self,method) + -- if ccBot[method]then + -- ccBot[method](ccBot) + -- elseif baseBot[method]then + -- baseBot[method](self) + -- else + -- undefMethod(self,method) + -- end + -- end}) + setmetatable(bot,botMeta) + elseif data.type=="9S"or true then--9s or else TABLE.cover(baseBot,bot) TABLE.cover(require"parts.bot.bot_9s",bot) bot.P:setRS('TRS')