Made this one, but needs to change windows coordinations so im working on it, cause i don't know much of those functions.. I also took the Jaerin pixel search functions to click on Adria without missclick's, its making 10 seconds runs here using the insta-quit feature of immortal!
It doesn't need to invite the Slave because he will stay on party, so it makes all faster... And it doesn't matter if main spawns on town or terminus.
Prerequisites:
Window title changer: http://www.baixaki.com.br/site/dwnld66630.htm
Need to change the main window name to Diablo Main and the slave to Diablo Slave trough Window title changer and also windows coord's.
Diablo Main Window X position: 66
Diablo Main Window Y position: 0
Diablo Main Window Width: 808
Diablo Main Window Height: 627
Diablo Slave Window X position: 873
Diablo Slave Window Y position: 0
Diablo Slave Window Width: 808
Diablo Slave Window Height: 627
Need the Immortal Bot NOT enabled, it will just use the quest conversation cancellation and insta-quit feature... So don't enable the Bot and just turn on the cancel quest option.
There it is:
Code:
Global $winTitleMain = "Diablo Main"
Global $winTitleSlave = "Diablo Slave"
Global $hWndMain = WinGetHandle($winTitleMain)
Global $hWndSlave = WinGetHandle($winTitleSlave)
Global $Slavexcoord = 725
Global $Slaveycoord = 355
Global $ColorMatch = "0x5D3A3D"
Global $ColorVariation = 5
HotKeySet("{ESC}", "Terminate")
While 1
startQuest()
checkInGame()
finishQuest()
WEnd
Func startQuest() ;Main start the quest if Slave is on party at menu screen.
If PixelGetColor(438, 539) = 11894336 And PixelGetColor(1245, 539) = 11894336 Then
Sleep(100)
ControlClick ($hWndMain, '','', "left", 1, 195, 225);Click on start game.
EndIf
EndFunc
Func checkInGame() ;If both characters are ingame, Main will go to menu.
If PixelGetColor(495, 579) = 10044690 And PixelGetColor(1297, 613) = 2339073 Then ;Both in game, checking healthbar pixels.
Sleep(100)
WinActivate("Diablo Main") ;Selecting Main window.
SLeep(100)
BlockInput(1)
Send("{PAUSE}");Leaving game.
BlockInput(0)
EndIf
EndFunc
Func finishQuest() ;Check if Main is already out of the current game and Slave is in game then finish quest on Slave.
If PixelGetColor(892, 104) <> 14728542 And PixelGetColor(1297, 613) = 2339073 Then ;Re-checking if we are ingame.
Sleep(100)
$aryWinPos = WinGetPos($hWndSlave)
$PixelFound = PixelSearch($aryWinPos[0] + 20, $aryWinPos[1] + 30, $aryWinPos[0] + 200, $aryWinPos[1] + 110, $ColorMatch, $ColorVariation)
if not @error Then
$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)
Else
WinActivate("Diablo Slave")
Sleep(100)
BlockInput(1)
Send("{PAUSE}");Leaving game.
BlockInput(0)
EndIf
Sleep(2500)
WinActivate("Diablo Slave")
Sleep(100)
BlockInput(1)
Send("{PAUSE}");Leaving game.
BlockInput(0)
EndIf
EndFunc
Func Terminate()
Exit 0
EndFunc ;Terminate
Update 1: Added pixelsearch.
Update 2: Added @error.
Update 3: Fixing error.
Update 4: Tweak on time, 6-9 seconds each run.