|
Post by hoanglenin on Jul 28, 2021 4:04:11 GMT
I have image A and B how can i make an area from image A to B, and then swipe C to D in that area
|
|
|
Post by AnkuLua on Jul 28, 2021 14:42:31 GMT
It's better to provide screenshots to describe what you want to do.
|
|
|
Post by hoanglenin on Jul 28, 2021 15:15:43 GMT
|
|
|
Post by hoanglenin on Jul 28, 2021 15:17:40 GMT
please! create a sample script for me! thank you
|
|
|
Post by AnkuLua on Jul 29, 2021 0:15:36 GMT
In your case, here is the suggestion
-- find the energy flash as an anchor flash = exists("energy.png") -- swipe offset from energy star match if (star) then swipe(flash:offset(x1, y1), flash(x2, y2), 1) -- change (x1, y1) and (x2, y2) according to your requirement -- change the swipe timing according to your requirement, here is 1 end
|
|
|
Post by hoangninyb on Jul 29, 2021 2:40:02 GMT
In your case, here is the suggestion -- find the energy flash as an anchor flash = exists("energy.png") -- swipe offset from energy star match if (star) then swipe(flash:offset(x1, y1), flash(x2, y2), 1) -- change (x1, y1) and (x2, y2) according to your requirement -- change the swipe timing according to your requirement, here is 1 end so is it possible to swipe from image A to image B?, i don't want to use x,y coordinates in this case!
|
|
|
Post by AnkuLua on Jul 29, 2021 12:10:14 GMT
Suggest to find the up left corner and lower right corner of the resion
upLeftMatch = exists("upLeftCorner.png") lowerRightMatch = exists("lowRightCorner.png") if (upLeftMatch and lowerRightMatch) then searchReg = Region(upLeftMatch:getX(), upLeftMatch:getY(), lowerRightMatch:getX() - upLeftMatch:getX(), lowerRightMatch:getY() + lowerRightMatch:getH() - upLeftMatch:getY()) searchReg:highlight(1) -- make sure the region is correct matchA = searchReg:exists("A.png") matchB = searchReg:exists("B.png") if (matchA and matchB) then swipe(matchA, matchB, 1) -- change the swipe timing according to your requirement, here is 1 end end
|
|
|
Post by hoanglenin on Jul 29, 2021 12:28:27 GMT
Suggest to find the up left corner and lower right corner of the resion upLeftMatch = exists("upLeftCorner.png") lowerRightMatch = exists("lowRightCorner.png") if (upLeftMatch and lowerRightMatch) then searchReg = Region(upLeftMatch:getX(), upLeftMatch:getY(), lowerRightMatch:getX() - upLeftMatch:getX(), lowerRightMatch:getY() + lowerRightMatch:getH() - upLeftMatch:getY()) searchReg:highlight(1) -- make sure the region is correct matchA = searchReg:exists("A.png") matchB = searchReg:exists("B.png") if (matchA and matchB) then swipe(matchA, matchB, 1) -- change the swipe timing according to your requirement, here is 1 end end
Before that I did the following and found it to work fine! TOP = exists(A1, 0.1) BOT = exists(A2, 0.1) xA1 = TOP:getX() xA2 = BOT:getX() yA1 = TOP:getY() yA2 = BOT:getY() h= (xA2-xA1) w= (yA2-yA1) wA2 = BOT:getW() hA2 = BOT:getH() PetRegion = Region(xA1, yA1, h+hA2, w+wA2) -- ========== main program =========== while true do PetRegion:highlight() if PetRegion:exists(A3, delayShort) then PetRegion:existsClick(A3, 0.1) else swipe(SW1,SW2,1) end PetRegion:highlightOff() end is it too verbose?
|
|
|
Post by AnkuLua on Jul 29, 2021 12:41:26 GMT
Anything working is great.
|
|