|
Post by grimmjo0w on Dec 31, 2017 21:51:52 GMT
Hello. I have about 7 images. Each time a new picture appears on the screen with some of the images that I saved, after the script found a match, one action is performed, if nothing found, then another. Question. How can I add these images to one group, so that the script selects the appropriate one among them? What would be simple in the code
if exists("some group of images") then , but not like this
if exists("img1.png") or exists("img2.png") .... exists("img10.png") Please help me )
|
|
|
Post by AnkuLua on Jan 1, 2018 0:43:30 GMT
Please refer to snapAndPlay script. ankulua.boards.net/thread/326/general-script-most-games-snapOn lines starting from 825 local choice, id, match = regionWaitMulti(touchList, 30, debug, nil, index) if (choice ~= -1 and match) then -- you may just need following scripts matchResult = match local func = assert(loadstring(matchObject.action)) end
and have touchList as you want local index = 1 touchList = {} ------ 1 ----- touchList[index] = {target = Pattern("5.png"):similar(0.8):targetOffset(100, 200), region = Region(610, 314, 150, 150), id = "5", action = 'click(matchResult)'} index = index + 1
------ 2 ----- touchList[index] = {target = "exit.png", region = nil, id = "p8", action = 'scriptExit("Exit")'} index = index + 1
Or you can use snapAndPlay script directly Happy New Year and coding.
|
|