Quest: Vermächnis von Cain quest anfang links zum haus laufen wo hin und wieder der keller auf ist
da soll der bot/script rein laufen die monster um klatschen und looten
beim kumpel geht es aber bei mir nicht habe auch schon die auflösung geändert...
fehler taucht auf wenn man im auswahl menü ist und er auf spiel vorfahren klicken soll er klickt einfach nicht
hilfe!
PHP Code:
$R = 0 ;Leave this as 0 if you are using 1080P. Change it to 1 if you're using 800 x 600
$ComputerLag = 1000 ;Increase this by 100-5000 if you have a slow PC.
$RunSpeed = 0 ;Enter your character's run speed here
$LootRares = True ;Whether or not to loot rare and legendary items
$LootBlues = False ;Whether or not to loot blue items
$Repair = True ;Orders the bot to repair when items are damaged
$LootGems = True ;A bit buggy but works sometimes
$UseStash = False ;Not currently supported
;======================================================================
Global $Resume[2][2] ;Location of the Resume Button
Global $Leave[2][2] ;Location of the in-game leave button
Global $GameLobbyCode[2][3] ;Contains X, Y, and Hex color of Resume button so we can see if we're there
Global $GameScreenCode[2][3] ;Contains X, Y, and Hex color used to check if we are in an unpaused game
Global $Loc1[2][2] ;First movement
Global $Loc2[2][2] ;Second movement
Global $Loc3[2][2] ;Third movement ttt
Global $CellarLocation[2][2] ;Cellar door location
Global $CellarLocation2[2] ;Location of cellar during bad runs (ugly workaround for now)
Global $AltCellar = False
Global $Loc5[2][2] ;Cellar hallway
Global $Loc6[2][2] ;Cellar doorway
Global $MonsterLoc[2][2] ;Initial boss location
Global $MonsterSearch[2][4] ;Bounds of where we will find our monsters
Global $GoldLoot1[2][2] ;First place to run when looting
Global $GoldLoot2[2][2] ;Second place to run when looting
Global $GoldLoot3[2][2] ;Third place to run when looting
Global $LootingArea[2][4] ; looting bounds (TL X, TL Y, BR X, BR Y)
Global $CharHitBox[2][4] ; Hitbox around user's character
Global $DeathBounds[2][2] ; Used to detect the "You Have Died" text
Global $RepairCheck[2][2] ; Used to check for repair icon
Global $RepairCords[2][4][2] ; Four clicks needed to repair
Global $CellarOffset[2]
;Global $MonsterData[2]
Global $CellarIcon
Global $CellarPixel
;Clculate run speed
Global $RunTime = 30 * (100 - $RunSpeed) + 2000 ;Length of time to run in 800x600
;All locations are N dimensional arrays. [0][x] is for 1080P and [1][x] is for 800x600
;1080P
$Resume[0][0] = 319
$Resume[0][1] = 416
$GameLobbyCode[0][0] = 319
$GameLobbyCode[0][1] = 416
$GameLobbyCode[0][2] = 4065536 ;dec
$GameScreenCode[0][0] = 1119
$GameScreenCode[0][1] = 1044
$GameScreenCode[0][2] = 0xDEFDFE
;800x600
$Resume[1][0] = 174
$Resume[1][1] = 232
$GameLobbyCode[1][0] = 174
$GameLobbyCode[1][1] = 232
$GameLobbyCode[1][2] = 4262400
$GameScreenCode[1][0] = 486
$GameScreenCode[1][1] = 578
$GameScreenCode[1][2] = 0x6C9BFF
;1920x1080
$Leave[0][0] = 969
$Leave[0][1] = 582
;800x600
$Leave[1][0] = 397
$Leave[1][1] = 322
;1920x1080
$Loc1[0][0] = 500 ;First movement
$loc1[0][1] = 250
$loc2[0][0] = 1 ;Second movement
$loc2[0][1] = 370
$loc3[0][0] = 400 ;Third Movement
$loc3[0][1] = 600
;800x600
$Loc1[1][0] = 8 ;First movement
$loc1[1][1] = 146
$loc2[1][0] = 7 ;Second movement
$loc2[1][1] = 300
$loc3[1][0] = 8 ;Third Movement
$loc3[1][1] = 300
;1080P
$CellarLocation[0][0] = 307 ;Cellar door location
$CellarLocation[0][1] = 74
;800x600
$CellarLocation[1][0] = 499 ;Cellar door location
$CellarLocation[1][1] = 148
$CellarLocation2[0] = 439
$CellarLocation2[1] = 145
$AltCellarLocation = False
;Cellar offset
$CellarOffset[0] = 33;
$CellarOffset[1] = 10;
;1080P
$loc5[0][0] = 116 ;Walk down hallway
$loc5[0][1] = 986
$loc6[0][0] = 776 ;enter hallway
$loc6[0][1] = 328
;800x600
$loc5[1][0] = 3 ;Walk down hallway
$loc5[1][1] = 504
$loc6[1][0] = 255 ;enter hallway
$loc6[1][1] = 190
;1080P
$MonsterLoc[0][0] = 577
$MonsterLoc[0][1] = 183
;800x600
$MonsterLoc[1][0] = 188
$MonsterLoc[1][1] = 111
;1920x1080
$MonsterSearch[0][0] = 162
$MonsterSearch[0][1] = 29
$MonsterSearch[0][2] = 1248
$MonsterSearch[0][3] = 446
;800x600
$MonsterSearch[1][0] = 40
$MonsterSearch[1][1] = 53
$MonsterSearch[1][2] = 424
$MonsterSearch[1][3] = 191
;1920x1080
$GoldLoot1[0][0] = 402
$GoldLoot1[0][1] = 306
$GoldLoot2[0][0] = 1260
$GoldLoot2[0][1] = 351
$GoldLoot3[0][0] = 911
$GoldLoot3[0][1] = 694
;800x600
$GoldLoot1[1][0] = 96
$GoldLoot1[1][1] = 181
$GoldLoot2[1][0] = 560
$GoldLoot2[1][1] = 191
$GoldLoot3[1][0] = 349
$GoldLoot3[1][1] = 418
;1080P
$LootingArea[0][0] = 550
$LootingArea[0][1] = 300
$LootingArea[0][2] = 1100
$LootingArea[0][3] = 600
;800x600
$LootingArea[1][0] = 75
$LootingArea[1][1] = 90
$LootingArea[1][2] = 630
$LootingArea[1][3] = 360
;1080P
$CharHitBox[0][0] = 790
$CharHitBox[0][1] = 315
$CharHitBox[0][2] = 1200
$CharHitBox[0][3] = 730
;800x600
$CharHitBox[1][0] = 304
$CharHitBox[1][1] = 190
$CharHitBox[1][2] = 468
$CharHitBox[1][3] = 323
;1080P (NOT DONEEEEEEEEEEEEE)
$DeathBounds[0][0] = 538
$DeathBounds[0][1] = 335
;800x600
$DeathBounds[1][0] = 210
$DeathBounds[1][1] = 180
;1080P
$RepairCords[0][0][0] = 1690
$RepairCords[0][0][1] = 102
$RepairCords[0][1][0] = 930
$RepairCords[0][1][1] = 136
$RepairCords[0][2][0] = 517
$RepairCords[0][2][1] = 483
$RepairCords[0][3][0] = 223
$RepairCords[0][3][1] = 592
;800x600
$RepairCords[1][0][0] = 691
$RepairCords[1][0][1] = 88
$RepairCords[1][1][0] = 505
$RepairCords[1][1][1] = 52
$RepairCords[1][2][0] = 282
$RepairCords[1][2][1] = 261
$RepairCords[1][3][0] = 157
$RepairCords[1][3][1] = 329
;1080P
$RepairCheck[0][0] = 1507
$RepairCheck[0][1] = 36
;800x600
$RepairCheck[1][0] = 573
$RepairCheck[1][1] = 21
$Amethyst = 0xAC7FFF
$Ruby = 0xB01D2D
$Emerald = 0x58EE33
$Topaz = 0xFFFF59
HotKeySet("z", "Terminate")
HotKeySet("w","InGameplayScreen")
Func Terminate()
Exit 0
EndFunc
Opt('MouseCoordMode', 2)
Opt('PixelCoordMode', 2)
HotKeySet('{END}', 'Quit')
HotKeySet('{SPACE}', 'Pause')
Global $Paused
;bot starts paused. press space to start.
Pause()
$LootAttempts = 0
$GemLootAttempts = 0
WinActivate('Diablo III')
While 1
If WinActive('Diablo III') Then
$AltCellarLocation = False
$LootAttempts = 0
$GemLootAttempts = 0
;Make sure that we are in the character selection screen ( we are looking at a spot in the Resume game button)
for $i = 12 To 0 step -1
if InGameLobby() Then
ExitLoop
EndIf
sleep(600)
if $i == 1 Then
MsgBox(4096, "Error Resuming Game", "You don't seem to be in the lobby. Bot will now exit", 50)
Terminate()
EndIf
Next
;Resume the game
Click($Resume[$R][0], $Resume[$R][1])
;Make sure that we are in the game
for $i = 12 To 0 step -1
if InGameplayScreen() Then
ExitLoop
EndIf
sleep(1000)
if $i == 1 Then
MsgBox(4096, "Error Starting the Game", "The game did not properly load...", 50)
Terminate()
EndIf
Next
;Summon a fetish army and bring out the voodo
Send("{1}")
Rest(400)
Send("{2}")
Rest(750)
;Custom running for the 800x600. Sometimes I wonder if it's faster to just buy everyone a 1080P monitor...
if Int($R) == 1 Then
MouseMove(11, 220)
Sleep(400)
Send("{4}")
MouseDown("middle")
Sleep($RunTime)
MouseUp("middle")
Sleep(2000)
#cs $CellarIcon = PixelSearch(630, 70, 741, 149, 0x71341A, 5)
if not @error then
ConsoleWrite("Foundtheseller" & @LF)
EndIf
#ce
Else
Move($Loc1[$R][0], $Loc1[$R][1])
Sleep(200)
Send("{4}")
Sleep(700)
Move($Loc2[$R][0], $Loc2[$R][1])
Sleep(1100)
Move($Loc3[$R][0], $Loc3[$R][1])
EndIf
;Check to see if the cellar is there ```````
MouseMove($CellarLocation[$R][0], $CellarLocation[$R][1])
Sleep(400)
if Int($R) == 1 then
$CellarPixel = PixelSearch($CellarLocation[$R][0]-30, $CellarLocation[$R][1]-30,$CellarLocation[$R][0]+20,$CellarLocation[$R][1]+20, 0x93D7F9,8)
if @error Then
MouseMove($CellarLocation2[0], $CellarLocation2[1])
Sleep(300)
$CellarPixel = PixelSearch($CellarLocation2[0]-30, $CellarLocation2[1]-30,$CellarLocation2[0]+20,$CellarLocation2[1]+20, 0x93D7F9,8)
if not @error Then
$AltCellarLocation = True
EndIf
EndIf
Else
$CellarPixel = PixelSearch($CellarLocation[$R][0]-$CellarOffset[$R], $CellarLocation[$R][1]-$CellarOffset[$R],$CellarLocation[$R][0]+4,$CellarLocation[$R][1]+4, 0x334FB7,6)
EndIf
;Leave the game if the Cellar is not there
if @error Then
ConsoleWrite("Did not find the cellar " & @LF)
SnareNearbyEnemies()
leaveGame()
Sleep(12000)
ContinueLoop
EndIf
;Enter the cellar
ConsoleWrite("Entering the Cellar..." & @LF)
if $R > 0 AND $AltCellar Then
Click($CellarLocation2[$R][0] - 4, $CellarLocation2[$R][1] - 4)
Else
if not $AltCellarLocation Then
Click($CellarLocation[$R][0], $CellarLocation[$R][1])
Else
Click($CellarLocation2[0], $CellarLocation2[1])
EndIf
endif
if Int($R) == 1 Then
sleep(1500+$ComputerLag)
Else
Sleep(3500 + $ComputerLag)
EndIf
;Check to see if we died
if CheckForDeath() Then
ContinueLoop
EndIf
;Inside the celler now - Move to the doorway
Move($Loc5[$R][0], $Loc5[$R][1])
Sleep(1500)
Move($Loc6[$R][0], $Loc6[$R][1])
Sleep(300)
;Cast spell 3 on the pack
MouseMove($MonsterLoc[$R][0],$MonsterLoc[$R][1])
Sleep(150)
Send("{3}")
Sleep(250)
;Kill all the enemies inside
while 1
$MonsterBar = PixelSearch($MonsterSearch[$R][0], $MonsterSearch[$R][1], $MonsterSearch[$R][2], $MonsterSearch[$R][3], 0xEE0000, 10)
if @error Then
ConsoleWrite("Didn't find any, attacking to discover potential enemies" & @LF)
Attack($MonsterLoc[$R][0],$MonsterLoc[$R][1])
sleep(500)
Attack($MonsterLoc[$R][0]-20,$MonsterLoc[$R][1]-10)
sleep(500)
Attack($MonsterLoc[$R][0]+30,$MonsterLoc[$R][1]+10)
Sleep(400)
$MonsterBar = PixelSearch($MonsterSearch[$R][0], $MonsterSearch[$R][1], $MonsterSearch[$R][2], $MonsterSearch[$R][3], 0xEE0000, 10)
if @error Then
ConsoleWrite("No monsters found - Moving on")
ExitLoop
EndIf
EndIf
;if CheckForNearbyMonsters() Then
;send("{4}")
;EndIf
for $i = 7 To 0 step -1
Attack($MonsterBar[0], $MonsterBar[1])
Sleep(100)
Next
WEnd
;Loot the gold and attack anything we missed
Move($GoldLoot1[$R][0], $GoldLoot1[$R][1])
Sleep(Random(800, 900))
AttackNearbyMonsters()
Move($GoldLoot2[$R][0], $GoldLoot2[$R][1])
Sleep(Random(400,500))
AttackNearbyMonsters()
Move($GoldLoot3[$R][0], $GoldLoot3[$R][1])
sleep(Random(400,500))
AttackNearbyMonsters()
;Loot items
if $LootRares then
LootRares()
$LootAttemps = 0
LootLegendaries()
$LootAttempts = 0
EndIf
if $LootBlues Then
$LootAttempts = 0
LootMagic()
EndIf
if $LootGems Then
LootGems()
EndIf
;Check to see if we died
if CheckForDeath() Then
ContinueLoop
EndIf
;Teleport to town
send("{t}")
sleep(8000)
;Repair if needed
if $Repair then
RepairItems()
EndIf
;Leave the game
LeaveGame()
Sleep(1000)
EndIf
WEnd
Func CheckForRepair()
$RepairNeeded = PixelSearch($RepairCheck[$R][0],$RepairCheck[$R][1], $RepairCheck[$R][0]+5, $RepairCheck[$R][1]+5, 0xFFE801,10)
if Not @error Then
return True
Else
return False
EndIf
EndFunc
Func RepairItems()
if not CheckForRepair() Then
Return
EndIf
Move($RepairCords[$R][0][0] , $RepairCords[$R][0][1])
Sleep(2700+$ComputerLag)
MouseMove($RepairCords[$R][1][0] , $RepairCords[$R][1][1])
Sleep(400)
Click($RepairCords[$R][1][0] , $RepairCords[$R][1][1])
sleep(2200+$ComputerLag)
click($RepairCords[$R][2][0] , $RepairCords[$R][2][1])
Sleep(Random(700-900))
Click($RepairCords[$R][3][0] , $RepairCords[$R][3][1])
Sleep(500)
send("{esc}")
EndFunc
Func LeaveGame()
send("{esc}")
Sleep(400)
Click($Leave[$R][0], $Leave[$R][1])
EndFunc
Func Pause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip('Paused...', 0, 0)
WEnd
ToolTip("")
EndFunc ;
Func Click($x, $y)
MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
Sleep(Random(1000, 1500))
EndFunc
Func Move($x, $y)
MouseClick('middle', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
Sleep(Random(1000, 1500))
EndFunc
Func Attack($x, $y)
MouseClick('right', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
EndFunc
Func Rest($z)
Sleep(Random($z, $z+25))
EndFunc
Func CheckForDeath()
$Death = PixelSearch($DeathBounds[$R][0], $DeathBounds[$R][0], $DeathBounds[$R][0]+4, $DeathBounds[$R][0]+4, 0xFFFFFF)
if not @error Then
ConsoleWrite("Died" & @LF)
LeaveGame()
Sleep(12000)
return True
Else
return False
EndIf
EndFunc
Func LootMagic()
$Magic = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0x6969FF, 2) ;
If not @error Then
Click($Magic[0], $Magic[1])
Sleep(Random(800,1000))
EndIf
$LootAttempts+=1
if($LootAttempts > 5) then
Return
Else
LootMagic()
EndIf
EndFunc
Func LootRares()
$Rare = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0xBBBB00, 2) ;
If not @error Then
Click($Rare[0], $Rare[1])
Sleep(Random(800,1000))
EndIf
$LootAttempts+=1
if($LootAttempts > 5) then
Return
Else
LootRares()
EndIf
EndFunc
Func LootLegendaries()
$Legendary = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],0xBF642F, 2) ;
If not @error Then
Click($Legendary[0], $Legendary[1])
Sleep(Random(800,1000))
EndIf
$set = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][2], 0x02CE01, 2) ;
If not @error Then
Click($set[0], $set[1])
Sleep(Random(800,1000))
EndIf
$LootAttempts+=1
if($LootAttempts > 3) then
Return
Else
LootRares()
EndIf
EndFunc
#cs
$Amethyst = 0xAC7FFF
$Ruby = 0xB01D2D
$Emerald = 0x58EE33
$Topaz = 0xFFFF59
#ce
Func LootGems()
$Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Ruby,6) ;
If not @error Then
Click($Gem[0], $Gem[1]-7)
Sleep(Random(500,900))
EndIf
$Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Amethyst,8) ;
If not @error Then
Click($Gem[0], $Gem[1]-7)
Sleep(Random(500,900))
EndIf
$Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Emerald,11) ;
If not @error Then
Click($Gem[0], $Gem[1]-7)
Sleep(Random(500,900))
EndIf
$Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Topaz,2) ;
If not @error Then
Click($Gem[0], $Gem[1]-7)
Sleep(Random(500,900))
EndIf
$GemLootAttempts+=1
if($GemLootAttempts > 3) then
Return
Else
LootGems()
EndIf
EndFunc
Func AttackNearbyMonsters()
while 1
$MonsterData = PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
if @error Then
ExitLoop
EndIf
send("{4}")
sleep(300)
for $i = 10 To 0 step -1
Attack($MonsterData[0], $MonsterData[1])
Sleep(100)
Next
WEnd
EndFunc
Func CheckForNearbyMonsters()
$MonsterData = PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
if @error Then
return False
Else
return True
EndIf
EndFunc
Func SnareNearbyEnemies()
$MonsterData = PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
if not @error Then
MouseMove($MonsterData[0], $MonsterData[1])
Sleep(350)
Send("{3}")
sleep(250)
EndIf
EndFunc
Func InGameLobby()
MouseMove($GameLobbyCode[$R][0],$GameLobbyCode[$R][1])
Sleep(300)
PixelSearch($GameLobbyCode[$R][0],$GameLobbyCode[$R][1],$GameLobbyCode[$R][0]+10,$GameLobbyCode[$R][1]+10, $GameLobbyCode[$R][2], 10)
if not @error Then
return True
Else
return False
EndIf
EndFunc
Func InGameplayScreen()
PixelSearch($GameScreenCode[$R][0],$GameScreenCode[$R][1],$GameScreenCode[$R][0]+4,$GameScreenCode[$R][1]+3, $GameScreenCode[$R][2], 10)
if not @error Then
return True
Else
return False
EndIf
EndFunc