(Inspired by, credit, and most scripting from 'randallf's post: <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=15&t=87067">viewtopic.php?f=15&t=87067</a><!-- l -->)
I'm now trying out running it on full windowed 1680x1050
I want to create a script for Diablo III that whenever I press the hotkey (I use '=' sign) It will auto scan, and loot all Blues, Yellows, and Browns... Greens too I suppose.
My problem, is it's grossly inaccurate; a third of the time it gets an item. The other 2/3s it clicks something random or detects nothing at all!
I understand how there's so many pixels, and even one can fit the profile and the mouse will click there... and be wrong.
Is there a better way than what I have so far, or if there's a way to have AHK detect a good 10 or so of the right color in a spot (not just a pixel) before triggering a positive color match, then click?
Thanks, here's it so far:
=:: ;HotKey
ItemFound = 0 ;Loot
Loop, 3
{
YellowScanClick(0, 90, 1679, 888)
}
Return
F12:: ;Terminate App F12
Exitapp
YellowScanClick(X1, Y1, X2, Y2)
{
Global ItemFound
PixelSearch, xloc, yloc, %X1%, %Y1%, %X2%, %Y2%, 0x00FF00, 2, Fast ;Greens
If !ErrorLevel
{
ItemFound := 1
MouseClick,, %xloc%, %yloc%,, 3
Sleep, 500
}
PixelSearch, xloc, yloc, %X1%, %Y1%, %X2%, %Y2%, 0x00FFFF, 2, Fast ;Yellows
If !ErrorLevel
{
ItemFound := 1
MouseClick,, %xloc%, %yloc%,, 3
Sleep, 500
}
PixelSearch, xloc, yloc, %X1%, %Y1%, %X2%, %Y2%, 0x2F64BF, 2, Fast ;Legendaries
If !ErrorLevel
{
ItemFound := 1
MouseClick,, %xloc%, %yloc%,, 7
Sleep, 500
}
PixelSearch, xloc, yloc, %X1%, %Y1%, %X2%, %Y2%, 0xFF6969, 2, Fast ;Blues!
If !ErrorLevel
{
ItemFound := 1
MouseClick,, %xloc%, %yloc%,, 7
Sleep, 500
}
Return
}




