整理代码
This commit is contained in:
@@ -4,11 +4,11 @@ LOADED=false
|
|||||||
ERRDATA={}
|
ERRDATA={}
|
||||||
|
|
||||||
--Pure lua modules (basic)
|
--Pure lua modules (basic)
|
||||||
COLOR= require'Zframework.color'
|
COLOR= require'Zframework.color'
|
||||||
TABLE= require'Zframework.tableExtend'
|
TABLE= require'Zframework.tableExtend'
|
||||||
STRING= require'Zframework.stringExtend'
|
STRING= require'Zframework.stringExtend'
|
||||||
PROFILE=require'Zframework.profile'
|
PROFILE= require'Zframework.profile'
|
||||||
JSON= require'Zframework.json'
|
JSON= require'Zframework.json'
|
||||||
do--Add pcall & MES for JSON lib
|
do--Add pcall & MES for JSON lib
|
||||||
local encode,decode=JSON.encode,JSON.decode
|
local encode,decode=JSON.encode,JSON.decode
|
||||||
JSON.encode=function(val)
|
JSON.encode=function(val)
|
||||||
@@ -30,18 +30,18 @@ do--Add pcall & MES for JSON lib
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Pure lua modules (complex)
|
--Pure lua modules (complex)
|
||||||
LOADLIB=require'Zframework.loadLib'
|
LOADLIB= require'Zframework.loadLib'
|
||||||
TASK= require'Zframework.task'
|
TASK= require'Zframework.task'
|
||||||
WS= require'Zframework.websocket'
|
WS= require'Zframework.websocket'
|
||||||
LANG= require'Zframework.languages'
|
LANG= require'Zframework.languages'
|
||||||
THEME= require'Zframework.theme'
|
THEME= require'Zframework.theme'
|
||||||
|
|
||||||
--Love-based modules (basic)
|
--Love-based modules (basic)
|
||||||
FILE= require'Zframework.file'
|
FILE= require'Zframework.file'
|
||||||
WHEELMOV=require'Zframework.wheelScroll'
|
WHEELMOV= require'Zframework.wheelScroll'
|
||||||
SCR= require'Zframework.screen'
|
SCR= require'Zframework.screen'
|
||||||
SCN= require'Zframework.scene'
|
SCN= require'Zframework.scene'
|
||||||
LIGHT= require'Zframework.light'
|
LIGHT= require'Zframework.light'
|
||||||
|
|
||||||
--Love-based modules (complex)
|
--Love-based modules (complex)
|
||||||
GC=require'Zframework.gcExtend'
|
GC=require'Zframework.gcExtend'
|
||||||
@@ -49,16 +49,16 @@ GC=require'Zframework.gcExtend'
|
|||||||
mText=GC.simpX
|
mText=GC.simpX
|
||||||
mDraw=GC.draw
|
mDraw=GC.draw
|
||||||
require'Zframework.setFont'
|
require'Zframework.setFont'
|
||||||
TEXT= require'Zframework.text'
|
TEXT= require'Zframework.text'
|
||||||
SYSFX= require'Zframework.sysFX'
|
SYSFX= require'Zframework.sysFX'
|
||||||
MES= require'Zframework.message'
|
MES= require'Zframework.message'
|
||||||
BG= require'Zframework.background'
|
BG= require'Zframework.background'
|
||||||
WIDGET= require'Zframework.widget'
|
WIDGET= require'Zframework.widget'
|
||||||
VIB= require'Zframework.vibrate'
|
VIB= require'Zframework.vibrate'
|
||||||
SFX= require'Zframework.sfx'
|
SFX= require'Zframework.sfx'
|
||||||
IMG= require'Zframework.image'
|
IMG= require'Zframework.image'
|
||||||
BGM= require'Zframework.bgm'
|
BGM= require'Zframework.bgm'
|
||||||
VOC= require'Zframework.voice'
|
VOC= require'Zframework.voice'
|
||||||
|
|
||||||
local ms,kb=love.mouse,love.keyboard
|
local ms,kb=love.mouse,love.keyboard
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
6~10:hD,sD,H,A,R,
|
6~10:hD,sD,H,A,R,
|
||||||
11~13:LL,RR,DD
|
11~13:LL,RR,DD
|
||||||
]]
|
]]
|
||||||
|
local pcall=pcall
|
||||||
local ins,rem=table.insert,table.remove
|
local ins,rem=table.insert,table.remove
|
||||||
local yield=coroutine.yield
|
local yield=coroutine.yield
|
||||||
local bot_cc={}
|
local bot_cc={}
|
||||||
@@ -71,15 +72,12 @@ function bot_cc:thread()
|
|||||||
end
|
end
|
||||||
function bot_cc:updateField()
|
function bot_cc:updateField()
|
||||||
local P=self.P
|
local P=self.P
|
||||||
|
local F0=P.field
|
||||||
local F,i={},1
|
local F,i={},1
|
||||||
for y=1,#P.field do
|
for y=1,#F0 do for x=1,10 do
|
||||||
for x=1,10 do
|
F[i],i=F0[y][x]>0,i+1
|
||||||
F[i],i=P.field[y][x]>0,i+1
|
end end
|
||||||
end
|
while i<=400 do F[i],i=false,i+1 end
|
||||||
end
|
|
||||||
while i<=400 do
|
|
||||||
F[i],i=false,i+1
|
|
||||||
end
|
|
||||||
if not pcall(self.ccBot.reset,self.ccBot,F,P.b2b>=100,P.combo)then
|
if not pcall(self.ccBot.reset,self.ccBot,F,P.b2b>=100,P.combo)then
|
||||||
print("CC is dead ("..P.id..")","error")
|
print("CC is dead ("..P.id..")","error")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ function BOT.new(P,data)
|
|||||||
bot.delay0=data.delay
|
bot.delay0=data.delay
|
||||||
if P.gameEnv.holdCount and P.gameEnv.holdCount>1 then P:setHold(1)end
|
if P.gameEnv.holdCount and P.gameEnv.holdCount>1 then P:setHold(1)end
|
||||||
|
|
||||||
local cc=require"CCloader"
|
local cc=LOADLIB"CCloader"
|
||||||
local opt,wei=cc.getDefaultConfig()
|
local opt,wei=cc.getDefaultConfig()
|
||||||
wei:fastWeights()
|
wei:fastWeights()
|
||||||
opt:setHold(data.hold)
|
opt:setHold(data.hold)
|
||||||
@@ -91,10 +91,10 @@ function BOT.new(P,data)
|
|||||||
local cc_lua=require"parts.bot.bot_cc"
|
local cc_lua=require"parts.bot.bot_cc"
|
||||||
setmetatable(bot,{__index=function(self,k)
|
setmetatable(bot,{__index=function(self,k)
|
||||||
return
|
return
|
||||||
self.ccBot[k] and function(_,...)self.ccBot[k](self.ccBot,...)end or
|
self.ccBot[k]and function(_,...)self.ccBot[k](self.ccBot,...)end or
|
||||||
cc_lua[k] and function(_,...)cc_lua[k](self,...)end or
|
cc_lua[k]and function(_,...)cc_lua[k](self,...)end or
|
||||||
baseBot[k] and baseBot[k] or
|
baseBot[k]and baseBot[k]or
|
||||||
error("MrZ did something bad again! He just wanted "..k)
|
error("No actions called "..k)
|
||||||
end})
|
end})
|
||||||
|
|
||||||
for i,B in next,P.nextQueue do
|
for i,B in next,P.nextQueue do
|
||||||
|
|||||||
Reference in New Issue
Block a user