Jump to content

can't get pixel color from window


glix
 Share

Recommended Posts

im making a bot that simply clicks on a designated color, but as soon as the mouse moves into the game window, the game mouse comes up and blocks whatever im going to click on with the color of the mouse, any ideas?

Link to comment
Share on other sites

You mean that the mouse from windows and the game mouse are not on the same position right? Happened to me when I was trying to modify a WoW bot...

Try this... But change World of Warcraft to whatever game you are using...

WinSetState("World of Warcraft", "", @SW_MAXIMIZE)

I am a autoit noob, so I dont really know, just my guess...

Link to comment
Share on other sites

im making a bot that simply clicks on a designated color, but as soon as the mouse moves into the game window, the game mouse comes up and blocks whatever im going to click on with the color of the mouse, any ideas?

If you already have the coordinates, you don't need to see the color anymore to do mouseclick(). MouseMove() out of the area you are interested in to search for the color, then MouseClick() on the coordinates found.

Hope that helps...

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Func Game_Bot()

$coord = PixelSearch (0, 36, 619, 335, 0xDEFFFF)

If Not @error Then

MouseClick("Right", $coord[0], $coord[1])

Sleep (2000)

Endif

EndFunc

if the mouse is in the way it returns the value of the cursor rather than the pixel i really want, and it must auto move.

Edited by glix
Link to comment
Share on other sites

Func Game_Bot()

$coord = PixelSearch (0, 36, 619, 335, 0xDEFFFF)

If Not @error Then

MouseClick("Right", $coord[0], $coord[1])

Sleep (2000)

Endif

EndFunc

if the mouse is in the way it returns the value of the cursor rather than the pixel i really want, and it must auto move.

How about:

Func Game_Bot()
    ; Save current mouse pos and move out of the way
    Local $avMousePos = MouseGetPos()
    MouseMove($avMousePos[0], 340, 0)

    $coord = PixelSearch (0, 36, 619, 335,  0xDEFFFF)   
    If Not @error Then
        MouseClick("Right", $coord[0],  $coord[1])
        Sleep (2000)
    Endif

    ; Restore mouse pos
    MouseMove($avMousePos[0], $avMousePos[1], 0)
EndFunc

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...