Post by yamada on Jun 5, 2017 15:30:51 GMT
[Auto Script] Monster-sStrike - Auto Quest laps Download! >> DoWnload Monster-Strike << - Free Source code - Works with Android with Auto resolution - use DAEMON - AnkuluaPro2 v7.0.0 or above Screenshot data is included in the download file. This script is created with AutoMainPNG. >>> Manual of AutoMainPNG <<< >>> AutoMainPNG main page <<< The translation function is on the left |
AnkuLua folder <= monster-strike.lua only. A png file is unnecessary for this script. |
Settings:setScriptDimension(true, 1080)
Settings:setCompareDimension(true, 1080)
--説明 ページ
--http://capsulecontents.client.jp/
setManualTouchParameter(20, 2) -- see below for explanation
math.randomseed(os.time())
--フルスクリーン用
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 =
"233539,0xFFFB6B,472,897,0xFF9E08,585,906,538_1238,dumy^"..
"215424,0xE65900,637,1513,0x29355A,994,244,542_1492,dumy^"..
"215431,0xEE5D00,634,1478,0x29315A,875,597,538_1459,dumy^"..
"215446,0x5A5D6B,948,520,0x212021,955,1454,549_588,dumy^"..
"233622,0x293563,56,534,0xEE6D00,640,1513,534_1522,dumy^"..
"215452,0xF77900,640,1528,0x21315A,908,489,538_1559,dumy^"..
"215523,0x212029,952,528,0x9CA29C,1057,911,88_1718,dumy^"..
"215533,0x0092DE,537,172,0xB5FBFF,532,1269,523_1412,dumy^"..
"215541,0xFFFBE6,600,1011,0xC5CACE,526,1185,538_1061,dumy^"..
"215548,0xBDBEBD,50,560,0x5A5D5A,700,360,284_622,dumy^"..
"215555,0x9492A4,502,550,0x424552,841,856,200_852,dumy^"..
"215602,0xDEF3FF,266,904,0x1979FF,240,872,296_1028,dumy^"..
"215609,0x29498C,984,753,0x525152,61,999,320_1103,dumy^"..
"215620,0x314573,202,735,0x006D7B,447,1201,534_1216,dumy^"..
"215642,0x0855DE,1029,1631,0xC51000,52,1527,117_1568,B5642^"..
"215720,0x0855DE,1029,1631,0xCE1400,256,1526,321_1580,B5642^"..
"215738,0x0855DE,1029,1631,0xC51000,458,1527,525_1584,B5642^"..
"215748,0x0855DE,1029,1631,0xCE1400,660,1526,721_1563,B5642^"..
"220012,0xDE5500,604,1119,0x212852,284,1099,530_1091,dumy^"..
"220041,0xEEC200,174,187,0x7BE3E6,899,226,540_1628,dumy^"..
"230638,0xFFFFBD,534,106,0x6B5D42,492,1745,517_1128,dumy"
gColor_Dat.GCset(dat) --検索データーセット
function Drag(xs,ys,xe,ye,swipT)
local WHstart = XYren(xs,ys)
local WHend = XYren(xe,ye)
local ip = 2
local Xstep = (WHend[1]-WHstart[1])/10
local Ystep = (WHend[2]-WHstart[2])/10
acList={}
acList[1] = {action = "touchDown", target = Location(WHstart[1],WHstart[2])}
WHstart[1] = WHstart[1] + Xstep
WHstart[2] = WHstart[2] + Ystep
for cnt=1 ,10 do
WHstart[1] = WHstart[1] + Xstep
WHstart[2] = WHstart[2] + Ystep
acList[ip] = {action = "touchMove", target = Location(WHstart[1],WHstart[2])}
ip = ip + 1
end
acList[ip] = {action = "touchUp", target = Location(WHstart[1],WHstart[2])}
manualTouch(acList)
end
-- タップ前に実施する
function Tap_Mae(con)
--###DATATAPMAE###
return
end
-- タップ後に実施する
function Tap_Ato(con)
--###DATATAPATO###
if gColor_Dat.name[con] == "B5642" then -- 最後にありがとするよ
local sele = math.random(8)
if sele == 1 then
Drag(75,920,1013,920,50000)
end
if sele == 2 then
Drag(1013,920,75,920,50000)
end
if sele == 3 then
Drag(530,310,530,1263,50000)
end
if sele == 4 then
Drag(530,1263,530,310,50000)
end
if sele == 5 then
Drag(1005,1184,50,301,50000)
end
if sele == 6 then
Drag(50,301,1005,1184,50000)
end
if sele == 7 then
Drag(50,1184,1005,301,50000)
end
if sele == 8 then
Drag(1005,301,50,1184,50000)
end
end
return
end
--###DATATHANSU###
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