I will not support this code because I know it sucks but its a start. This is designed for minimum sized windows, but doesn't rely on them being any particular place on the screen.
Note that you will need to get a Window Title name changer to identify which Diablo III window is your "Diablo III Main" and which one is your "Diablo III Slave 1"
You will also need to adjust the coordinates of the invite button on your Main's friend list. The color matching on the quest turnin seems to be fairly reliable, but that will be the other thing to adjust. I put all these variables at the top. It is entirely capable of being in the background with one exception the click to interact to turn in seems to require the mouse to be over the NPC. So with that you will lose textbox focus and such. If someone knows a way around this let me know.
****EDIT*** Updated the script again. No longer has Slave1 leave game before inviting to the next. Also be aware the timings in this script are for a fast connection on a fast machine. You WILL need to increase the sleeps or even add some I'm sure.
Code:
#include <GUIConstantsEx.au3>
Global $winTitleMain = "Diablo III Main"
Global $winTitleSlave1 = "Diablo III Slave 1"
Global $hWndMain = WinGetHandle($winTitleMain)
Global $hWndSlave1 = WinGetHandle($winTitleSlave1)
Global $Slave1xcoord = 725
Global $Slave1ycoord = 355
Global $ColorMatch = "0x5D3A3D"
Global $ColorVariation = 5
HotKeySet("{pause}", "Terminate")
Func Terminate()
Exit
EndFunc ;==>Terminate
While 1
InviteSlave1()
BotSlave1AcceptInvite()
Sleep(3000)
BotMainResume()
BotMainLeaveGame()
BotSlave1TurnIn()
WEnd
Func BotMainResume()
ControlClick($hWndMain, '', '', "left", 1, 120, 240)
Sleep(5000)
EndFunc ;==>BotMainResume
Func BotSlave1Resume()
ControlClick($hWndSlave1, '', '', "left", 1, 120, 240)
Sleep(5000)
EndFunc ;==>BotSlave1Resume
Func BotSlave1AcceptInvite()
ControlClick($hWndSlave1, '', '', "left", 1, 700, 520)
Sleep(500)
ControlClick($hWndSlave1, '', '', "left", 1, 345, 355)
Sleep(500)
EndFunc ;==>Bot1AcceptInvite
Func BotMainLeaveGame()
ControlSend($hWndMain, '', '', "{SPACE}")
Sleep(500)
ControlSend($hWndMain, '', '', "{ESC}")
Sleep(500)
ControlClick($hWndMain, '', '', "left", 1, 415, 330)
Sleep(500)
ControlClick($hWndMain, '', '', "left", 1, 345, 360)
Sleep(500)
EndFunc ;==>BotMainLeaveGame
Func InviteSlave1()
ControlClick($hWndMain, '', '', "left", 1, 780, 565)
Sleep(500)
ControlClick($hWndMain, '', '', "left", 1, $Slave1xcoord, $Slave1ycoord)
Sleep(500)
ControlSend($hWndMain, '', '', "{SPACE}")
EndFunc ;==>InviteSlave1
Func BotSlave1TurnIn()
Sleep(1000)
$aryWinPos = WinGetPos($hWndSlave1)
$PixelFound = PixelSearch($aryWinPos[0] + 20, $aryWinPos[1] + 30, $aryWinPos[0] + 200, $aryWinPos[1] + 110, $ColorMatch, $ColorVariation)
ConsoleWrite( "Pixel found: " & $PixelFound[0] & " " & $PixelFound[1] & @CRLF)
$origMousePos = MouseGetPos()
BlockInput(1)
MouseMove($PixelFound[0], $PixelFound[1], 0)
MouseClick("left", $PixelFound[0], $PixelFound[1], 3, 0)
MouseMove($origMousePos[0], $origMousePos[1], 0)
BlockInput(0)
Sleep(3500)
ControlSend($hWndSlave1, '', '', "{SPACE}")
Sleep(200)
ControlSend($hWndSlave1, '', '', "{SPACE}")
Sleep(200)
ControlSend($hWndSlave1, '', '', "{SPACE}")
Sleep(200)
ControlSend($hWndSlave1, '', '', "{SPACE}")
Sleep(200)
ControlSend($hWndSlave1, '', '', "{SPACE}")
Sleep(200)
ControlSend($hWndSlave1, '', '', "{SPACE}")
Sleep(200)
ControlSend($hWndSlave1, '', '', "{SPACE}")
Sleep(200)
ControlSend($hWndSlave1, '', '', "{SPACE}")
Sleep(2000)
EndFunc ;==>BotSlave1sTurnIn