Sign in to follow this  
Followers 0
1hit

help with pixelsearch plz

11 posts in this topic

ok well im trying to search a small rectangle in the game window but how do i find out what the coords are for the rectangle i wanna search

plz help if u can

Share this post


Link to post
Share on other sites



Program Files >> AutoIt3 >> AutoInfo.exe

Make sure you check the Options / Coord Mode , make sure you have it on Window or Client for less future mistakes.


[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

ok well im trying to search a small rectangle in the game window but how do i find out what the coords are for the rectangle i wanna search

plz help if u can

With this script you can click and drag a box around where you are wanting to search and it gives you the coords. It also will record them into a DragBoxCoord.ini file.

#include <Misc.au3>
HotKeySet("{ESC}", "Stop")
AutoItSetOption("MouseCoordMode", 1)

;this loop repeats until a left mouse click occurs
Do
    $pos1 = MouseGetPos()
    ToolTip("Mouse Pointer X: " & $pos1[0] & "  " & "Y= " & $pos1[1] & @LF & @LF & "Click on hold on first position.")
    Sleep(10)
Until (_IsPressed('01') = 1)
    $pos1 = MouseGetPos()
    $x = $pos1[0]
    $y = $pos1[1]
    IniWrite(".\DragBoxCoord.ini","Main","Coord1 X",$x)
    IniWrite(".\DragBoxCoord.ini","Main","Coord1 Y",$y)

;this loop repeats unitl the left mouse click is released
Do
    $pos2 = MouseGetPos()
    ToolTip("Mouse Pointer: X: " & $pos2[0] & "  " & "Y: " & $pos2[1] & @LF & @LF & "Drag mouse to next point and release.")
    Sleep(10)
Until (_IsPressed('01') = 0)
$pos2 = MouseGetPos()
    $x = $pos2[0]
    $y = $pos2[1]
    IniWrite(".\DragBoxCoord.ini","Main","Coord2 X",$x)
    IniWrite(".\DragBoxCoord.ini","Main","Coord2 Y",$y)
    
$answer = MsgBox(4100, "Your Coordinates", "First coordinate  X: " & $pos1[0] & "  " & "Y: " & $pos1[1] & @LF & "Second coordinate  X: " & $pos2[0] & "  " & "Y: " & $pos2[1] & @LF & @LF & "Would you like to view the INI file?")
    If $answer = 6 Then 
        Run("notepad.exe .\DragBoxCoord.ini")
        Exit
    Else    
        Exit
    EndIf
    
Func Stop()
    Exit
EndFunc

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

i start ur script and it doesnt do anything

and sm0ke n i tried that but i dont understand it lol

Edited by 1hit

Share this post


Link to post
Share on other sites

You don't understand what?.. The AutoInfo tool or the way to find it?

If it's the way to find it, if you did a regular install rather than a zip install it should be under:

Start -

All Programs -

AutoIt v3 -

Auto Window Info (this is it) -

To use it, you'll need to know this 'on/off' hotkey.

Alt+Ctrl+F will Pause and UnPause it, so you can get coordinates of what you want along with other window information.


[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

#6 ·  Posted (edited)

i know where it is and stuff but i dont know what numbers to use wen i select the window and how to figure out the coords of just a small rectangle of the client window

ok could i just make a rectangle with notepad over the area that i want to search in the game window and just select the notepad window and then take the Window detail Size coords would that work?

Edited by 1hit

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

i start ur script and it doesnt do anything

What do you mean it doesn't do anything? You run the script, click and hold the left mouse button at the top left position of the area you want to search, drag a box down to the bottom right position of the area and let go of the left mouse button. It tells you the two sets of coords, and asks if you want to open the .ini file it created so you can copy and paste the coords to your script. Can it get much easier than that?

This is how you would use the values from the .ini file from the script:

PixelSearch ( Coord1x, Coord1y, Coord2x, Coord2y, color, shade-variation, step)
Edited by big_daddy

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

i start the script and then it closes in like a half a second lol it doesnt stay running and it doesnt say anything or do anything

Edited by 1hit

Share this post


Link to post
Share on other sites

I tried to create an example for you.


[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

i start the script and then it closes in like a half a second lol it doesnt stay running and it doesnt say anything or do anything

You probably don't have the latest beta version so the _IsPressed fuction needs to accually be in the script.

Try this:

#include <Misc.au3>
HotKeySet("{ESC}", "Stop")
AutoItSetOption("MouseCoordMode", 1)

Func _IsPressed($s_hexKey, $v_dll = 'user32.dll')
; $hexKey must be the value of one of the keys.
; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
    Local $a_R = DllCall($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey)
    If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
    Return 0
EndFunc  ;==>_Is_Key_Pressed

;this loop repeats until a left mouse click occurs
Do
    $pos1 = MouseGetPos()
    ToolTip("Mouse Pointer X: " & $pos1[0] & "  " & "Y= " & $pos1[1] & @LF & @LF & "Click on hold on first position.")
    Sleep(10)
Until (_IsPressed('01') = 1)
    $pos1 = MouseGetPos()
    $x = $pos1[0]
    $y = $pos1[1]
    IniWrite(".\DragBoxCoord.ini","Main","Coord1 X",$x)
    IniWrite(".\DragBoxCoord.ini","Main","Coord1 Y",$y)

;this loop repeats unitl the left mouse click is released
Do
    $pos2 = MouseGetPos()
    ToolTip("Mouse Pointer: X: " & $pos2[0] & "  " & "Y: " & $pos2[1] & @LF & @LF & "Drag mouse to next point and release.")
    Sleep(10)
Until (_IsPressed('01') = 0)
$pos2 = MouseGetPos()
    $x = $pos2[0]
    $y = $pos2[1]
    IniWrite(".\DragBoxCoord.ini","Main","Coord2 X",$x)
    IniWrite(".\DragBoxCoord.ini","Main","Coord2 Y",$y)
    
$answer = MsgBox(4100, "Your Coordinates", "First coordinate  X: " & $pos1[0] & "  " & "Y: " & $pos1[1] & @LF & "Second coordinate  X: " & $pos2[0] & "  " & "Y: " & $pos2[1] & @LF & @LF & "Would you like to view the INI file?")
    If $answer = 6 Then
        Run("notepad.exe .\DragBoxCoord.ini")
        Exit
    Else    
        Exit
    EndIf
    
Func Stop()
    Exit
EndFunc

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

o ya thx it works

ok does anyone know how to make it look for 2 different colors or mabey 3

Edited by 1hit

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