|
Post by lfec on Jan 21, 2016 2:25:13 GMT
even with 0.95 still it still find the button
|
|
|
Post by zpt on Jan 21, 2016 5:55:57 GMT
You can try raise it up to 0.99, in my experience it is nearly pixel-by-pixel similarity, so works not well if there is any kind of background animation or else slightest interference. Show us screenshots of your case.
Alternatively, if you need some cooldown, you can use os.time() for timestamp, something like:
timestamp = 0 cooldown = 20 if os.time()-timestamp > cooldown then click(button) timestamp = os.time() end
|
|
|
Post by lfec on Jan 21, 2016 12:05:13 GMT
Can i compare a match with other pattern? If i find the button (enabled or not), the i get this match and try a new patter on it, the disabled pattern. if normal pattern had the higher compatibility, its a normal button, else, a disabled button.
is this possible?
|
|
|
Post by AnkuLua on Jan 21, 2016 12:45:44 GMT
Can i compare a match with other pattern? If i find the button (enabled or not), the i get this match and try a new patter on it, the disabled pattern. if normal pattern had the higher compatibility, its a normal button, else, a disabled button. is this possible? Try this function. The function return the max index from a table of targets. function existsMultiMax(region, target) local oldROI = Settings:getROI(); local maxScore = 0 local maxIndex = 0 if (region ~= nil) then Settings:setROI(region) end for i, t in ipairs(target) do if (exists(t, 0)) then -- check once local score = getLastMatch():getScore() if (score > maxScore) then maxScore = score maxIndex = i end end end if (oldROI ~= nil) then Settings:setROI(oldROI) else Settings:setROI() end
if (maxScore == 0) then return -1 end return maxIndex end
You can use it as local maxIndex = existsMultiMax(nil, {"enable.png", "disable.png"}) if (maxIndex == 1) then -- enable else -- disable end However, it's still possible that both images get the same score. You may check the scores before using this function. A more suitable solution is under development. Stay tuned.
A more general way that we use is observing the behavior of the target app. Does the app start with enable or disable? Is there any difference on screen between clicking the enable and disable images? Hope that it helps you.
|
|
|
Post by lfec on Jan 21, 2016 13:26:37 GMT
will try this function. in fact there is no disabled button, But when you run out swords, a popup appears on screen, doing a glass efect on screen. Adding a shade of gray to the button.
|
|
|
Post by AnkuLua on Jan 21, 2016 13:28:28 GMT
will try this function. in fact there is no disabled button, But when you run out swords, a popup appears on screen, doing a glass effect on screen. Adding a shade of gray to the button. Yes. The disable button is the gray button.
|
|
|
Post by lfec on Jan 21, 2016 13:37:59 GMT
maybe i could do a check If i found the same button within a spam of 5 seconds, the click didn't work. it's a work around.
|
|
|
Post by botmaker on Feb 7, 2016 1:00:35 GMT
Thank you for fast update, got pro version, click() works perfect. Got two new problems: -Can't use dragDrop() in mentioned game specific on this screen i.imgur.com/3azTVUR.png to scroll list, in other parts of game that are able to use dragDrop() it works, as in another apps, tested with this: Settings:setCompareDimension(true, 1920) Settings:setScriptDimension(true, 1920) dragDrop(Location(965,500),Location(965,100)) tested with and without setAlternativeClick(true), tested with different dragDrop timing settings, may be the game needs very specific timing settings for this part of interface, will try. Avoided this by using zoom(965, 500, 965, 100, 965, 530, 965, 530, 300) (same coordinates as in dragDrop()) for scrolling those element, and here is the second problem: -Can't use clicks after zoom in any application (tested with the game and in sketch application) test code: Settings:setCompareDimension(true, 1920) Settings:setScriptDimension(true, 1920) setAlternativeClick(true) click(Location(1200,800)) zoom(965, 500, 965, 100, 965, 530, 965, 530, 300) wait(10) click(Location(1168,869)) Tested with and without setAlternativeClick(true),tested with different pause after zoom, tested with longClick(). First click() works as intended, second click() gives nothing, BUT second click() will work if I'll touch the screen during wait(). Tryed stopLongClick() after zoom(), just in case =) P.S. All in Daemon mode, no root, pro version. Hi There, I am facing same issue which is mentioned here. After usage of zoom function from point A to B and point C to D using step of 150/200/300, i get a unresponsive android tablet screen. dragDrop/swipe operaton fails on that resulting in zoom in /zoom out with those operations. Only when a manually zoom in or zoom out, it comes out of whatever zoom function got stuck into. Is anyone able to solve this yet ? function is not complex, its a call to zoom and a wait(1) and a swipe or dragdrop operation after that ->doesn't work --- tried calling zoom multiple times, no luck coming out of that 'stuck' situation I see that there is touchDown/Move/Up(PSMRL, seconds), apis are provided, does these support second/third finger touch as well ? Writing our own zoom function would become possible after this. any help is appreciated. Thanks!
|
|
|
Post by AnkuLua on Feb 7, 2016 1:19:50 GMT
Thank you for fast update, got pro version, click() works perfect. Got two new problems: -Can't use dragDrop() in mentioned game specific on this screen i.imgur.com/3azTVUR.png to scroll list, in other parts of game that are able to use dragDrop() it works, as in another apps, tested with this: Settings:setCompareDimension(true, 1920) Settings:setScriptDimension(true, 1920) dragDrop(Location(965,500),Location(965,100)) tested with and without setAlternativeClick(true), tested with different dragDrop timing settings, may be the game needs very specific timing settings for this part of interface, will try. Avoided this by using zoom(965, 500, 965, 100, 965, 530, 965, 530, 300) (same coordinates as in dragDrop()) for scrolling those element, and here is the second problem: -Can't use clicks after zoom in any application (tested with the game and in sketch application) test code: Settings:setCompareDimension(true, 1920) Settings:setScriptDimension(true, 1920) setAlternativeClick(true) click(Location(1200,800)) zoom(965, 500, 965, 100, 965, 530, 965, 530, 300) wait(10) click(Location(1168,869)) Tested with and without setAlternativeClick(true),tested with different pause after zoom, tested with longClick(). First click() works as intended, second click() gives nothing, BUT second click() will work if I'll touch the screen during wait(). Tryed stopLongClick() after zoom(), just in case =) P.S. All in Daemon mode, no root, pro version. Hi There, I am facing same issue which is mentioned here. After usage of zoom function from point A to B and point C to D using step of 150/200/300, i get a unresponsive android tablet screen. dragDrop/swipe operaton fails on that resulting in zoom in /zoom out with those operations. Only when a manually zoom in or zoom out, it comes out of whatever zoom function got stuck into. Is anyone able to solve this yet ? function is not complex, its a call to zoom and a wait(1) and a swipe or dragdrop operation after that ->doesn't work --- tried calling zoom multiple times, no luck coming out of that 'stuck' situation I see that there is touchDown/Move/Up(PSMRL, seconds), apis are provided, does these support second/third finger touch as well ? Writing our own zoom function would become possible after this. any help is appreciated. Thanks! Unfortunately, these functions' behaviors are now dependent on games and devices. Sorry about it. Trying to find solutions now...
|
|
|
Post by botmaker on Feb 7, 2016 6:40:31 GMT
Hi There, I am facing same issue which is mentioned here. After usage of zoom function from point A to B and point C to D using step of 150/200/300, i get a unresponsive android tablet screen. dragDrop/swipe operaton fails on that resulting in zoom in /zoom out with those operations. Only when a manually zoom in or zoom out, it comes out of whatever zoom function got stuck into. Is anyone able to solve this yet ? function is not complex, its a call to zoom and a wait(1) and a swipe or dragdrop operation after that ->doesn't work --- tried calling zoom multiple times, no luck coming out of that 'stuck' situation I see that there is touchDown/Move/Up(PSMRL, seconds), apis are provided, does these support second/third finger touch as well ? Writing our own zoom function would become possible after this. any help is appreciated. Thanks! Unfortunately, these functions' behaviors are now dependent on games and devices. Sorry about it. Trying to find solutions now... Perhaps you can introduce new API with simply supporting touchDown((firstFinger touch = 0 , 1 ,2), x,y) touchMove(touch, x,y) touchUp <firstFinger/2nd/3rd>, or slightly different. This will give ankulua Multi-touch capability. In the mean time till these APIs are released, perhaps Zoom api could be fixed !! Thanks for looking into this.
|
|
hami
New Member
Posts: 2
|
Post by hami on Mar 14, 2016 9:27:09 GMT
ankulua.boards.net/post/130/threadLet me repeat your question in another way: I found that there is no way for making Clicks Continuously fast; even by using some methods like: touchDown(), touchUp(). Of course there are some ways in Sikuli, but they doesn't work in Ankulua. Maybe we can consider it as a bug in some way. Ankulua is perfect for me to make some bots for Android gaming, but this problem doesn't let me to make my perfect bots. Please help me if you know a solution.
|
|
hami
New Member
Posts: 2
|
Post by hami on Mar 14, 2016 9:31:23 GMT
Is the continueClick too fast? Why is the high speed problem? Another curiosity. It's not necessarily too fast, it just doesn't run long enough. And two continueClicks right after eachother have a "pause" inbetween. If I'm not clear enough, please let me know
|
|
|
Post by AnkuLua on Mar 14, 2016 10:18:14 GMT
It's not necessarily too fast, it just doesn't run long enough. And two continueClicks right after eachother have a "pause" inbetween. If I'm not clear enough, please let me know Normally the pause in between is short. However, in some devices, the pause is long. In that case, try with "(BETA) Use alternative method for touches except click." turned on in settings. And you can continueClick with many clicks as you want.
|
|
mgzg
New Member
Posts: 7
|
Post by mgzg on Mar 23, 2016 21:13:43 GMT
Is there any way to use Lua function type() (returns data type of argument) instead of Ankulua/Sikuli type()in AnkuLua script?
Unfortunately, you can't do it now. Why do you need it? Maybe we can do it in another way. Also may I suggest function like waitUserTap(seconds) which will wait for user's touch for x seconds and return it's location or false if no touch?
No. The touch will be consumed by the running app. AnkuLua can not sense it. I am also in need of the type() function to do deepcopy for table copying. See: Copy table by value.
PS. Thank you for continueMultiTouch. After figuring out this issue and adding a UI and changing hard coded Locations to be searched my script should be ready to release Edit: and now after a few hours of things working(to an extent), the ioexception 251 on zoom has started here too. Previous mentions were met with suggestions of other Roms and alternative click. The ROM isn't an issue as it worked before and nothing changed. Alternate click changes it to ioexception 127 Edit2: I have root on my tablet including a remote shell interface to debug this issue if you have suggestions Does the touch functionality run using input or sendevent commands? Using a root shell sendevent is working fine here with event4. Ankulua has root perms and acknowledged as much on loading and when the script starts. The swipe function works but zoom and dragDrop functions return the IOException Does the AndroidManifest use preferExternal? Logcat is showing an issue of failed to load memtrack module Edit 3: decompiling AnkuLua tells me it does use sendevent. What program is using dd.m on sdcard root? Seems calls to the function that runs with that file as -f argument is the one throwing the ioexception /data/local/tmp/aklexec is the program that uses dd.m What can set Settings.execute to false? aklexec is missing aklexec from root of sdcard is only 174bytes. If I copy that to /data/local/tmp then IOException changes to 134. OK, aklexec is just passing the parameters to a Monkey process, is this the same concept as the daemon monkeyrunner or whatever? com.android.commands.monkey is used via app_process. Trying this manually I see that the package is not found in logcat I do have a commandline command Monkey that I can use. Only issue there is my shell doesn't have fuse mount for sdcard done It seems aklexec is used when AnkuLuaTouch is true.(alternative click) I wasn't using that when things were working so Monkey not performing well is the issue settings.execute can be set false seemingly only with exitScript() so no issue on that IOException throw Edit 5: tested using a monkey script from /data/local/tmp manually for PinchZoom. Works as expected besides an error for scriptlog not able to touch sdcard. Ankulua adds a RM cmd for SD card which seems like a likely cause of failure here By adding export EXTERNAL_STORAGE=/data/local/tmp before call to Monkey the scriptlog issue is resolved. By adding -f parameters to RunCmd that does the removal of /sdcard/dd.m the other issue is resolved FIXED locally: SuperSU added mount namespace separation. By disabling this the current AnkuLua works again. I think this solution is less than ideal due to safety, but could solve the issue for others
|
|
mgzg
New Member
Posts: 7
|
Post by mgzg on Mar 26, 2016 12:42:51 GMT
Being able to use our own Monkey script would be amazing for some users. Could implement our own multitouch using DispatchPointer with 13 parameters, the 13th being ID for which finger
|
|