/* This script is to easy change the active weapon for your right hand in Diablo III. A lot of skills do not reset the active weapon
to the main hand.
To make the script work properly, you need to edit line 27 (See comment at this line)
The script work for a 1920x1080 resolution but it's easy to change for another one with the tool provided with Autohotkey called
Autoit3 window spy. (Edit line 36, 38, 43)
also my shortcut to open my inventory is I, change it if your shortcut is different at line 33.
By default commands are Mouse4 to look at your active weapon(line 29) and F12 to close the script (line 58 ).
*/
#IfWinActive, Diablo III
#MaxThreadsPerHotkey 1
#SingleInstance force
SetMouseDelay, 0 ;make move the mouse and clicks very fast(it makes the script more detectable. You can delete this line if you don't want take the risk).
;Random function
Random(min,max) {
Random, out, %min%, %max%
return out
}
;Edit this to your picture location.(example imageLoc = C:\Picture\AW.png JPG BMP PNG supported) /!\ The Picture is the Atk speed of your right hand weapon.
imageLoc = C:\AW.png
;search for active weapon
Xbutton1:: ;Edit this to change the hotkey (Xbutton1 = mouse4, Xbutton2 = mouse5). Example: hotKey = F1
BlockInput, On
MouseGetPos, xpos, ypos
send, {SPACE}
send, {I}
MouseClick, left, % Random(1463,1583), % Random(454,477)
sleep, % random(50,200)
ImageSearch, , , 1258, 217, 1331, 252, %imageLoc%
if ErrorLevel = 1
{
send, {SPACE}
send, {SHIFTDOWN}
MouseClick, left, % Random(1040,1256), % Random(910,974)
send, {SHIFTUP}
}
else if ErrorLevel = 2
{
MsgBox Problem! Something wrong with the image location or the picture name.
send, {SPACE}
}
else if ErrorLevel = 0
{
send, {SPACE}
}
MouseMove, %xpos%, %ypos%
BlockInput, Off
return
;Close script
F12::
ExitApp