Post by adn72 on Feb 17, 2021 19:02:27 GMT
I have a Samsung A70 phone and the screen resolution of this phone is as follows.
My code;
main.lua
This code won't fail on my phone, but it won't do anything either.
that's why I changed my resolution and edited my code like this.
main.lua
and this code worked.
Since I made my resolution 1920x1080, I took the screenshot from a phone with a resolution of 1920x1080 with the help of snapYourScript.lua
The phone model I saved the images (xiaomi mi6)
and my images (my pictures are in the image folder.)
and my code;
firstTry.lua
This code won't fail, but it can't read pictures.
When this code did not work, I retrieved my pictures from my phone whose resolution is 2400x1080 (Samsung Galaxy A70), with the help of snapYourScript.lua,
but my code still could not detect the pictures.
This code works on my Xiaomi mi6 model (1920x1080) phone. For this reason, I don't think there is an error in my code.
NOTE: While running my code on another phone, I did not forget to set the coordinates of the new region to that phone.
I'm waiting for your help
My code;
main.lua
Settings:setCompareDimension(true, 2400)
Settings:setScriptDimension(true, 1080)
Settings:set("MinSimilarity", 0.8)
madenRegion = Region(655,110,40,38)
function findLocation()
while(true) do
madenRegion:highlight(5)
end
end
findLocation()
This code won't fail on my phone, but it won't do anything either.
that's why I changed my resolution and edited my code like this.
main.lua
Settings:setCompareDimension(true, 1920)
Settings:setScriptDimension(true, 1080)
Settings:set("MinSimilarity", 0.8)
madenRegion = Region(655,110,40,38)
function findLocation()
while(true) do
madenRegion:highlight(5)
end
end
findLocation()
and this code worked.
Since I made my resolution 1920x1080, I took the screenshot from a phone with a resolution of 1920x1080 with the help of snapYourScript.lua
The phone model I saved the images (xiaomi mi6)
and my images (my pictures are in the image folder.)
and my code;
firstTry.lua
-- ========== Settings ================
Settings:setCompareDimension(true, 1920)
Settings:setScriptDimension(true, 1080)
Settings:set("MinSimilarity", 0.65)
-- ===LandTypeArea===
madenRegion = Region(655,110,40,38)
function landType()
if madenRegion:exists(Pattern("plunderGold.png"):similar(0.80),0) then
return 1
elseif madenRegion:exists(Pattern("plunderGrain.png"):similar(0.85),0) then
return 2
else
return 3
end
end
madenRegion:highlight(3)
local temp = landType()
if temp == 1 then
print("Gold")
elseif temp == 2 then
print("Grain")
else
print("Exp")
end
This code won't fail, but it can't read pictures.
When this code did not work, I retrieved my pictures from my phone whose resolution is 2400x1080 (Samsung Galaxy A70), with the help of snapYourScript.lua,
but my code still could not detect the pictures.
This code works on my Xiaomi mi6 model (1920x1080) phone. For this reason, I don't think there is an error in my code.
NOTE: While running my code on another phone, I did not forget to set the coordinates of the new region to that phone.
I'm waiting for your help