Code : Tout sélectionner
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\..\..\300_Icones\Dossiers\11.ico
#AutoIt3Wrapper_outfile=..\..\Desktop\Pixou.exe
#AutoIt3Wrapper_Compression=0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 0)
Opt("MouseCoordMode", 0)
HotKeySet("{F2}", "com")
HotKeySet("{ESC}", "quit")
HotKeySet("{PAUSE}", "Pause")
dim $pos[2],$Paused = 0, $pix1, $pix2, $pix0,$x,$y
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Utilitaire", 334, 230, 193, 125)
$Label1 = GUICtrlCreateLabel("Utilitaire pour faire une recherche de pixel rapide et précise sous Autoit", 0, 0, 335, 17)
$Label2 = GUICtrlCreateLabel("Créé en association avec Bender, codé par Hck.", 40, 16, 235, 17)
$Label3 = GUICtrlCreateLabel("Placez votre souris sur l'objet à detecter, puis appuyez sur F2", 24, 48, 291, 17)
$Code = GUICtrlCreateEdit("", 16, 64, 305, 150)
GUICtrlSetData(-1, "Code")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
func com()
$pos = MouseGetPos()
$x = $pos[0]
$y = $pos[1]
MouseMove(0,0,1)
$pix0 = PixelGetColor($x,$y)
$pix0 = hex($pix0,6)
$pix1 = PixelGetColor($x + 1,$y)
$pix1 = hex($pix1)
$pix2 = PixelGetColor($x,$y + 1)
$pix2 = hex($pix2)
MouseMove($pos[0],$pos[1],1)
msgbox(0,"",$pix0 & $pix1 & $pix2)
GUICtrlSetData($code,'while 1' & @CRLF & '$coord = PixelSearch ( $x , $y , $x2 , $y2 , 0x' & $pix0 & ')' & @CRLF & ' if not @error then' & @CRLF & ' if Hex(pixelgetcolor($coord[0]+1, $coord[1] )) = "' & $pix1 & '" then' & @CRLF & ' if Hex(pixelgetcolor($coord[0], $coord[1] +1)) = "' & $pix2 & '" then' & @CRLF & ' exitloop' & @CRLF & ' endif' & @CRLF & ' endif' & @CRLF & ' endif' & @CRLF & 'WEnd')
endfunc
While 1
Sleep(50)
WEnd
Func quit()
Exit
EndFunc ;==>quit
Func Pause() ; la pause
TrayTip("Clear TIP", "", 0)
$Paused = Not $Paused
If $Paused Then
TrayTip("Pause !", "Pause ", 1, 1)
While $Paused
Sleep(100)
WEnd
Else
TrayTip("plus pause !", "plus Pause", 1, 1)
EndIf
EndFunc ;==>Pause