diff --git a/modes/techmino49_easy.lua b/modes/techmino49_easy.lua index 93cf2512..c0c0bd15 100644 --- a/modes/techmino49_easy.lua +++ b/modes/techmino49_easy.lua @@ -33,7 +33,7 @@ return{ } PLY.newPlayer(1,340,15) local L={}for i=1,49 do L[i]=true end - local t=system~="Windows"and 0 or 2 + local t=CCloader_filename[system] and 0 or 2 while t>0 do local r=rnd(2,49) if L[r]then L[r],t=false,t-1 end diff --git a/modes/techmino49_hard.lua b/modes/techmino49_hard.lua index 7abcaa71..059416ef 100644 --- a/modes/techmino49_hard.lua +++ b/modes/techmino49_hard.lua @@ -33,7 +33,7 @@ return{ } PLY.newPlayer(1,340,15) local L={}for i=1,49 do L[i]=true end - local t=system~="Windows"and 0 or 4 + local t=CCloader_filename[system] and 0 or 4 while t>0 do local r=rnd(2,49) if L[r]then L[r],t=false,t-1 end diff --git a/modes/techmino49_ultimate.lua b/modes/techmino49_ultimate.lua index 5150029a..c9e7bca6 100644 --- a/modes/techmino49_ultimate.lua +++ b/modes/techmino49_ultimate.lua @@ -33,7 +33,7 @@ return{ } PLY.newPlayer(1,340,15) local L={}for i=1,49 do L[i]=true end - local t=system~="Windows"and 0 or 6 + local t=CCloader_filename[system] and 0 or 6 while t>0 do local r=rnd(2,49) if L[r]then L[r],t=false,t-1 end diff --git a/modes/techmino99_easy.lua b/modes/techmino99_easy.lua index 3bcd885f..d390a959 100644 --- a/modes/techmino99_easy.lua +++ b/modes/techmino99_easy.lua @@ -33,7 +33,7 @@ return{ } PLY.newPlayer(1,340,15) local L={}for i=1,100 do L[i]=true end - local t=system~="Windows"and 0 or 4 + local t=CCloader_filename[system] and 0 or 4 while t>0 do local r=rnd(2,99) if L[r]then L[r],t=false,t-1 end diff --git a/modes/techmino99_hard.lua b/modes/techmino99_hard.lua index c2543d48..d38f5bb6 100644 --- a/modes/techmino99_hard.lua +++ b/modes/techmino99_hard.lua @@ -33,7 +33,7 @@ return{ } PLY.newPlayer(1,340,15) local L={}for i=1,100 do L[i]=true end - local t=system~="Windows"and 0 or 4 + local t=CCloader_filename[system] and 0 or 4 while t>0 do local r=rnd(2,99) if L[r]then L[r],t=false,t-1 end diff --git a/modes/techmino99_ultimate.lua b/modes/techmino99_ultimate.lua index 78a7aff4..88daaead 100644 --- a/modes/techmino99_ultimate.lua +++ b/modes/techmino99_ultimate.lua @@ -33,7 +33,7 @@ return{ } PLY.newPlayer(1,340,15) local L={}for i=1,100 do L[i]=true end - local t=system~="Windows"and 0 or 4 + local t=CCloader_filename[system] and 0 or 4 while t>0 do local r=rnd(2,99) if L[r]then L[r],t=false,t-1 end diff --git a/parts/ai.lua b/parts/ai.lua index 6bd2db01..01543015 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -19,8 +19,37 @@ local blockPos={4,4,4,4,4,5,4} local scs={{0,1},{0,1},{0,1},{0,1},{0,1},{.5,.5},{-.5,1.5}} -------------------------------------------------Cold clear local CCblockID={6,5,4,3,2,1,0} -if system=="Windows"then - require("CCloader") +CCloader_filename = {} +CCloader_filename.Windows = {'CCloader.dll', '\\', {'x86_64'}} +CCloader_filename.Android = {'libCCloader.so', '/', {'arm64-v8a', 'armeabi-v7a'}} +CCloader_filename.Linux = {'libCCloader.so', '/', {'x86_64'}} +local function loadCC() + if not CCloader_filename[system] then return end + local concatter = CCloader_filename[system][2] + local function path_concat(paths) + local res = paths[1] + for i=2,#paths do + res = res .. concatter .. paths[i] + end + return res + end + local f + for i=1,#CCloader_filename[system][3] do + local function simulate_continue() + local CCloader_f, size = love.filesystem.read('data', path_concat({'lib', system, CCloader_filename[system][3][i], CCloader_filename[system][1]})) + if not CCloader_f then return end + local success, message = love.filesystem.write(CCloader_filename[system][1], CCloader_f, size) + if not success then return end + return package.loadlib(path_concat({love.filesystem.getSaveDirectory(), CCloader_filename[system][1]}), "luaopen_CCloader") + end + f = simulate_continue() + if f then break end + end + if not f then + CCloader_filename[system] = nil + return + end + f() BOT={ getConf= cc.get_default_config ,--()options,weights --setConf= cc.set_options ,--(options,hold,20g,bag7) @@ -80,6 +109,7 @@ if system=="Windows"then collectgarbage() end end +loadCC() -------------------------------------------------9 Stack setup local dirCount={1,1,3,3,3,0,1} local spinOffset={