Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 15:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Check the nearest coord with MyImagesearch

Discussion on Check the nearest coord with MyImagesearch within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
fuso98's Avatar
 
elite*gold: 428
Join Date: Dec 2011
Posts: 2,722
Received Thanks: 2,035
Check the nearest coord with MyImagesearch

With MyImageSearch i can check how many images are on the screen.
It return a 2D array. How can i check the nearest coord to the center of my screen? I know that i need a For..to..Next Loop but can some one give me an example?
fuso98 is offline  
Old 10/24/2013, 20:49   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Here
Code:
Local $aExampleCoordinates[5][2] = [[20, 120], [50, 500], [900, 450], [680, 450], [700, 400]], $aDifference[UBound($aExampleCoordinates, 1)], $iLowestDiff = @DesktopWidth + @DesktopHeight, $iEntry

For $i = 0 To UBound($aExampleCoordinates, 1) - 1
	$aDifference[$i] = Abs(@DesktopWidth / 2 - $aExampleCoordinates[$i][0]) + Abs(@DesktopHeight / 2 - $aExampleCoordinates[$i][1])
	If $aDifference[$i] < $iLowestDiff Then
		$iLowestDiff = $aDifference[$i]
		$iEntry = $i
	EndIf
Next

MsgBox(64, "Lowest Difference", "Array entry " & $iEntry & " contains the coordinates with the lowest difference of the screen center.")
MouseMove($aExampleCoordinates[$iEntry][0], $aExampleCoordinates[$iEntry][1], 100)
Entry 2 means the 3rd of the array because the array starts at index 0.

Anyway, it could have been done a lot better but I guess that's enough.
alpines is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Move to coord using If then else
02/22/2010 - AutoIt - 10 Replies
Hi, i would like to know if this is possible: Eg:I want to move to 200,200 but there is a person in the way so i donot go there but when he moves i want to go there EG: If i am at 200,200 then Continue script Else try and go back to 200,200 is there a way to do the above will be appreciated,
[Request]How to check get your char coord in game
02/20/2009 - CO2 Programming - 2 Replies
Just want to know how to use AHK to get coordinate of your Character coordinate in game? checking for every 2 sec... Thanks in advance...
Coord Finder++
09/18/2008 - CO2 Exploits, Hacks & Tools - 6 Replies
just a simple tool features: 1. finds x and y coordinates of the position of the mouse. 2. finds the color of the position of the x and y in binary format 3. color in hex format PRESS F5 TO GET THE COORDS AND COLORS
New Exploit! (Go to nearest!)
06/03/2007 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 30 Replies
There is a new exploit,after you die,you press (Go to nearest Village) and you simply ressurect! (bug with packet RequestRestartPoint ) Method #1: Download ws2_32.dll and unrar it at l2/system . Download Here
Nearest Waypoint is too far away
05/24/2007 - WoW Bots - 7 Replies
nabend leute! ich hab mir vorhin auch ma n paar public proflies geholt aber ich habe damit noch einige probleme... nachdem ich das profil geladen hab, steht im glider log ungefähr folgendes: nearest waypoint is too far away. please walk xxx yards in current direction. ich weiss jedoch nicht, in welche richtung ich mich dann bewegen soll. bitte helft mir weiter =)



All times are GMT +1. The time now is 15:14.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.