oiTommy Posted February 3, 2013 Share Posted February 3, 2013 (edited) Hello autoit community, started using this program, and it's amazing! So, I want to ask some help from you My screen resolution is 1440x900, and I want to width= 717 heigh= 427 If in this mouse possition color is for example ff0000, to push Y letter, is that possible to make it? p.s. sorry for bad english :/ I hope you understand, what i have written there:) Edited February 3, 2013 by oiTommy Link to comment Share on other sites More sharing options...
JohnOne Posted February 3, 2013 Share Posted February 3, 2013 (edited) Yes, it's very simple. While WEnd If ElseIf Else EndIf PixelGetColor() Send() Are all you need to read about, click on them to read. Edited February 3, 2013 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
oiTommy Posted February 3, 2013 Author Share Posted February 3, 2013 (edited) While True $color = PixelGetColor(714, 452) If $color = 16777215 Then Send("{y 10}") EndIf WEnd i tryed to do something like that, but doesn't work properly o.o *if in 714, 452 color is white, push g 10times Edited February 3, 2013 by oiTommy Link to comment Share on other sites More sharing options...
JohnOne Posted February 3, 2013 Share Posted February 3, 2013 doesn't work properly o.oElaborate. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
oiTommy Posted February 3, 2013 Author Share Posted February 3, 2013 ok, then next question about this line- $color = PixelGetColor(717, 427) how to do pixelgetcolor between 700, 400 to 720, 430 that every pixel inside would be checkt? Link to comment Share on other sites More sharing options...
Centrally Posted February 3, 2013 Share Posted February 3, 2013 ok, then next question about this line- $color = PixelGetColor(717, 427) how to do pixelgetcolor between 700, 400 to 720, 430 that every pixel inside would be checkt? $color = PixelSearch(700, 400, 720, 430, colorYouWant) Link to comment Share on other sites More sharing options...
oiTommy Posted February 3, 2013 Author Share Posted February 3, 2013 (edited) so While True $color = PixelSearch(700, 400, 720, 430, 16777215, 16711680, 16646144) If $color = 16777215 Or $color = 16711680 Or $color = 16646144 Then Send("{g 10}") EndIf WEnd If i do this one, it will search between 700, 400 to 720, 430 for those colors, and if finds, pushes G letter? messt up... Edited February 3, 2013 by oiTommy Link to comment Share on other sites More sharing options...
Centrally Posted February 3, 2013 Share Posted February 3, 2013 (edited) so While True $color = PixelSearch(700, 400, 720, 430, 16777215, 16711680, 16646144) If $color = 16777215 Or $color = 16711680 Or $color = 16646144 Then Send("{g 10}") EndIf WEnd If i do this one, it will search between 700, 400 to 720, 430 for those colors, and if finds, pushes G letter? messt up... I'm afraid that you wont be able to search for 3 different colors in single pixelsearch function (or am I wrong?) I guess you would want something like this instead: Func searchForPixel() local $i = 0 While $i <= 10 Local $color = PixelSearch(700, 400, 720, 430, 16777215) If Not @error Then Send("g") Else $color = PixelSearch(700, 400, 720, 430, 16711680) If Not @error Then Send("g") Else $color = PixelSearch(700, 400, 720, 430, 16646144) If Not @error Then Send("g") EndIf EndIf EndIf $i = $i + 1 Sleep(1000) WEnd EndFunc Note that this my be hacky solution since I'm quite new to AutoIt. Edited February 3, 2013 by Centrally Link to comment Share on other sites More sharing options...
oiTommy Posted February 3, 2013 Author Share Posted February 3, 2013 You see, I need that from 700, 400 to 720, 420 all pixels between theese would be checked, and if there would be any of these 3 colors- 16777215, 16711680, 16646144 , autoit would press g letter Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2013 Developers Share Posted February 3, 2013 That is a statement. Is there still a question about all the stuff posted for you to play with? 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...
JohnOne Posted February 3, 2013 Share Posted February 3, 2013 You will need to loop through each pixel and test it for the three colours. Here is a micro example. For $y = ... To ... For $x = ... To ... If _IsColour($x,$y) Then ... EndIf Next Next Func _IsColour($x,$y) If PixelGetColor($x,$y) = 16777215 Then Return 1 If PixelGetColor($x,$y) = 16711680 Then Return 1 If PixelGetColor($x,$y) = 16646144 Then Return 1 Return 0 EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted February 3, 2013 Share Posted February 3, 2013 And that function above makes 2 unnecessary calls, which I'm sure you can figure out. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
oiTommy Posted February 3, 2013 Author Share Posted February 3, 2013 Thanks guys, tryed easier way for making it While True $color = PixelSearch(700, 430, 740, 470, 16777215) If Not @error Then Send("g") endif $color = PixelSearch(700, 400, 720, 430, 16711680) If Not @error Then Send("g") endif $color = PixelSearch(700, 400, 720, 430, 16646144) If Not @error Then Send("g") EndIf WEnd Thanks enough for me thank you everyone 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