|
Post by crisarrr on Aug 29, 2021 0:49:15 GMT
How to get the rectangular region of an image when it is found on screen?
also , do you have discord channel ?
|
|
|
Post by AnkuLua on Aug 29, 2021 2:31:29 GMT
We don't have discord. You can chat with us on facebook messenger www.facebook.com/app.ankulua/exists() return Match object. You can highlight match as region. m = exists("target.png") if (m) then m:highlight("m", 1) end
|
|
|
Post by crisarrr on Aug 29, 2021 11:45:43 GMT
We don't have discord. You can chat with us on facebook messenger www.facebook.com/app.ankulua/exists() return Match object. You can highlight match as region. m = exists("target.png") if (m) then m:highlight("m", 1) end I want to get specific location, (x, y, width, height) of the image when it's found on screen, to search another image on it and click it
|
|
|
Post by AnkuLua on Aug 29, 2021 12:01:52 GMT
m:getX() m:getY() m:getW() m:getH()
|
|
|
Post by crisarrr on Sept 4, 2021 21:08:22 GMT
m:getX() m:getY() m:getW() m:getH() Hi,doesn't work well for me , this is a test that I did before including it in the main program : --- Settings --- Settings:setCompareDimension(true, 1080) Settings:setScriptDimension(true, 1080) setImmersiveMode(true) Settings:set("AutoWaitTimeout", 10) Settings:set("MinSimilarity", 0.3) ROOT = scriptPath() DIR_IMAGES = ROOT .. "image/ZyrvorthianExchange/" DIR_LIBS = ROOT .. "libs/" setImagePath(DIR_IMAGES) --- getting region -- m = exists("BronzeStonex1.png") if (m) then m:highlight("m", 1) end locX = m:getX() locY = m:getY() locW = m:getW() locH = m:getH() region = Region(locX, locY, locW ,locH) --- exchanging --- if (m) then region:click("Produce.png") wait(2) endBronzeStonex1.png is  and that's results of exists:  btw i want to find A , get regions of A , and click B (that is inside A)
|
|
|
Post by AnkuLua on Sept 4, 2021 22:21:14 GMT
Your BronzeStonex1.png is tool small And your similarity is too small
That cause that you thought the image is found correctly.
How did you create BronzeStonex1.png?
When you create BronzeStonex1.png, you must be sure that the original screenshot is shown in 100%
And remove Settings:set("MinSimilarity", 0.3) Or set it to 0.8
|
|
|
Post by crisarrr on Sept 4, 2021 23:23:02 GMT
Your BronzeStonex1.png is tool small And your similarity is too small That cause that you thought the image is found correctly. How did you create BronzeStonex1.png? When you create BronzeStonex1.png, you must be sure that the original screenshot is shown in 100% And remove Settings:set("MinSimilarity", 0.3) Or set it to 0.8 BronzeStonex1.png was created with MWSnap And mw shows the Android screen as 100% Tried with 0.4 to 0.9,and can't find it, already deleted it and can't find
|
|
|
Post by Exilereven on Sept 5, 2021 0:10:56 GMT
Your BronzeStonex1.png is tool small And your similarity is too small That cause that you thought the image is found correctly. How did you create BronzeStonex1.png? When you create BronzeStonex1.png, you must be sure that the original screenshot is shown in 100% And remove Settings:set("MinSimilarity", 0.3) Or set it to 0.8 BronzeStonex1.png was created with MWSnap And mw shows the Android screen as 100% Tried with 0.4 to 0.9,and can't find it, already deleted it and can't find i recommend ankulua.boards.net/thread/531/tool-snapyourscript
|
|
|
Post by crisarrr on Sept 5, 2021 1:04:01 GMT
Will try today, but, I can take snapshots in tablet? For convenience when taking snaps
|
|
|
Post by Exilereven on Sept 5, 2021 1:14:29 GMT
it will give you images, regions, pixel color, compare images/color, very useful tool by Mercobots. it wilk run directly on any device or emulator and will use the current resolution of current device being ran on.(you can also manually adjust the script).
|
|
|
Post by crisarrr on Sept 5, 2021 1:32:29 GMT
it will give you images, regions, pixel color, compare images/color, very useful tool by Mercobots. it wilk run directly on any device or emulator and will use the current resolution of current device being ran on.(you can also manually adjust the script). But, if I take snaps on my tablet, can I use these snaps on my mobile phone? With different width
|
|
|
Post by Exilereven on Sept 5, 2021 1:40:41 GMT
it will give you images, regions, pixel color, compare images/color, very useful tool by Mercobots. it wilk run directly on any device or emulator and will use the current resolution of current device being ran on.(you can also manually adjust the script). But, if I take snaps on my tablet, can I use these snaps on my mobile phone? With different width if they have the same ratio yes, but they wont. tabs are 800x, your phone is like 720x. now if your game runs in portrait mode and both your tablet and phone are 1080 resolution, you can use same images for both, but you will most likely have the screen end up too long to short on some one elses phone. the only issue will be if your using alot of exact locations you will need to adjust for different heights of phones. but the images wilk still work on both.
|
|
|
Post by crisarrr on Sept 5, 2021 3:04:28 GMT
But, if I take snaps on my tablet, can I use these snaps on my mobile phone? With different width if they have the same ratio yes, but they wont. tabs are 800x, your phone is like 720x. now if your game runs in portrait mode and both your tablet and phone are 1080 resolution, you can use same images for both, but you will most likely have the screen end up too long to short on some one elses phone. the only issue will be if your using alot of exact locations you will need to adjust for different heights of phones. but the images wilk still work on both. Finally works, thanks. Another question, if I want to do(snaps) for multiple widht/resolution , memu is good?
|
|
|
Post by Exilereven on Sept 5, 2021 3:12:57 GMT
if they have the same ratio yes, but they wont. tabs are 800x, your phone is like 720x. now if your game runs in portrait mode and both your tablet and phone are 1080 resolution, you can use same images for both, but you will most likely have the screen end up too long to short on some one elses phone. the only issue will be if your using alot of exact locations you will need to adjust for different heights of phones. but the images wilk still work on both. Finally works, thanks. Another question, if I want to do(snaps) for multiple widht/resolution , memu is good? honestly it seems like hit or miss between Memu, Bluestacks, and my preferred LDPlayer.
|
|
|
Post by starloc96 on Aug 11, 2022 16:19:07 GMT
The script is no longer usable. Do you have a way to replace it?
|
|