Daruman Posted February 2, 2019 Posted February 2, 2019 hey sorry if this is a no brainer but im still just learning. however i can not foigure out why this doesent work. what i want it to do is to moove to random position in a box i have made for it but for some reason its clicking way over the place. here is the code that should work however it isnt. any help is appricited ...... Else MouseMove(Random(47,897,1), Random(280,1037,1), 0) Sleep(500) EndIf ......
Moderators JLogan3o13 Posted February 2, 2019 Moderators Posted February 2, 2019 @Daruman you cannot expect decent help based off 3 lines with no context. Post your entire code, or a decent reproducer at least, if you wish help. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Daruman Posted February 2, 2019 Author Posted February 2, 2019 16 minutes ago, JLogan3o13 said: @Daruman you cannot expect decent help based off 3 lines with no context. Post your entire code, or a decent reproducer at least, if you wish help. HotKeySet("{ESC}", "quit") ;ESC to quit While 1 $Box = PixelSearch(30,89,1789,855,0xF1C393) If IsArray($Box) Then MouseMove($Box[0],$Box[1],0) MouseClick("left") Sleep(1750) Else MouseMove(Random(47,897,1), Random(280,1037,1), 0) MouseClick(left) Sleep(5000) EndIf WEnd Func quit() Exit EndFunc it searches in a box for pixel and if found it click it (that part works fine) if however its not found its suposed to click into random pos a another smaller box. that part is acting up. it clicks all over desktop for some reason
Nine Posted February 2, 2019 Posted February 2, 2019 (edited) 45 minutes ago, Daruman said: hey sorry if this is a no brainer but im still just learning. however i can not foigure out why this doesent work. what i want it to do is to moove to random position in a box i have made for it but for some reason its clicking way over the place. here is the code that should work however it isnt. any help is appricited ...... Else MouseMove(Random(47,897,1), Random(280,1037,1), 0) Sleep(500) EndIf ...... We dont get to have the original if only the else - like subz says got to repair my crystal ball. Fascinating story btw. Ty now. Can I ask you what is the application you want to automate ? Edited February 2, 2019 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Daruman Posted February 2, 2019 Author Posted February 2, 2019 26 minutes ago, Nine said: Ty now. Can I ask you what is the application you want to automate ? custom made "game" just for learning purposes
Moderators JLogan3o13 Posted February 2, 2019 Moderators Posted February 2, 2019 This is a game you have written yourself in AutoIt, or a third party game you are automating with AutoIt? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Daruman Posted February 2, 2019 Author Posted February 2, 2019 game i have made with public game engine
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