|
Post by tjaasy on Sept 4, 2018 21:19:21 GMT
why does my longclick not work?
longclick(Location(math.random(405,425),math.random(195,205)),) wait(math.random(900,1250)/1000)
|
|
|
Post by AnkuLua on Sept 4, 2018 23:59:37 GMT
why does my longclick not work? longclick(Location(math.random(405,425),math.random(195,205)),) wait(math.random(900,1250)/1000) Make sure the location response to long click. Or try different touch settings in AnkuLua settings. Or use touchDown(Location(x, y)) wait(1) touchUp(Location(x, y))
|
|
|
Post by tjaasy on Sept 8, 2018 18:18:15 GMT
is it possible to look in a region if there is a specific pixel color, in another coding language i use this
PixelSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ColorID
where x1, x2, y1, y2 is the region to look in for the colorID, can this be done in lua?
|
|
|
Post by Exilereven on Sept 8, 2018 18:20:50 GMT
|
|
|
Post by tjaasy on Sept 8, 2018 18:42:53 GMT
PixelSearch, DXlvl, DYlvl, 18, 73, 100, 120, 0xB3A68D, 1, Fast ; search for lvlup if Errorlevel = 1 click x,y else click DXlvl, DYlvl some more information about the function in ahk autohotkey.com/docs/commands/PixelSearch.htmis this possible or not? if it is please pm me paying a small buck for the solution
|
|
|
Post by AnkuLua on Sept 10, 2018 10:30:32 GMT
PixelSearch, DXlvl, DYlvl, 18, 73, 100, 120, 0xB3A68D, 1, Fast ; search for lvlup if Errorlevel = 1 click x,y else click DXlvl, DYlvl some more information about the function in ahk autohotkey.com/docs/commands/PixelSearch.htmis this possible or not? if it is please pm me paying a small buck for the solution We strongly suggest to use image recognition in stead of color search. It's more intuitive and easy to maintain and debug. If you really want more complex color search functions, you can always use getColor() to build the functions. The below is what you want. function BGRIDToRGB(value) local r = value % 0x100 value = math.floor(value / 0x100) local g = value % 0x100 value = math.floor(value / 0x100) local b = value % 0x100 return r, g, b end
function PixelSearch(X1, Y1, X2, Y2, ColorID , Variation, mode) local x, y, tx, ty; tx = -1 local tr, tg, tb = BGRIDToRGB(ColorID)
if (not Variation) then Variation = 0 end
snapshotColor() for y = Y1, Y2 do for x = X1, X2 do local r, g, b = getColor(Location(x, y)) if (math.abs(tr - r) <= Variation and math.abs(tg - g) <= Variation and math.abs(tr - r) <= Variation) then usePreviousSnap(false) ErrorLevel = 0 return x, y end end end usePreviousSnap(false) ErrorLevel = 1 return -1, -1 end Note: The functions are not verified and may contain bugs.
|
|
|
Post by joseltr on Sept 18, 2018 16:37:49 GMT
i have 2 questions for 2 methods
1.continueClick(100, 200, 150, 250, 10) as you said "This function will tap on the range from (x, y) to (x + xRandom, y + yRandom) for the specified times."
it means the result of region would be: 100,200,250,450, click 10 times, right? but my result not like that, it looks like (x +- xRandom) and (y +- yRandom), means x and y just like the middle of region
2.numberOCR( region, imagePrefix) i want to check the clock, just like: 03:01, then the returned result is: 31 (not correct). it does not trace number 0. but when the clock is 10:10, then returned result is: 1010 (correct)
any solution here, thanks sir!
|
|
|
Post by AnkuLua on Sept 18, 2018 23:36:18 GMT
i have 2 questions for 2 methods 1.continueClick(100, 200, 150, 250, 10) as you said "This function will tap on the range from (x, y) to (x + xRandom, y + yRandom) for the specified times." it means the result of region would be: 100,200,250,450, click 10 times, right? but my result not like that, it looks like (x +- xRandom) and (y +- yRandom), means x and y just like the middle of region 2.numberOCR( region, imagePrefix) i want to check the clock, just like: 03:01, then the returned result is: 31 (not correct). it does not trace number 0. but when the clock is 10:10, then returned result is: 1010 (correct) any solution here, thanks sir! 1. No. It's +, not +-. Think it as a Region. 2. It should be 301. Please share the script and the screenshot. The script should include the number images.
|
|
|
Post by joseltr on Sept 19, 2018 3:34:30 GMT
this is my test script, screenshot and explain is included after tested serveral times, i wonder is there has method :similar(int) to set similar to number.png?
thanks sir!
p/s: i solved the problem with continueClick, i just decrease dimension of region. plus, is there able to highlight the dimension of clickable region?
plus, is there able to call function from another .lua file from sub-folder
|
|
|
Post by alpha4d on Feb 23, 2019 5:06:12 GMT
Where is the phone rotated fuction.?
|
|
|
Post by AnkuLua on Feb 23, 2019 10:13:34 GMT
|
|
|
Post by alpha4d on Feb 23, 2019 10:21:57 GMT
|
|
|
Post by alpha4d on Feb 23, 2019 10:24:48 GMT
I want to lock (screen rotated) on portrait mode. Can i do?
|
|
|
Post by AnkuLua on Feb 23, 2019 10:32:50 GMT
I want to lock (screen rotated) on portrait mode. Can i do? No.
|
|
|
Post by alpha4d on Mar 11, 2019 11:42:33 GMT
is there any methods to expand Notifications Panel?
|
|