BuddyBoy Posted June 20, 2006 Share Posted June 20, 2006 (edited) If BitAND(GUICtrlRead($Checkbox_11), $GUI_CHECKED) = $GUI_CHECKED Then $correct_color = PixelGetColor( 972, 348 ) while 1 If $correct_color <> PixelGetColor( 972, 348 ) Then MouseClick ( "right", 801, 48 ) $correct_color = PixelGetColor( 972, 348 ) MouseClick("left", 220, 654, 300, 500) While 1 $pixelsearch = Pixelsearch(0, 0, @Desktopwidth, @DesktopHeight, "0xF7554A", 0, 10 ) If @error <> 1 then MouseClick("left") EndIf WEnd EndIf Sleep(100) wend EndIf Ive tried everything and that seems the cloest that MIGHT work but like always it doesnt work. If you can read that i want it to left click 300 times and if the pixwl color (pinkish) appears it clicks on the pick color... any help anyone? EDIT: that desktop etc part with the pixel search etc is of course suppose to go out further but there isnt enuf room on the post etc.... Edited June 20, 2006 by BuddyBoy Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 20, 2006 Author Share Posted June 20, 2006 Bring Up My Post can anyone help me here, grr lol Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 20, 2006 Moderators Share Posted June 20, 2006 If you are trying to do this outside of your GUI: When you click on the CheckBox, you immediately lose focus on what you are wanting to use PixelGetColor on. Look at WinActivate() and try a sleep. We should also assume that your MouseCoordMode and PixelCoordMode are the same correct? Remember that you must have focus on a window for the PixelFunctions to work, they are not window specific. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 20, 2006 Author Share Posted June 20, 2006 Nono it worked before i tried getting the pixelsearch thing to work. Once again its on my game and if my last of those 40 boxes gets filled it right clicks on the very first box, once the right click is done it walks until it reaches the Conductress (a person who teleports you places) the girl condusctress wheres some pinkish colors so it continues to walk until it finds that pink color. I hope i explained better...? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 20, 2006 Moderators Share Posted June 20, 2006 (edited) Nono it worked before i tried getting the pixelsearch thing to work. Once again its on my game and if my last of those 40 boxes gets filled it right clicks on the very first box, once the right click is done it walks until it reaches the Conductress (a person who teleports you places) the girl condusctress wheres some pinkish colors so it continues to walk until it finds that pink color. I hope i explained better...?Well, I'm not wrong with what I said... It might not have fixed the immediate issue, but it will fix "an" issue... (Of course you wouldn't have known that because you didn't try it!) Edit: Do you have the right hex for that color? If @error <> 1 then Could be If IsArray($pixelsearch) Then Edit2: Curiousity question: MouseClick('left')Is only going to click the last spot the Mouse was at, was there something specific you wanted to click? Edited June 20, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 20, 2006 Author Share Posted June 20, 2006 WinActives dont work on my game, no window functions can work, such as Wingettext etc. There is a part i used winwaitwindow or w/e it is becuz if you disconnect and true window from your desktop is actually there but none of the win functions can read any of my in-game issues, i hope i know what your talking about now Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 20, 2006 Moderators Share Posted June 20, 2006 WinActives dont work on my game, no window functions can work, such as Wingettext etc. There is a part i used winwaitwindow or w/e it is becuz if you disconnect and true window from your desktop is actually there but none of the win functions can read any of my in-game issues, i hope i know what your talking about now I don't care if window functions don't work, I'm saying "YOU HAVE TO HAVE FOCUS" on the window you want to use the Pixel Functions for Pixel Functions to work properly. So use a sleep if you are doing it manually, I don't care... Just make sure that it's active before PixelGetColor() gets it color. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 20, 2006 Author Share Posted June 20, 2006 Well, I'm not wrong with what I said... It might not have fixed the immediate issue, but it will fix "an" issue... (Of course you wouldn't have known that because you didn't try it!) Edit: Do you have the right hex for that color? If @error <> 1 then Could be If IsArray($pixelsearch) Then Edit2: Curiousity question: MouseClick('left')Is only going to click the last spot the Mouse was at, was there something specific you wanted to click? 1.yes the color is that pink color i gave...0xF7554A 2.wouldnt i have to add the pixelsearch desktop blah blah blah for that array part? 3.for the mouse click i want it to click on the pink part (0xF7554A) if it is found. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 20, 2006 Moderators Share Posted June 20, 2006 (edited) 1.yes the color is that pink color i gave...0xF7554A 2.wouldnt i have to add the pixelsearch desktop blah blah blah for that array part? 3.for the mouse click i want it to click on the pink part (0xF7554A) if it is found.It's going to pixelsearch() any area you have in there, and return as soon as a result is found, whether it's at 0,0 or 800, 600. It returns an Array, and if you want to click where it was found, then you should have read the PixelSearch function a bit better, because you would see it returns x and y coords of where it was found. $Coord = PixelSearch($xstart, $ystart, $xend, $yend, 0x000000) If IsArray($Coord) Then MouseClick('primary', $Coord[0], $Coord[1], 300, 500) Edited June 20, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BuddyBoy Posted June 20, 2006 Author Share Posted June 20, 2006 $Coord[1], 300, 500) whats that coord for tho? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 20, 2006 Moderators Share Posted June 20, 2006 $Coord[1], 300, 500) whats that coord for tho?Read the help file under PixelSearch() and MouseClick() and you won't have to ask such questions. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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