|
Post by drblast on Oct 15, 2021 0:17:32 GMT
Can someone explain how to calculate value of setCompareDimension
For example, I created screenshots at device with resolution 1080x2160 (aspect ratio 18:9) So I set
Settings:setScriptDimension(true, 1080) How to calculate Settings:setCompareDimension value for devices 720x1280 1080x1090 1080x2340 etc
I found such function on forum, but it's not my case:
function setupDimension(height)
local deviceWidth = getRealScreenSize():getX()
local deviceHeight= getRealScreenSize():getY()
local widthOverHeight = deviceWidth / deviceHeight
print(widthOverHeight)
if (widthOverHeight > (18/9 + 0.1)) then
local newDimension = widthOverHeight * height
Settings:setCompareDimension(true, newDimension)
print("new dimension = " .. newDimension)
end
end
|
|
|
Post by AnkuLua on Oct 15, 2021 0:32:45 GMT
The script is outdated.
You don't need to set different for different resolutions.
In your cases, if the game is portrait Settings:setScriptDimension(true, 1080)
If the game is landscape then Settings:setScriptDimension(false, 1080)
What's the game?
|
|
|
Post by drblast on Oct 15, 2021 10:54:35 GMT
The script is outdated. You don't need to set different for different resolutions. In your cases, if the game is landscape Settings:setScriptDimension(true, 1080) If the game is portrait then Settings:setScriptDimension(false, 1080) What's the game? Game is Great Sultan With flag set to False, script not works even on device where screenshots has been made. Also drag&drop too Point_2 = Location(screenX / 2 + screenX / 4, screenY / 2 + screenY / 4)
Point_1 = Location(screenX / 2, screenY / 2 + screenY / 4)
dragDrop(Point_2, Point_1) When I set (true, 1080) script work fine for "native" device and cannot detect some images on resolution 1080x1920 that compressed (or stretched) by vertical. Some examples: This image not found at device with resolution 1080x1920: In LDPlayer script can just drag and drop or click some small event icons, ant cannot click text captions at all
|
|
|
Post by AnkuLua on Oct 15, 2021 23:59:11 GMT
Sorry. Previous answer mixed the mode. Your game is on portrait. Therefore, Settings:setScriptDimension(true, 1080) should be ok. The problem may come from regions. Try not using regions when searching images.
Please share the screenshots on both resolutions.
You can try snap and play first. When recording enlarge the search regions. When playback, try searching without regions.
|
|
|
Post by drblast on Oct 19, 2021 21:51:33 GMT
Users found one more resolution where script not work 1080x2160 1080x2400 ibb.co/4N8b0cVWhen I merged to screens they are different not in vertical, but horizontal resolutions are the same ibb.co/kK5fMkDYes, I use regions - Half Screen, quater screen etc I haven't tried to find image without region
|
|
|
Post by drblast on Oct 19, 2021 22:35:57 GMT
I've just tried to not use regions in LDPlayer, and script clicked needed area. But as I said I cannot refuse using regions For example (screen below) I need to find tasks-icon (left lower coner) and then check if tasks-icon contains red btn in the corner. If I make img with red dot in the coner, script clicks the icon despite the absence red-dot in the corner www.screenpresso.com/=PzNRfI use following algorithm to detect red-dot: I find task-icon, take it's region and find a dot in the calculated small region near the button Method to find image: img = reg:exists(pattern:similar(CustomSumilar), CustomTimeToIdentify) This is only one feature of the script, but there are many of them in the whole script
|
|
|
Post by drblast on Oct 19, 2021 23:39:07 GMT
One more LDPlayer can find image I use only one word in pattern. But fo upper text I used both word in pattern. It cannot be found even with simple find (I also tried one word in pattern) Merge 1080x2160 vs 1080x1920 www.screenpresso.com/=2iaLb
|
|
|
Post by AnkuLua on Oct 20, 2021 8:29:02 GMT
One more LDPlayer can find image I use only one word in pattern. But fo upper text I used both word in pattern. It cannot be found even with simple find (I also tried one word in pattern) Merge 1080x2160 vs 1080x1920 www.screenpresso.com/=2iaLbIn that case, you need both images for 1920 and 2160.
|
|