1hit Posted January 2, 2006 Share Posted January 2, 2006 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 2, 2006 Moderators Share Posted January 2, 2006 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. 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...
Moderators big_daddy Posted January 2, 2006 Moderators Share Posted January 2, 2006 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. expandcollapse popup#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 Link to comment Share on other sites More sharing options...
1hit Posted January 2, 2006 Author Share Posted January 2, 2006 (edited) i start ur script and it doesnt do anything and sm0ke n i tried that but i dont understand it lol Edited January 2, 2006 by 1hit Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 2, 2006 Moderators Share Posted January 2, 2006 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. 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...
1hit Posted January 2, 2006 Author Share Posted January 2, 2006 (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 January 2, 2006 by 1hit Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 2, 2006 Moderators Share Posted January 2, 2006 (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 January 2, 2006 by big_daddy Link to comment Share on other sites More sharing options...
1hit Posted January 2, 2006 Author Share Posted January 2, 2006 (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 January 2, 2006 by 1hit Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 2, 2006 Moderators Share Posted January 2, 2006 I tried to create an example for you. 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...
Moderators big_daddy Posted January 2, 2006 Moderators Share Posted January 2, 2006 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: expandcollapse popup#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 Link to comment Share on other sites More sharing options...
1hit Posted January 2, 2006 Author Share Posted January 2, 2006 (edited) o ya thx it works ok does anyone know how to make it look for 2 different colors or mabey 3 Edited January 2, 2006 by 1hit 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