Jump to content

Recommended Posts

Posted
How do i use pixel search???, the autoit help file is not explaining it well, this is the code autoit help was saying
PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] )
and now I'm really confused what that is, left top right bottom? i don't understand, but i understand the colour,its like 0xFF0000(which is pure red) so can someone please help me?
Posted

How do i use pixel search???, the autoit help file is not explaining it well, this is the code autoit help was saying

PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] )
and now I'm really confused what that is, left top right bottom? i don't understand, but i understand the colour,its like 0xFF0000(which is pure red) so can someone please help me?

I know that left is a coordinate of a rectangle and same for the others, but i just don't get it.
Posted

Okay so is this like this?

$frozen = PixelSearch(0, 326, 0, 317, 0xFF0000)
I am so confused right now

you said that 0, 0 is the X coordinates and 50, 50 is the Y Coordinates.

I just dont get it.

Please explain it better so i can understand, I am really confused right now.

  • Moderators
Posted

Left = the x top left of the rectangle to search starting position

Top = the y top left of the rectangle to search starting position

Right = the x bottom right of the rectangle to search starting position

Bottom = the y bottom right of the rectangle to search starting position

Example image:

http://www.autoitscript.com/forum/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=11670

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.

Posted

If you run this example, it should help you understand the screen coordinate system and the window or client coordinate system being used.

Move the cursor, and try to understand why the "x" and "y" values, (coordinates), change the way they do change.

Press Esc to exit.

#include <WinAPI.au3>

Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client
HotKeySet("{ESC}", "Terminate")

Local $exit = 1

While $exit
    Sleep(10)
    TtColXY()
WEnd

; TtColXY() Tooltip shows colour, and cursor position relative to screen and window.
Func TtColXY()
    $aPos = MouseGetPos()
    Local $tPosS = _WinAPI_GetMousePos() ; similar to MouseGetPos() ;Screen mouse position
    $hHwnd = _WinAPI_WindowFromPoint($tPosS)
    Local $tPosC = _WinAPI_GetMousePos(True, $hHwnd)
    $sColor = "0x" & Hex(PixelGetColor(DllStructGetData($tPosS, "X"), DllStructGetData($tPosS, "Y")), 6)
    $iPosX = ($aPos[0] - 100) * ($aPos[0] > @DesktopWidth * 0.90) + ($aPos[0] <= @DesktopWidth * 0.90) * ($aPos[0] + 3)
    $iPosY = ($aPos[1] - 30) * ($aPos[1] > @DesktopHeight * 0.96) + ($aPos[1] <= @DesktopHeight * 0.96) * ($aPos[1] + 3)
    ToolTip("Color is: " & $sColor & @CRLF & "Screen: X: " & DllStructGetData($tPosS, "X") & " Y: " & DllStructGetData($tPosS, "Y") & @CRLF _
         & "Client: X: " & DllStructGetData($tPosC, "X") & " Y: " & DllStructGetData($tPosC, "Y"), $iPosX, $iPosY)
    Return
EndFunc ;==>TtColXY

Func Terminate()
    $exit = 0
EndFunc ;==>Terminate
Posted (edited)

So Those coordinates are the coordinates of a rectangle.

But please tell me how to find the coordinates of a file i want to find

can you please make the code,I really want to make game bots.

Edited by FrozenScriptz
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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