Soo I needed something that autolooted for me in d3 and this isn't doing it, I don't know why - Could you help me find why? 
Code:
Opt('MouseCoordMode', 0)
Opt('PixelCoordMode', 0)
WinActivate("Diablo III","")
WinWaitActive("Diablo III","")
HotKeySet('{END}', 'Quit')
HotKeySet('{HOME}', 'Pause')
Global $Paused
Func Quit()
Exit
EndFunc
Func Pause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip('Paused...', 0, 0)
WEnd
ToolTip("")
EndFunc ;==>Pause
while 1 = 1
$click = PixelSearch(642, 297,1302, 814,0xA16746,1,1) ;legendary items
if not @error Then
mouseclick("left",$click[0],$click[1],1,0)
EndIf
$click = PixelSearch(642, 297,1302, 814,0xAAAA00,1,1) ;rare items
if not @error Then
mouseclick("left",$click[0],$click[1],1,0)
EndIf
wend
~~Solved Thanks Guys