Example of whole Vengeance script with works with actual THUD:
#include <File.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <WinAPI.au3>
#region Nastavení klávesových zkratek
HotKeySet("{F1}", "start")
HotKeySet("{F2}", "stop")
HotKeySet("^{F2}", "quit")
#EndRegion
#region proměnné
Global $runner
Global $on=0
Global $poz1=658
Global $poz2=1009
Global $barva1="872409"
Global $barva2="862408"
Global $cekej=60
Global $cekejstisk=30
Global $cekejVengeance=30
Global $mousePos
Global $hDC
Global $handle
#EndRegion
#Region start
Func start()
#Send(4)
$on = 1
EndFunc
#EndRegion
#Region stop
Func stop()
$on = 0
EndFunc
#EndRegion
#Region ukončení programu
Func quit()
_WinAPI_ReleaseDC($handle, $hDC)
Exit
EndFunc
#EndRegion
#Region MemoryReadPixel
Func MemoryReadPixel($x, $y)
$iColor = DllCall("gdi32.dll", "int", "GetPixel", "int", $hDC, "int", $x, "int", $y)
$sColor = Hex($iColor[0], 6)
#MsgBox(0, "", "MemoryReadPixel color returned : " & $sColor)
Return StringRight($sColor, 2) & StringMid($sColor, 3, 2) & StringLeft($sColor, 2)
EndFunc
#EndRegion
#Region po spuštění, aby se to hned neukončilo
$handle = WinGetHandle("Diablo III")
if $handle = "" Then
MsgBox(0, "", "Please run D3")
Exit
EndIf
$hDC = _WinAPI_GetWindowDC($handle)
While 1
While $on=1
$pos = MemoryReadPixel($poz1,$poz2)
sleep($cekej)
if $pos = $barva1 or $pos = $barva2 and $on = 1 Then
Send("{4 down}")
While $pos = $barva1 or $pos = $barva2 and $on = 1
sleep($cekejVengeance)
$pos = MemoryReadPixel($poz1,$poz2)
WEnd
Send("{4 up}")
EndIf
WEnd
sleep($cekejstisk)
WEnd
#EndRegion