|
Post by kvid72 on Apr 23, 2024 2:25:29 GMT
Hello. How do I change the script If A found click B location. So would he click on B quickly a certain number of times or for a period of time? edit the .luar file. find the line with A.png and change the action to action = 'continueClick(Location(bx, by), 30)' here bx, by is the location of B. and 30 is the clicking times. Change them according to your requirement. Thanks, it works great. And another question. Does the random click option work based on a coordinate? As in this example from the textbook - continueClick(x, y, xRandom, yRandom, times): This function will click for the specified time in the area with the coordinates of the upper left corner (x, y) at the width and height (x + xRandom, y + yRandom).
|
|
|
Post by rxrickify on Apr 23, 2024 3:54:34 GMT
Do I have to manually edit the script to get the "If A found click B" function to work cuz I noticed it lets you pick that as one of the options. Also which file would I edit, the .BAK or .LUAR? I'm editing both using notepad and it only lets me save it as a .TXT file No. You don't need to edit the script for "If A found click B". Just use the swipe from A to B when recording. You should edit .luar And select other app to edit. It's strange that an app only allow saving as a .txt file Can you elaborate on "Swipe from A to be when recording"? When I click the "If A found click B" option and wait till the screen turns yellow, I first click A, wait for screen to turn yellow again, then click B location but the script ends up clicking both A and B. gyazo.com/65a045bfcdf85bd33f6d9c874c3cf436
|
|
|
Post by rxrickify on Apr 23, 2024 4:00:32 GMT
No. You don't need to edit the script for "If A found click B". Just use the swipe from A to B when recording. You should edit .luar And select other app to edit. It's strange that an app only allow saving as a .txt file Can you elaborate on "Swipe from A to be when recording"? When I click the "If A found click B" option and wait till the screen turns yellow, I first click A, wait for screen to turn yellow again, then click B location but the script ends up clicking both A and B I'd like the script to avoid clicking A, but click B whenever it detects "A"
|
|
|
Post by AnkuLua on Apr 23, 2024 6:20:40 GMT
No. You don't need to edit the script for "If A found click B". Just use the swipe from A to B when recording. You should edit .luar And select other app to edit. It's strange that an app only allow saving as a .txt file Can you elaborate on "Swipe from A to be when recording"? When I click the "If A found click B" option and wait till the screen turns yellow, I first click A, wait for screen to turn yellow again, then click B location but the script ends up clicking both A and B. gyazo.com/65a045bfcdf85bd33f6d9c874c3cf436Swipe is similar as drag and drop You touch down on A then move to B while keeping touch down Finally touch up on B
|
|
|
Post by rxrickify on Apr 23, 2024 10:08:02 GMT
Can you elaborate on "Swipe from A to be when recording"? When I click the "If A found click B" option and wait till the screen turns yellow, I first click A, wait for screen to turn yellow again, then click B location but the script ends up clicking both A and B. gyazo.com/65a045bfcdf85bd33f6d9c874c3cf436Swipe is similar as drag and drop You touch down on A then move to B while keeping touch down Finally touch up on B Got it to work now, just had to hold down my finger. Thanks!
|
|
|
Post by kvid72 on Apr 24, 2024 2:48:18 GMT
edit the .luar file. find the line with A.png and change the action to action = 'continueClick(Location(bx, by), 30)' here bx, by is the location of B. and 30 is the clicking times. Change them according to your requirement. Thanks, it works great. And another question. Does the random click option work based on a coordinate? As in this example from the textbook - continueClick(x, y, xRandom, yRandom, times): This function will click for the specified time in the area with the coordinates of the upper left corner (x, y) at the width and height (x + xRandom, y + yRandom).Hello. Please. Is there an answer to the last question?
|
|
|
Post by AnkuLua on Apr 24, 2024 3:44:45 GMT
edit the .luar file. find the line with A.png and change the action to action = 'continueClick(Location(bx, by), 30)' here bx, by is the location of B. and 30 is the clicking times. Change them according to your requirement. Thanks, it works great. And another question. Does the random click option work based on a coordinate? As in this example from the textbook - continueClick(x, y, xRandom, yRandom, times): This function will click for the specified time in the area with the coordinates of the upper left corner (x, y) at the width and height (x + xRandom, y + yRandom).Yes. It's based on coordiates However, it tap on the range from (x, y) to (x + xRandom, y + yRandom) Therefore, the width is xRandom. And the height is yRandom. It will click randomly inside the region.
|
|
|
Post by kvid72 on Apr 25, 2024 7:33:39 GMT
Thanks, it works great. And another question. Does the random click option work based on a coordinate? As in this example from the textbook - continueClick(x, y, xRandom, yRandom, times): This function will click for the specified time in the area with the coordinates of the upper left corner (x, y) at the width and height (x + xRandom, y + yRandom). Yes. It's based on coordiates However, it tap on the range from (x, y) to (x + xRandom, y + yRandom) Therefore, the width is xRandom. And the height is yRandom. It will click randomly inside the region. Hi. I can't get the random click in a certain area to work. No matter how I tried to make it work, the script clicks at one point. How can I change it? touchList[index] = {target = "1.png", region = Region(34, 235, 350, 350), id = "1", action = 'continueClick(Location(498, 1068),30))'} index = index + 1
|
|
|
Post by AnkuLua on Apr 25, 2024 8:17:45 GMT
Yes. It's based on coordiates However, it tap on the range from (x, y) to (x + xRandom, y + yRandom) Therefore, the width is xRandom. And the height is yRandom. It will click randomly inside the region. Hi. I can't get the random click in a certain area to work. No matter how I tried to make it work, the script clicks at one point. How can I change it? touchList[index] = {target = "1.png", region = Region(34, 235, 350, 350), id = "1", action = 'continueClick(Location(498, 1068),30))'} index = index + 1 continueClick(498, 1068, 5, 5, 30)
|
|
|
Post by konstantinq on May 6, 2024 7:22:26 GMT
New version of snapAndPlay.lua 3.5.0 released! code copy and paste to script (i took script from 9.0.5 version of ankuLua) pastebin.com/5auKBEkLWhat difference from 3.3.0? Sorry, but can show some of it: print(index .. ": " .. text)
else
local regionText = regionToString(reg, snapRegionExtra)
text = string.format('touchList[index] = {target = "%s.png", region = %s, id = "%s", action = \'%s\'}',
pngFileName, regionText, pngFileName, action)
addEditNumber("similar", 0.85) (was 0.9)
|
|
|
Post by rxrickify on May 20, 2024 6:32:49 GMT
My game seems to crash whenever using the "If Found A click B" script, is there a common fix for this?
|
|
|
Post by AnkuLua on May 23, 2024 13:55:59 GMT
My game seems to crash whenever using the "If Found A click B" script, is there a common fix for this? which game? Crash when recording or playback?
|
|
|
Post by kvid72 on Jun 16, 2024 16:40:50 GMT
Hello. Help me solve the following problem. When using dofile(scriptPath()), the following script does not start running on the first line. My example
------ NEXT_09_Bera ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "NEXT_09_Bera", action = 'click(matchResult); keyevent(4); wait(2); keyevent(4); wait(2); keyevent(4); wait(2); keyevent(4); keyevent(3); dofile(scriptPath() .. "luar/09_Bera.luar")'} index = index + 1
Then moves on to the next script
------ 1 ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "1", action = 'click'} index = index + 1 ------ 2 ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "2", action = 'click'} index = index + 1 ------ 3 ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "3", action = 'click'} index = index + 1 ------ 4 ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "4", action = 'click'} index = index + 1 ------ 5 ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "5", action = 'click'} index = index + 1 ------ 6 ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "6", action = 'click'} index = index + 1 ------ 7 ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "7", action = 'click'} index = index + 1 ------ 8 ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "8", action = 'click'} index = index + 1
------ 09_BeraSTART ----- touchList[index] = {target = "01_start.png", region = Region(559, -6, 110, 110), id = "09_BeraSTART", action = 'click(matchResult); keyevent(4); wait(2); keyevent(4); wait(2); keyevent(4); wait(2); keyevent(4); keyevent(3)'} index = index + 1
And lines 1 to 8 are skipped, and starts working with ------ 09_BeraSTART ----- Lines 1-8 were created to solve my problem, but I would like not to use extra lines in the code
|
|