|
Post by andreos on Sept 22, 2019 13:03:41 GMT
How do I get an image region to use it to find another image to click? I have a first image, among alike others, to be located. Inside that image, I have a common button, which must be clicked. In this example, I need to find the region of whole black rectangle of the middle (Something bla bla 2). Then I need to click "Click here" of that respective area. pasteboard.co/IyAyVYL.pngI've made this. Will try right now. if exists("blabla2.png") then blabla2Region = Region(Region.find("blabla2.png")) blabla2Region:existsClick("ClickHere.png") end Thanks!
|
|
|
Post by andreos on Sept 22, 2019 15:25:48 GMT
Got it.
|
|
|
Post by Latent on Oct 1, 2019 22:29:19 GMT
I went a little bit different way ankulua.boards.net/thread/1518/lib-mylib-ankulua-scriptsI use for such a task function F_RegImage and handed her the picture, the region offset the similarity, determining time --F_RegImage(image,reg,NewX,NewY,CustomSumilar,CustomTimeToIdentify) --F_RegImage(picture,[region],[offset X, Y offset],[ordered accuracy],[ordered time definition pictures])
-- ========== Libraries ================ -- Link library dofile(scriptPath().. "libs/MyLibs.lua") F_Log("--> Connecting MyLibs library - AnkuLua Script v " .. version_MyLibs)
image_1 = Pattern("image_1.png")
if (F_RegImage(image_1,reg_image_1,-150,0,0.7,3.1)) then -- search the entire screen image image_1.png, region nil, offset to -150 of X axis, Y axis at 0, in said hand determination precision 0.7, the manually search time 3.1 seconds reg_image_1 = reg_image -- for the following search instead of nil it is already possible to indicate exactly the image region that accelerates the search click(image_Center_new) --press with offset of 150 pixels on the X axis F_Debug("\t Press (left)") else F_Debug("[NOK]\t🚫 I do not see the picture 🖼".." "..image_1:getFileName()) end
Press the left of the image result And as a bonus, the next search region will not be nil, and given a value to be determined reg_image
There was only one problem for me.
How to recover a function of not reg_image, and reg_image_1 = Region (image: getX (), image: getY (), image: getW (), image: getH ()) To immediately get reg_image_1 variable and its value
|
|
|
Post by andreos on Oct 4, 2019 10:54:36 GMT
Interesting!
|
|