vadk123 Posted December 21, 2015 Share Posted December 21, 2015 Hello people. I made a script but i had a problem.I did the aprt the used to search a picture, and if it was find, will click it.But my problem is that is that didn't find i would like to script start a random click and at the same moment searching the picture.So... the image search i did, the random click also, buti couldn't make it search for the image as the same time it is random cliking with sleep function after any clicking.So it would bee like that:WhileIf imagesearch = 1 thenmouseclickonitelse$y = random(y, y2)$x = random(x, x2)click("LEFT", $x, $y) ; BUT AT THE SAME TIME SEARCHING FOR THE IMAGE, AND IF IT WAS FOUND click on it, if there is another one, click on it, or else it would start randomclicks again. I tried many times but couldn't make it. Tnx Link to comment Share on other sites More sharing options...
GordonFreeman Posted December 22, 2015 Share Posted December 22, 2015 (edited) I see no problem with your logic.; F6 to close HotKeySet("{F6}", "_Exit") While 1 $fImageSearch = Random(0, 1, 1) If $fImageSearch = True Then MouseClick("left", 1, 1) Else MouseClick("left", Random(1, @DesktopWidth, 1), Random(1, @DesktopHeight, 1)) EndIf WEnd Func _Exit() Exit EndFunc ;==>_Exit Edited December 22, 2015 by GordonFreeman Frabjous Installation Link to comment Share on other sites More sharing options...
vadk123 Posted December 22, 2015 Author Share Posted December 22, 2015 No, i'm saying that if the image i was searching find then click it and if it no one more like this image, make a random click.In your case it will make clicks on every parts without stopping if it's finding the image. I want to the random click click somewhere and start again searching the image, but the random click need have a sleep time, but if i put that sleep time the imagesearch won't working at this sleep moment, Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2015 Developers Share Posted December 22, 2015 So what is stopping you from taking the example shown and modifying it?Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
vadk123 Posted December 22, 2015 Author Share Posted December 22, 2015 Because i'm new on autoit and don't know much things...I was thinking something like that:While 1If $imagesearchresult = 1then Mouseclick("LEFT", x, y, 1)elseMouseclick(random, random);and return to the first part of the while, searching the image. But if i put sleep, it will pause all the script, is there any other way to make a wait time after the random click and make the image search working? EndifWend Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2015 Developers Share Posted December 22, 2015 (edited) Because i'm new on autoit and don't know much things...You are not that new as you were here before under a different account asking the same questions to automate a game.So I can only conclude you haven't made much progress and are doing again stuff that isn't allowed around here.Did you actually read those forum rules I pointed you too when I closed your first topic?Maybe it is a good time to start with that now and beter stick to it from here on.Jos Edited December 22, 2015 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now