Sign in to follow this  
Followers 0
BuddyBoy

Serious of events question

11 posts in this topic

#1 ·  Posted (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 by BuddyBoy

Share this post


Link to post
Share on other sites



Bring

Up

My

Post

:D can anyone help me here, grr lol

Share this post


Link to post
Share on other sites

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.


[center]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.[/center]

Share this post


Link to post
Share on other sites

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...?

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

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 :D

Share this post


Link to post
Share on other sites

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 :D

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

$Coord[1], 300, 500)

whats that coord for tho?

Share this post


Link to post
Share on other sites

$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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0