|
Post by bullets105 on Apr 20, 2017 19:24:03 GMT
I'm taking the step now to create my own script from scratch as snap and play and record and play don't do everything i need them to do. Obviously i know everything i want my script to do but I'm having issues immediately. I've got the first step completed of finding an image and clicking. The next thing i need is a swipe from location to location but it's failing to perform it. Am i writing it wrong??
-- ========== Settings ================ immersive = true setImmersiveMode(immersive) Settings:setCompareDimension(true, 1080) Settings:setScriptDimension(true, 1080) Settings:set("MinSimilarity", 0.60)
-- ========== main program ===========
wait(1) click("smtab.jpg") swipe(Location(391, 1265)(413, 1710))
I get an error and i don't understand why
|
|
|
Post by AnkuLua on Apr 20, 2017 23:44:59 GMT
swipe(Location(391, 1265), Location(413, 1710))
|
|
|
Post by bullets105 on Apr 21, 2017 0:02:22 GMT
Thank you
|
|
|
Post by bullets105 on Apr 21, 2017 6:48:54 GMT
Sometimes a loading screen gets in the way of an image click and the script goes.past it. It's critical the script doesn't continue until this step is complete. I thought I'd written it right
existsClick("htab.jpg",10)
Is this not do not move until click is made or 10 seconds elaspe?
|
|
|
Post by AnkuLua on Apr 21, 2017 6:51:39 GMT
Yes.
|
|
|
Post by bullets105 on Apr 21, 2017 7:32:29 GMT
So how could the script move past the chosen step without a click if this is in script? Is there an alternative method to ensure clicks made?
|
|
|
Post by AnkuLua on Apr 21, 2017 7:46:19 GMT
One possibility is that the graphics is shown, but the game(app) is not ready to accept the the click. The other is that the graphics is moving (say from right to left), and the script captures the moving part. You can use region to ensure the target region.
Try
if (exists("htab.jpg",10)) then getLastMatch():highlight(1) -- check if the highlight is what you want click(getLastMatch()) end
|
|
|
Post by bullets105 on Apr 21, 2017 8:58:26 GMT
Yes that's has worked much better. If i need to add another later in script i just repeat but add different pmsrl?
|
|
|
Post by AnkuLua on Apr 21, 2017 9:05:43 GMT
Yes.
|
|
|
Post by bullets105 on Apr 21, 2017 10:08:42 GMT
Last one.... I have a region i want it to search till it finds item but im struggling to make the code work
Region(282, 1189, 13, 420) is the region Click("boss.jpg") is he target
How do i put this together so it searches region until image is found and clicked
Thanks for your help
|
|
|
Post by AnkuLua on Apr 21, 2017 10:21:18 GMT
reg = Region(282, 1189, 13, 420) reg:existsClick("boss.png", 10) -- segguest to use png instead of jpg. Replace 10 seconds to any you want.
|
|
|
Post by bullets105 on Apr 21, 2017 10:44:30 GMT
Brilliant.. thanks
|
|