Help me with some pixelsearch and coordonates functins
so i have this image.
PHP Code:
$x=PixelSearch(8,164,660,480,0x000000) //to find that black line $y=PixelSearch(8,164,660,480,0x01A0E6) // to find the light-blue ball ( from the top)
But, i want to put the mouse in the back of the Dark-Blue ball , in line with the 2 balls. Something like at a game of ''8-ball pool", so it will send the Dark-Blue ball in the Light Blue Ball.
and then, there is another problem. how to get the center of the light-blue one?
If the ball is perfect round, i found how to find its center:
#include <WindowsConstants.au3>
#include <WinAPI.au3>
HotKeySet("{a}","Main")
Func DrawAim($start_x,$start_y,$end_x,$end_y,$color,$width,$handle)
Local $hDC, $hPen, $obj_orig
$hDC = _WinAPI_GetWindowDC(0)
$hPen = _WinAPI_CreatePen($PS_SOLID, $width, $color)
$obj_orig = _WinAPI_SelectObject($hDC, $hPen)
_WinAPI_DrawLine($hDC, $start_x, $start_y, $end_x, $end_y)
_WinAPI_RedrawWindow($handle, 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN)
_WinAPI_DeleteObject($hPen)
_WinAPI_ReleaseDC(0, $hDC)
EndFunc
Func Main()
$coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x3F48CC) ; we get xy coordinates of the dark blue ball
if not @error then $pos=SearchBlackCenter($coord[0],$coord[1])
SearchLightCenter($pos);Search light blue ball center
EndFunc
Func SearchBlackCenter($objectx,$objecty)
Local $coord = PixelSearch($objectx,$objecty,$objectx*2,$objecty*2,0x000000) ; we get xy coordinates of blackcenter of dark blue ball
if not @error then
MouseMove(($objectx+$coord[0])/2,($objecty+$coord[1])/2) ;we set the mouse in the center
Local $pos[2] = [(($objectx+$coord[0])/2),(($objecty+$coord[1])/2)]
Return $pos
EndIf
EndFunc
Func SearchLightCenter($xy)
Local $coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x00A2E8) ; Light blue ball coordinates
if not @error Then
DrawAim($xy[0],$xy[1],$coord[0],$coord[1],5,5,0);MouseMove($coord[0],$coord[1])
EndIf
EndFunc
while 1
WEnd
PixelSearch 05/19/2012 - AutoIt - 5 Replies Hallo, Ich brauche hilfe bei einen PixelSearch AutoIt Bot.
nun meine Frage:
also ich habe bisher diesen code gebaut:
HotKeySet( "{F6}","_Exit")
While 1
$Variable = PixelSearch(187,116,1157,622,0x2A2014)
If IsArray($Variable) = True Then
MouseMove($Variable , $Variable , 1)
MouseClick($Variable)
Pixelsearch Bot 07/08/2011 - AutoIt - 6 Replies Hallo,
ich wollte fragen ob es möglich ist z.B. für Crossfire einen Pixelsearch Bot zu machen
und
Wie macht man mit Autoit so einen Youtube Account Creator
und
wie umgeht man die Captchaabfrage?
Pixelsearch 06/26/2010 - General Coding - 5 Replies Hallo, ich habe ein Problem, ich habe versucht ein kleines Programm mit Pixelsearch zu erstellen, da ich daran kläglich gescheitert bin wollt ich mal fragen ob das jemand von euch für mich übernehmen kann? Ich möchte das das Program gedrückt hält und dann einen Pixel in der Farbe sucht (sind mehrere vorhanden und es ist egal welchen er anklickt), ihn anklickt und dann ein paar sekunden wartet dann Leertaste für kurze Zeit gedrückt hält. Das soll sich dann nach einiger Zeit wiederholen. Die...