My try at the macro. The coords are for 1366x768. It has build-in ratio converter but that doesnt work as it should. Maybe if someone wants to fix it, go for it.
If you have another ressolution and want to try it anyway just start the macro, it automaticly uses whatever res the game uses.
One more thing, you have to run in fullscreen windowed otherwise the pixel reading is off sometimes.
If you want to change the coords here is a small one to get the coords of your mouse
Code:
Opt("PixelCoordMode", 0)
$delay = 3000
WinActivate("Diablo III")
WinWaitActive("Diablo III")
sleep($delay)
$mPos =MouseGetPos()
MsgBox(0,"Mouse is at...","x:" & $mPos[0]&" y: "&$mPos[1])
Code:
#include <Color.au3>
Opt("PixelCoordMode", 0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Tested with quest act3.7.1
;; Chose the quest, start the macro.
;;
;; !!!Use Fullscreen-Window!!!
;;
;; Hotkeys:
;; M : exit program
;; B : pause
;
; do you want to use a skill?
$buff=1 ;1= yes 0= no
$skill="q" ; key , must be in " "
;sleep times in milliseconds: 1000=1sec
$sleepShort= 300 ; used for random start + inbetween pickup and wait for the leave menu to open.
$sleepMed= 1000 ;only used on first run to be sure the start/resume button is visible.
$sleepMove1= 2000 ; time it takes to get to first position
$sleepMove2= 1500 ; time from first position to chest
$sleepVar= 50 ; time gets added/substracted from the ones above to create random times
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
HotKeySet("m", "_quit")
HotKeySet("b", "_pause")
$paused = False
$firstTime = True
$gameWindowSize=WinGetClientSize("Diablo III")
$gameX=$gameWindowSize[0]
$gameY=$gameWindowSize[1]
$defaultResolutionX = 1366 ;res in which the coordinates/waypoints are taken
$defaultResolutionY = 768 ;
$ratioX= $gameX / $defaultResolutionX
$ratioY= $gameY / $defaultResolutionY
;;Coordinates
;login button
$loginMinX= 63 ;left 63
$loginMaxX= 265 ;right 265
$loginMinY= 285 ;top 285
$loginMaxY= 305 ;bottom 305
;color of login button at random position on the start/resume button. dont change
$colLoginX=Random($loginMinX,$loginMaxX)
$colLoginY=Random($loginMinY,$loginMaxY)
$colLogin=""
;hp field, whole area must be red
$hpMinX= 380 ;left 380
$hpMaxX= 400 ;right 400
$hpMinY= 694 ;top 694
$hpMaxY= 726 ;bottom 694
;leave game button
$leaveMinX= 589 ;left 589
$leaveMaxX= 772 ;right 772
$leaveMinY= 405 ;top 405
$leaveMaxY= 419 ;bottom 419
;move
;1
$move1X=121 ;121
$move1Y=129 ;129
;2-chest
$move2X=91 ; 96 91 108 91
$move2Y=322 ;320 316 335 322
;3-pickup
$move3X=600 ;600
$move3Y=470 ;470
;random pixel var
$moveRndPixel= 20 ;number of pixels added in random movement
While 1
if($firstTime) Then
WinActivate("Diablo III")
WinWaitActive("Diablo III") ; wait for the d3 window to load
;sleepMED sleep to be sure the button is visible
Sleep(Random($sleepMed-$sleepVar, $sleepMed+$sleepVar))
; get a reference color if it is the first loop
$colLogin= PixelGetColor( $colLoginX*$ratioX, $colLoginY*$ratioY)
$firstTime=False
EndIf
; wait till the start/resume button is visible
While (PixelGetColor($colLoginX*$ratioX, $colLoginY*$ratioY) <> $colLogin)
WEnd; -> start/resume button is visible
;click the start game button at a random position
MouseClick("Left", Random($loginMinX,$loginMaxX)*$ratioX, Random($loginMinY,$loginMaxY)*$ratioY, 1)
;wait until the hp ball is visible
While Not _isRed(Random($hpMinX,$hpMaxX)*$ratioX, Random($hpMinY, $hpMaxY)*$ratioY)
WEnd ; -> hp is visible, char is in game
;use buff if activated $buff=1
If($buff=1)Then
Sleep(Random($sleepShort-$sleepVar, $sleepShort+$sleepVar))
Send($skill)
EndIf
; sleepShort random sleep so it doesnt start at the same time
Sleep(Random($sleepShort-$sleepVar, $sleepShort+$sleepVar))
; get random move pixel:
$move1xRnd= Random($move1X-$moveRndPixel, $move1X+$moveRndPixel) ; x-axis
$move1yRnd= Random($move1Y-$moveRndPixel, $move1Y+$moveRndPixel) ; y-axis
; get coord difference from center pixel:
$move1xDif= $move1X - $move1xRnd ; x-axis
$move1yDif= $move1Y - $move1yRnd ; y-axis
; click to move to first position
MouseClick("left",$move1xRnd*$ratioX, $move1yRnd*$ratioY,1)
;sleepMove1 time to reach the position
Sleep(Random($sleepMove1-$sleepVar,$sleepMove1+$sleepVar))
;get coords of the chest :
$move2xFinal= $move2X + $move1xDif ; x-axis
$move2yFinal= $move2Y + $move1yDif ; y-axis
;click chest/move to 2nd position
MouseClick("left",$move2xFinal*$ratioX, $move2yFinal*$ratioY)
;sleepMove2 wait to move and open
Sleep(Random($sleepMove2-$sleepVar, $sleepMove2+$sleepVar))
;move a bit to pickup the gold
MouseClick("left", Random($move3X-$moveRndPixel, $move3X+$moveRndPixel)*$ratioX, Random($move3Y-$moveRndPixel, $move3Y+$moveRndPixel)*$ratioY)
;sleepShort wait for the gold pick up
Sleep(Random($sleepShort-$sleepVar, $sleepShort+$sleepVar))
;open menu
Send("{ESC}")
; sleepShort wait for the menu
Sleep(Random($sleepShort-$sleepVar, $sleepShort+$sleepVar))
; click leave game
MouseClick("left", Random($leaveMinX, $leaveMaxX)*$ratioX, Random($leaveMinY, $leaveMaxY) *$ratioY)
WEnd
Func _quit()
Exit
EndFunc
Func _pause()
$paused = Not $paused
while $paused
sleep(10)
WEnd
EndFunc
Func _isRed(Const $coord_x,Const $coord_y)
$colorDec=PixelGetColor($coord_x,$coord_y)
$colorHex ="0x00"& Hex($colorDec,6)
$colRGB= _ColorGetRGB($colorHex)
$red=$colRGB[0]
$green=$colRGB[1]
$blue=$colRGB[2]
$redMin=100
$greenMax=50
$blueMax=50
If($red>$redMin And $green<$greenMax And $blue<$blueMax) Then
Return True
Else
Return False
EndIf
EndFunc