jksp22 Posted October 23, 2015 Share Posted October 23, 2015 Hello, there!I don't know how to use this product, but I am in need of a program where I can input a pixel (x,y) and the program will click on that pixel automatically.Or I need to specify pixel1 (x1,y1), pixel2 (x2,y2), and pixel3 (x3,y3) where I need to click on pixel1 and loop through to pixel2 by clicking all pixels within the range (box).But the process goes like this.1. click x1,y12. wait 3 seconds3. click x3,y34. click x1+1,y15. wait 3 seconds6. click x3,y3and so on. Is this possible? Thank you in advance! Link to comment Share on other sites More sharing options...
GordonFreeman Posted October 23, 2015 Share Posted October 23, 2015 YesPixelGetColor -> Get the color of a pixel in specified coords (x,y) Then you need X,Y and will get a decimal colorOrPixelSearch -> Search in an area for a pixel with specified coords Then you need Coords of a rectangle and a color and will get X,Y if some pixel in area have specified colorOrPixelChecksum -> You generate a checksum of a rectangle and get value, then you can compare later if are the same. Frabjous Installation Link to comment Share on other sites More sharing options...
jksp22 Posted October 23, 2015 Author Share Posted October 23, 2015 It doesn't have to do anything with color. It still works right?So how can I start? I downloaded autoit and installed it. What's my next step?Thanks! Link to comment Share on other sites More sharing options...
AutoBert Posted October 23, 2015 Share Posted October 23, 2015 Same procedure as in every new programming language, read the doc's, the wikis and try the examples for learning the basics. Link to comment Share on other sites More sharing options...
MuffinMan Posted October 23, 2015 Share Posted October 23, 2015 Dig in to the help file, specifically focusing on While, Sleep, and ControlClick (or MouseClick) Link to comment Share on other sites More sharing options...
jksp22 Posted October 23, 2015 Author Share Posted October 23, 2015 And that delay of 3-5 seconds. Is that possible as well? Link to comment Share on other sites More sharing options...
Developers Jos Posted October 23, 2015 Developers Share Posted October 23, 2015 And that delay of 3-5 seconds. Is that possible as well?Did you actually try to search first in the help file for this as MuffinMan clearly gave you the commands already?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...
jksp22 Posted October 23, 2015 Author Share Posted October 23, 2015 you didn't have to be that rude to point out that sleep is delay. who's going to ask for help in help forum if you just say go to the help file. it's all there. maybe i just like to talk to actual humans who can provide their knowledge in the area.but yes, i read it.thanks for the help everyone. It's going to help me a lot. I've been doing things manually. This might just increase my efficiency by 10 times. Link to comment Share on other sites More sharing options...
Developers Jos Posted October 23, 2015 Developers Share Posted October 23, 2015 I was not rude, just simply stated a fact as you posted your reply within 4 minutes of the help you had receive, so hence the question. When this feels as being rude then have a look in the mirror and have a good talk to the person you see.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...
jksp22 Posted October 23, 2015 Author Share Posted October 23, 2015 well then, i apologize.i was able to code something very simple for my purpose. It works as I intended.Now, I tried a simple gui to see if I can use an exe instead of going into the code to change the pixels.Got the inputs made for pixels, and everything...but gui disappears without a sleep(x).I don't want the gui to disappear unless I click on X or close button on onevent.What's required at this point? Link to comment Share on other sites More sharing options...
Developers Jos Posted October 23, 2015 Developers Share Posted October 23, 2015 Show your code in case it doesn't work the way you expect and explain what isn't working.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...
jksp22 Posted October 23, 2015 Author Share Posted October 23, 2015 (edited) expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode GUICreate("AutoClick", 450, 150) GUICtrlCreateLabel("Topleft of the box", 30, 10) Local $x1 = GUICtrlCreateInput("", 150,5, 100, 20) Local $y1 = GUICtrlCreateInput("", 300,5, 100, 20) GUICtrlCreateLabel("Bottomright of the box", 30, 50) Local $x2 = GUICtrlCreateInput("", 150,45, 100, 20) Local $y2 = GUICtrlCreateInput("", 300,45, 100, 20) GUICtrlCreateLabel("Pixels for Hole #", 30, 90) Local $x3 = GUICtrlCreateInput("", 150,85, 100, 20) Local $y3 = GUICtrlCreateInput("", 300,85, 100, 20) Local $run = GUICtrlCreateButton("Run", 150, 120, 85, 25) Local $closeapp = GUICtrlCreateButton("Close", 250, 120, 85, 25) GUICtrlSetOnEvent($run, "clickpixels") GUICtrlSetOnEvent($closeapp, "closeapp") Func closeapp() MsgBox($MB_OK, "Good-bye", "You selected CLOSE! Exiting...") Exit EndFunc GUISetState(@SW_SHOW) sleep(5000) <- without this, gui just opens and disappears right away. i'm probably missing something here. Func clickpixels() While $x1 <= $x2 While $y1 <= $y2 MouseClick($MOUSE_CLICK_LEFT, $x1, $y1, 1, 10) Sleep(3000) $y1 = $y1 + 1 MouseClick($MOUSE_CLICK_LEFT, $x3, $y3, 1, 10) Sleep(500) MouseClick($MOUSE_CLICK_LEFT, $x1-1, $y1, 1, 10) Sleep(1500) WEnd $x1 = $x1 + 1 WEnd EndFunc Edited October 23, 2015 by Jos Added codebox Link to comment Share on other sites More sharing options...
Developers Jos Posted October 23, 2015 Developers Share Posted October 23, 2015 (edited) You need to add a close loop (While .. Wend) like is shown in the Helpfile example for GUICtrlSetOnEvent()JosPs: Please use a codebox when posting code. Edited October 23, 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...
jksp22 Posted October 23, 2015 Author Share Posted October 23, 2015 Hmm a little bit of issues.Trying to convert the guictrlinput with int or number. int(input) or number(input) doesn't seem to work. Seems like an easy problem but I'm stumped. How should I go about this one? Link to comment Share on other sites More sharing options...
Developers Jos Posted October 23, 2015 Developers Share Posted October 23, 2015 "Doesn't work" doesn't mean much unless you tell us what you are trying to do and what it is that doesn't work.So give us some details on what you are doing and what is not working.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...
jksp22 Posted October 23, 2015 Author Share Posted October 23, 2015 Local $x1 = 661 Local $y1 = 254 Local $x2 = 767 Local $y2 = 355 Local $x3 = 161 Local $y3 = 539 While $x1 <= $x2 While $y1 <= $y2 MouseClick($MOUSE_CLICK_LEFT, $x1, $y1, 1, 10) Sleep(3000) $y1 = $y1 + 1 MouseClick($MOUSE_CLICK_LEFT, $x3, $y3, 1, 10) Sleep(500) MouseClick($MOUSE_CLICK_LEFT, $x1-1, $y1, 1, 10) Sleep(1500) WEnd $x1 = $x1 + 1 WEndI need those variables to be numbers. GUICtrlCreateInput("", 150,5, 100, 20)gives me a string?When i run the script, I think the loop is playing around pixels 0,0. Link to comment Share on other sites More sharing options...
Developers Jos Posted October 23, 2015 Developers Share Posted October 23, 2015 (edited) The variables will be numbers.Looks like you logic is flawed as you never reset your $y2 back to its initial value after the second while-wend loop ends.ps. please make sure you have read our forum rules ... especially the section about game automation.Jos Edited October 23, 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