Post by yamada on Jun 8, 2017 15:18:24 GMT
Minimon | |
play.google.com/store /apps/details?id=com.tfjoy.minimon | Tap the blue circle at random to make automatic if gColor_Dat.name[con] == "1529" then |
--http://capsulecontents.client.jp/
Settings:setScriptDimension(true, 1920)
Settings:setCompareDimension(true, 1920)
setImmersiveMode(true)
IfSet=20
--split
function split(str, del)
p, nrep = str:gsub("%s*"..del.."%s*", "")
return { str:match((("%s*(.-)%s*"..del.."%s*"):rep(nrep).."(.*)")) }
end
-- 他の画面サイズに対して修正する ww,hh
function XYren(xx,yy)
ww=1
hh=1
return {math.floor(xx*ww+0.5),math.floor(yy*hh+0.5)}
end
-- ankulua用 getColors
function getColors(list)
local colors = {}
local r, g, b = getColor(Location(list[1][1], list[1][2]))
colors[1] = r * 256 * 256 + g * 256 + b
usePreviousSnap(true)
for i = 2, #list do
r, g, b = getColor(Location(list[i][1], list[i][2]))
colors[i] = r * 256 * 256 + g * 256 + b
end
usePreviousSnap(false)
return colors
end
-- 取得した画像をチェック R G Bに分解し判定
function RGBchek(a,b)
local r1,g1,b1 = intToRgb(a)
local ra1,ga1,ba1 = intToRgb(b)
if math.abs(ra1-r1) <= IfSet then
if math.abs(ga1-g1) <= IfSet then
if math.abs(ba1-b1) <= IfSet then
return 1
end
end
end
return 0
end
-- RGBを分解
function intToRgb(val)
local GetRed = val % 256
val= ( val - GetRed ) / 256
local GetGreen = val % 256
val= ( val - GetGreen ) / 256
local GetBlue = val % 256
return GetBlue,GetGreen,GetRed
end
gColor = {}
gColor.new = function()
local obj ={}
local obj_name = {"Select" , "color_a" , "color_b"
, "tap" , "name" , "GC", "value"
, "color_c" , "color_d"}
for i,v in pairs(obj_name) do
obj[v] = {}
end
obj.index = 0
obj.GCset = function(self)
local a = split(self,"^")
for i,v in pairs(a) do
local a = split(v,",")
obj.index = obj.index + 1
obj["Select"][obj.index] = a[1]
obj["color_a"][obj.index] = a[2]
obj.GC[obj.index*2-1] = XYren(a[3],a[4])
obj["color_b"][obj.index] = a[5]
obj.GC[obj.index*2] = XYren(a[6],a[7])
obj["tap"][obj.index] = a[8]
obj["name"][obj.index] = a[9]
end
end
obj.GCfaind = function()
local rgb = getColors(obj.GC)
obj.value={}
for i=1 , obj.index do
obj.value[i] = {RGBchek(rgb[i*2-1],obj.color_a[i]) ,
RGBchek(rgb[i*2],obj.color_b[i])}
end
end
obj.GCGet = function()
local rgb = getColors(obj.GC)
obj.color_c = {}
obj.color_d = {}
for i=1 , obj.index do
obj["color_c"][i] = rgb[i*2-1]
obj["color_d"][i] = rgb[i*2]
end
end
obj.GCtap = function(self)
local txy = split(obj.tap[self],"_")
txy = XYren(txy[1],txy[2])
click(Location(txy[1],txy[2]))
end
return obj
end
gColor_Dat = {}
gColor_Dat = gColor.new() -- 初期化、インスタンス作成
--画面情報とタップデータ
dat =
"221042,0xF8B44D,891,983,0xCC8528,1143,306,952_984,dumy^"..
"221054,0xE2423B,1188,62,0xDE840D,247,962,437_575,1529^"..
"221054A,0xDC3D36,1201,66,0xE3880E,247,971,947_575,1529^"..
"221054B,0xDE840D,251,962,0xE1423B,1196,57,1345_505,1529^"..
"221054C,0xE68A0F,247,975,0xDC3D36,1192,74,692_438,1529^"..
"221529,0xDF840D,1668,968,0xDD3E37,1195,66,445_596,1529^"..
"221529A,0xDD830C,1665,966,0xE0413A,1192,62,705_721,1529^"..
"221529B,0xE0850D,1670,970,0xE1423A,1189,63,701_450,1529^"..
"221529C,0xDB810C,1661,962,0xDE3F38,1192,66,952_600,1529^"..
"221529D,0xE0850D,1673,971,0xDD3E37,1196,66,1203_467,1529^"..
"221529E,0xE0413A,1192,62,0xDB810C,1665,962,1085_267,1529^"..
"221529F,0xE2433C,1192,57,0xE5890E,1669,979,1596_288,1529^"..
"223803,0xDE3F38,1385,974,0xF2FF87,1544,941,1546_942,dumy^"..
"223811,0xB01B0D,472,1002,0x61A420,1571,1048,1654_1026,dumy^"..
"224406,0xB56F12,1073,749,0xD72114,1121,262,964_709,dumy^"..
"224437,0xDB2214,789,232,0xF9B643,1378,244,1368_232,dumy"
gColor_Dat.GCset(dat) --検索データーセット
-- タップ前に実施する
function Tap_Mae(con)
--###DATATAPMAE###1529
if gColor_Dat.name[con] == "1529" then --エネルギー補充のカウント
if math.random(10) >=4 then
IF_Exit = 1
end
end
return
end
-- タップ後に実施する
function Tap_Ato(con)
--###DATATAPATO###
return
end
--###DATATHANSU###
math.randomseed(os.time())
finGS = 0
doloopB = true
while doloopB do
gColor_Dat.GCfaind() --座標の色情報検索
IF_Exit = 0 -- タップ前に実施した内容により登録タップを飛ばす。
for con = 1 , gColor_Dat.index do
if (gColor_Dat.value[con][1] + gColor_Dat.value[con][2]) == 2 then
Tap_Mae(con) -- タップ前に実施する
if IF_Exit ~= 1 then
gColor_Dat.GCtap(con)
Tap_Ato(con) -- タップ後に実施する
break
end
end
end
wait(1)
end