|
Post by gazelle on Jan 2, 2022 19:23:56 GMT
Hello masters, i need simple script. i am calling it as "simple", because script must be fast asap Let me explain my request step by step; i am playing a mobile game. No need to say its name. 1- search and find exact pixel color from current screen of game. (i have 6 exact hex colors) 2- if the script matches with any of that 6 hex colors, then tap to "click(Location(100, 100)". if no match, then tap to "click(Location(2300, 1070)" 3- loop. Thats it. is it possible to reduce execute time of script to under 1 second? That is really important for game. Thank you My phone resolution is 2340x1080
|
|
|
Post by AnkuLua on Jan 2, 2022 23:50:38 GMT
|
|
|
Post by gazelle on Jan 3, 2022 7:41:58 GMT
function findGoldens()
local r,g,b = getColor(snapshotColor())
if (r == 255 and b == 141 and g == 186) then
longClick(Location(100, 100), 0.01)
elseif (r == 255 and b == 141 and g == 187) then
longClick(Location(100, 100), 0.01)
elseif (r == 255 and b == 141 and g == 188) then
longClick(Location(100, 100), 0.01)
elseif (r == 255 and b == 141 5 and g == 189) then
longClick(Location(100, 100), 0.01)
elseif (r ==255 and b == 141 and g == 190) then
longClick(Location(100, 100), 0.01)
elseif (r ==255 and b == 141 and g == 191) then
longClick(Location(100, 100), 0.01)
else
longClick(Location(2300, 1050), 0.01)
end
end
can you help me about my code? is it true?
|
|
|
Post by AnkuLua on Jan 3, 2022 9:23:46 GMT
change local r,g,b = getColor(snapshotColor()) to snapshotColor() local r,g,b = getColor(Location(x, y))
modify the (x, y) to the location you want
It's better to print the color values for debugging print(string.format("r=%d, g=%d, b=%d", r, g, b))
The above only give you a syntax correct script. You need to debug the function. And normally, it's better to give the colors range, not fixed value.
|
|
|
Post by gazelle on Jan 3, 2022 14:10:24 GMT
i researched that getColor function little bit. but its not supporting colored pixels, right? i wanted to search some yellow colored pixels with that script.
|
|
|
Post by AnkuLua on Jan 3, 2022 23:37:41 GMT
i researched that getColor function little bit. but its not supporting colored pixels, right? i wanted to search some yellow colored pixels with that script.etC Of course, getColor() supports colored pixels. getColor() will return the r, g and b of the pixel.
|
|