Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ImageSearch.au3>
- #include <WindowsConstants.au3>
- #include <Misc.au3>
- #Include <WinAPI.au3>
- Global $Items[6][5]
- Global $SoundFiles[6]
- Global $Resume[2]
- Global $Paused
- Global $Leave[2]
- Global $GameLobbyCode[3]
- Global $GameScreenCode[3]
- Global $NetworkCode[6]
- Global $PasswordLoc[2]
- Global $Loc1[2]
- Global $Loc2[2]
- Global $Loc3[2]
- Global $Loc5[2]
- Global $Loc6[2]
- Global $CellarLocation[2]
- Global $CellarLocation2[2]
- Global $CellarOffset[2]
- Global $MonsterLoc[2]
- Global $MonsterSearch[4]
- Global $GoldLoot1[2]
- Global $GoldLoot2[2]
- Global $GoldLoot3[2]
- Global $LootingArea[4]
- Global $FullArea[4]
- Global $SellArea[4]
- Global $CharHitBox[4]
- Global $DeathBounds[2]
- Global $RepairCords[4][2]
- Global $PortalCords[3][2]
- Global $RepairCheck[2]
- Global $CellarPixel
- Global $FullBag = False
- ;//////////////////////////////////////--CONFIG--/////////////////////////////////////////////////////////////////////////////
- $ComputerLag = 0 ;Increase this by 50-1000 if you have a slow PC //
- $LootLegendaries = True ;Whether or not to loot legendary items //
- $LootSets = True ;Whether or not to loot set items //
- $LootRares = True ;Whether or not to loot rare items //
- $LootMagics = False ;Whether or not to loot magic items (includes tomes) //
- $LootTomes = True ;Whether or not to loot tomes //
- $LootGems = True ;Whether or not to loot gems //
- $Repair = True ;Orders the bot to repair when items are damaged //
- $Sell = False ;Orders the bot to sell when bag is full //
- $ImgDir = "C:\Program Files (x86)\AutoIt3\pics\" ;Location of the image folder //
- $Sounds = True ;Enable sounds //
- $SoundsDir = "C:\Program Files (x86)\AutoIt3\sounds\" ;Location of the sounds folder //
- $ShowLootArea = True ;Shows lootarea //
- $ShowStatTooltip = True ;Shows the tooltip with statistics from the current session //
- $Stats = False ;Enable statistics //
- ; Options for the Relogfunction //
- $UseRelog = 1 ;Enable Relogfunction //
- $Password = "xxxxxxxx" ;Your password //
- ; //
- ; Changes below have an significantly impact on the needed time for one run! //
- $RareLootAmount = 1 ;Amount of rare items to pickup //
- $MagicLootAmount = 3 ;Amount of magic items to pickup //
- $TomeLootAmount = 1 ;Amount of tomes to pickup //
- $GemLootAmount = 2 ;Amount of gems to pickup //
- $LootingArea[0] = 570 ;Left (lower -> bigger) //
- $LootingArea[1] = 185 ;Top (lower -> bigger) //
- $LootingArea[2] = 1375 ;Right (higher -> bigger) //
- $LootingArea[3] = 720 ;Bot (higher -> bigger) //
- ;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- $Items[0][0] = "legendaryA.png|65"
- $Items[0][1] = "legendaryE.png|65"
- $Items[0][2] = "legendaryI.png|65"
- $Items[0][3] = "legendaryO.png|65"
- $Items[0][4] = "legendaryU.png|65"
- $Items[1][0] = "setA.png|80"
- $Items[1][1] = "setE.png|80"
- $Items[1][2] = "setU.png|80"
- $Items[1][3] = "setO.png|80"
- $Items[1][4] = "setI.png|80"
- $Items[2][0] = "rareA.png|80"
- $Items[2][1] = "rareE.png|80"
- $Items[2][2] = "rareI.png|80"
- $Items[2][3] = "rareO.png|80"
- $Items[2][4] = "rareU.png|80"
- $Items[3][0] = "blueA.png|30"
- $Items[3][1] = "blueE.png|30"
- $Items[3][2] = "blueI.png|30"
- $Items[3][3] = "blueO.png|30"
- $Items[3][4] = "blueU.png|30"
- $Items[4][0] = "tome.png|140"
- $Items[4][1] = "uare.png|100"
- $Items[5][0] = "you.png|100"
- $Items[5][1] = "sellNew.png|75"
- $Items[5][2] = "sell1x1.png|60"
- $SoundFiles[0] = "legendary.wav"
- $SoundFiles[1] = "set.wav"
- $SoundFiles[2] = "rare.wav"
- $SoundFiles[3] = "magic.wav"
- $SoundFiles[4] = "tome.wav"
- $SoundFiles[5] = "gem.wav"
- $Resume[0] = 319
- $Resume[1] = 416
- $Leave[0] = 969
- $Leave[1] = 582
- $GameLobbyCode[0] = 319
- $GameLobbyCode[1] = 416
- $GameLobbyCode[2] = 4065536
- $GameScreenCode[0] = 1119
- $GameScreenCode[1] = 1044
- $GameScreenCode[2] = 0xDEFDFE
- $NetworkCode[0] = 840
- $NetworkCode[1] = 410
- $NetworkCode[2] = 950
- $NetworkCode[3] = 440
- $NetworkCode[4] = 960
- $NetworkCode[5] = 630
- $PasswordLoc[0] = 820
- $PasswordLoc[1] = 705
- $Loc1[0] = 500
- $Loc1[1] = 250
- $Loc2[0] = 1
- $Loc2[1] = 370
- $Loc3[0] = 400
- $Loc3[1] = 600
- $Loc5[0] = 116
- $Loc5[1] = 986
- $Loc6[0] = 776
- $Loc6[1] = 328
- $CellarLocation[0] = 307
- $CellarLocation[1] = 74
- $CellarOffset = 33
- $MonsterLoc[0] = 577
- $MonsterLoc[1] = 183
- $MonsterSearch[0] = 150
- $MonsterSearch[1] = 20
- $MonsterSearch[2] = 1248
- $MonsterSearch[3] = 446
- $GoldLoot1[0] = 577
- $GoldLoot1[1] = 306
- $GoldLoot2[0] = 1260
- $GoldLoot2[1] = 351
- $GoldLoot3[0] = 911
- $GoldLoot3[1] = 694
- $FullArea[0] = 795
- $FullArea[1] = 125
- $FullArea[2] = 830
- $FullArea[3] = 160
- $SellArea[0] = 1460
- $SellArea[1] = 585
- $SellArea[2] = 1900
- $SellArea[3] = 875
- $CharHitBox[0] = 790
- $CharHitBox[1] = 315
- $CharHitBox[2] = 1200
- $CharHitBox[3] = 730
- $DeathBounds[0] = 538
- $DeathBounds[1] = 335
- $RepairCords[0][0] = 1690
- $RepairCords[0][1] = 102
- $RepairCords[1][0] = 930
- $RepairCords[1][1] = 136
- $RepairCords[2][0] = 517
- $RepairCords[2][1] = 483
- $RepairCords[3][0] = 223
- $RepairCords[3][1] = 592
- $RepairCheck[0] = 1507
- $RepairCheck[1] = 36
- $PortalCords[0][0] = 780
- $PortalCords[0][1] = 950
- $PortalCords[1][0] = 270
- $PortalCords[1][1] = 930
- $PortalCords[2][0] = 650
- $PortalCords[2][1] = 500
- $DisconnectState = 0
- $Disconnects = 0
- $ISx = 0
- $ISy = 0
- $RareLootAttempts = 0
- $MagicLootAttempts = 0
- $TomeLootAttempts = 0
- $GemLootAttempts = 0
- $StartTime = @HOUR & ":" & @MIN & " Uhr"
- $Runs = 0
- $Closed = 0
- $Runtime = "0h 0m 0s"
- $Legendaries = 0
- $Sets = 0
- $Rares = 0
- $Magics = 0
- $Gems = 0
- $Tomes = 0
- $Sold = 0
- $LootingAreaWidth = $LootingArea[2] - $LootingArea[0]
- $LootingAreaHeight = $LootingArea[3] - $LootingArea[1]
- If $ShowLootArea = True Then
- DrawLootArea()
- EndIf
- OnAutoItExitRegister ('OnAutoItExit')
- Opt('MouseCoordMode', 2)
- Opt('PixelCoordMode', 2)
- HotKeySet('{PAUSE}', 'Pause')
- HotKeySet('{END}', 'Terminate')
- Pause()
- $Timer = TimerInit()
- If $ShowStatTooltip = True Then
- ToolTip("Start: " & $StartTime & " | Runs: " & $Runs & " | Closed: " & $Closed & " | Disconnects: " & $Disconnects & " | Runtime: " & $Runtime & " | Legendaries: " & $Legendaries & " | Sets: " & $Sets & " | Rares: " & $Rares & " | Magics: " & $Magics & " | Tomes: " & $Tomes & " | Gems: " & $Gems & " | Sold: " $Sold, 530, 0)
- EndIf
- WinActivate('Diablo III')
- While 1
- If WinActive('Diablo III') Then
- While $DisconnectState < 2
- for $i = 18 To 0 step -1
- if InGameLobby() Then
- ExitLoop
- EndIf
- Sleep(600)
- if $i == 1 Then
- CheckForDisconnectState()
- Sleep(2000 + $Computerlag)
- EndIf
- Next
- Click($Resume[0], $Resume[1])
- for $i = 20 To 0 step -1
- if InGameplayScreen() Then
- $DisconnectState = 0
- ExitLoop
- EndIf
- Sleep(500)
- if $i == 1 Then
- CheckForDisconnectState()
- Sleep(2000 + $Computerlag)
- EndIf
- Next
- If $DisconnectState = 2 Then
- If $UseRelog = 1 Then
- Relog()
- Else
- Terminate()
- EndIf
- Else
- If $DisconnectState = 0 Then
- ExitLoop
- EndIf
- EndIf
- WEnd
- Sleep(100 + $Computerlag)
- Send("{2}")
- Sleep(200 + $Computerlag)
- Move($Loc1[0], $Loc1[1])
- Sleep(150 + $Computerlag)
- Send("{4}")
- Sleep(500 + $Computerlag)
- Move($Loc2[0], $Loc2[1])
- Sleep(900 + $Computerlag)
- Move($Loc3[0], $Loc3[1])
- MouseMove($CellarLocation[0], $CellarLocation[1],0)
- Sleep(400 + $Computerlag)
- $CellarPixel = PixelSearch($CellarLocation[0]-$CellarOffset, $CellarLocation[1]-$CellarOffset,$CellarLocation[0]+4,$CellarLocation[1]+4, 0x334FB7,6)
- if @error Then
- $Closed+=1
- send("{t}")
- Sleep(6500 + $Computerlag)
- leaveGame()
- ContinueLoop
- EndIf
- Click($CellarLocation[0], $CellarLocation[1])
- Sleep(3200 + $Computerlag)
- if CheckForDeath() Then
- ContinueLoop
- EndIf
- Move($Loc5[0], $Loc5[1])
- Sleep(1100 + $Computerlag)
- Move($Loc6[0], $Loc6[1])
- Sleep(10 + $Computerlag)
- MouseMove($MonsterLoc[0],$MonsterLoc[1],0)
- Sleep(150 + $Computerlag)
- send("{1}")
- Sleep(200 + $Computerlag)
- MouseClick('right')
- Sleep(400 + $Computerlag)
- Send("{3}")
- Sleep(150 + $Computerlag)
- while 1
- $MonsterBar = PixelSearch($MonsterSearch[0], $MonsterSearch[1], $MonsterSearch[2], $MonsterSearch[3], 0xEE0000, 10)
- if @error Then
- Attack($MonsterLoc[0],$MonsterLoc[1])
- Sleep(850 + $Computerlag)
- $MonsterBar = PixelSearch($MonsterSearch[0], $MonsterSearch[1], $MonsterSearch[2], $MonsterSearch[3], 0xEE0000, 10)
- if @error Then
- ExitLoop
- EndIf
- EndIf
- for $i = 7 To 0 step -1
- Attack($MonsterBar[0], $MonsterBar[1])
- Sleep(100 + $Computerlag)
- Next
- WEnd
- Move($GoldLoot1[0], $GoldLoot1[1])
- Sleep(200 + $Computerlag)
- AttackNearbyMonsters()
- MouseMove(120, 120, 0)
- Sleep(100 + $Computerlag)
- #cs
- Move($GoldLoot2[0], $GoldLoot2[1])
- Sleep(Random(150,250))
- AttackNearbyMonsters()
- Move($GoldLoot3[0], $GoldLoot3[1])
- Sleep(Random(150,250))
- AttackNearbyMonsters()
- #ce
- if $LootSets then
- LootSets()
- EndIf
- if $LootLegendaries then
- LootLegendaries()
- EndIf
- if $LootRares then
- LootRares()
- $RareLootAttempts = 0
- EndIf
- if $LootMagics Then
- LootMagics()
- $MagicLootAttempts = 0
- Else
- if $LootTomes Then
- LootTomes()
- $TomesLootAttempts = 0
- EndIf
- EndIf
- if $LootGems Then
- LootGems()
- $GemLootAttempts = 0
- EndIf
- if CheckForDeath() Then
- ContinueLoop
- EndIf
- Sleep(500 + $Computerlag)
- send("{t}")
- Sleep(7000 + $Computerlag)
- if $Repair then
- RepairItems()
- EndIf
- LeaveGame()
- Sleep(1000 + $Computerlag)
- EndIf
- WEnd
- ;Lootfunctions
- Func LootLegendaries()
- For $gI = 0 to 4
- $array = StringSplit($Items[0][$gI],"|")
- $file = $array[1]
- $accuracy = $array[2]
- $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
- If $target = 1 Then
- If $Sounds = True Then
- SoundPlay($SoundsDir & $SoundFiles[0], 0)
- EndIf
- $Legendaries+=1
- MouseClick("LEFT", $ISx, $ISy, 1, 0)
- Sleep(300 + $Computerlag)
- MouseMove(120, 120, 0)
- Sleep(100 + $Computerlag)
- If $Sell = True Then
- CheckBagFull()
- If $FullBag = True Then
- $FullBag = False
- LootLegendaries()
- EndIf
- EndIf
- EndIf
- Next
- EndFunc
- Func LootSets()
- For $gI = 0 to 4
- $array = StringSplit($Items[1][$gI],"|")
- $file = $array[1]
- $accuracy = $array[2]
- $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
- If $target = 1 Then
- If $Sounds = True Then
- SoundPlay($SoundsDir & $SoundFiles[1], 0)
- EndIf
- $Sets+=1
- MouseClick("LEFT", $ISx, $ISy, 1, 0)
- Sleep(300 + $Computerlag)
- MouseMove(120, 120, 0)
- Sleep(100 + $Computerlag)
- If $Sell = True Then
- CheckBagFull()
- If $FullBag = True Then
- $FullBag = False
- LootSets()
- EndIf
- EndIf
- EndIf
- Next
- EndFunc
- Func LootRares()
- For $gI = 0 to 4
- $array = StringSplit($Items[2][$gI],"|")
- $file = $array[1]
- $accuracy = $array[2]
- $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
- If $target = 1 Then
- If $Sounds = True Then
- SoundPlay($SoundsDir & $SoundFiles[2], 0)
- EndIf
- $Rares+=1
- MouseClick("LEFT", $ISx, $ISy, 1, 0)
- Sleep(300 + $Computerlag)
- MouseMove(120, 120, 0)
- Sleep(100 + $Computerlag)
- If $Sell = True Then
- CheckBagFull()
- If $FullBag = True Then
- $FullBag = False
- LootRares()
- EndIf
- EndIf
- EndIf
- Next
- if($RareLootAttempts = $RareLootAmount) then
- Return
- Else
- $RareLootAttempts+=1
- LootRares()
- EndIf
- EndFunc
- Func LootMagics()
- For $gI = 0 to 4
- $array = StringSplit($Items[3][$gI],"|")
- $file = $array[1]
- $accuracy = $array[2]
- $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
- If $target = 1 Then
- If $Sounds = True Then
- SoundPlay($SoundsDir & $SoundFiles[3], 0)
- EndIf
- $Magics+=1
- MouseClick("LEFT", $ISx, $ISy, 1, 0)
- Sleep(300 + $Computerlag)
- MouseMove(120, 120, 0)
- Sleep(100 + $Computerlag)
- If $Sell = True Then
- CheckBagFull()
- If $FullBag = True Then
- $FullBag = False
- LootMagics()
- EndIf
- EndIf
- EndIf
- Next
- if($MagicLootAttempts = $MagicLootAmount) then
- Return
- Else
- $MagicLootAttempts+=1
- LootMagics()
- EndIf
- EndFunc
- Func LootTomes()
- $array = StringSplit($Items[4][0],"|")
- $file = $array[1]
- $accuracy = $array[2]
- $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
- If $target = 1 Then
- If $Sounds = True Then
- SoundPlay($SoundsDir & $SoundFiles[4], 0)
- EndIf
- $Tomes+=1
- MouseClick("LEFT", $ISx, $ISy, 1, 0)
- Sleep(500 + $Computerlag)
- MouseMove(120, 120, 0)
- Sleep(100 + $Computerlag)
- If $Sell = True Then
- CheckBagFull()
- If $FullBag = True Then
- $FullBag = False
- LootTomes()
- EndIf
- EndIf
- EndIf
- if($TomeLootAttempts = $TomeLootAmount) then
- Return
- Else
- $TomeLootAttempts+=1
- LootTomes()
- EndIf
- EndFunc
- Func LootGems()
- $array = StringSplit($Items[4][1],"|")
- $file = $array[1]
- $accuracy = $array[2]
- $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
- If $target = 1 Then
- If $Sounds = True Then
- SoundPlay($SoundsDir & $SoundFiles[5], 0)
- EndIf
- $Gems+=1
- MouseClick("LEFT", $ISx, $ISy, 1, 0)
- Sleep(500 + $Computerlag)
- MouseMove(120, 120, 0)
- Sleep(100 + $Computerlag)
- If $Sell = True Then
- CheckBagFull()
- If $FullBag = True Then
- $FullBag = False
- LootGems()
- EndIf
- EndIf
- EndIf
- if($GemLootAttempts = $GemLootAmount) then
- Return
- Else
- $GemLootAttempts+=1
- LootGems()
- EndIf
- EndFunc
- ;Checkfunctions
- Func CheckBagFull()
- $array = StringSplit($Items[5][0],"|")
- $file = $array[1]
- $accuracy = $array[2]
- $target = _ImageSearchArea($ImgDir & $file, 1, $FullArea[0], $FullArea[1], $FullArea[2], $FullArea[3], $ISx, $ISy, $accuracy)
- If $target = 1 Then
- $FullBag = True
- SellItems()
- EndIf
- EndFunc
- Func CheckForDisconnectState()
- $target = _ImageSearchArea($ImgDir & "network.png", 1, $NetworkCode[0], $NetworkCode[1], $NetworkCode[2], $NetworkCode[3], $ISx, $ISy, 10)
- if $target = 1 Then
- $Disconnects+=1
- $DisconnectState = 1
- MouseClick("LEFT", $NetworkCode[4], $NetworkCode[5], 1, 0)
- Sleep(3000 + $Computerlag)
- EndIf
- $target = _ImageSearchArea($ImgDir & "lost.png", 1, $NetworkCode[0], $NetworkCode[1], $NetworkCode[2], $NetworkCode[3], $ISx, $ISy, 10)
- if $target = 1 Then
- if $DisconnectState = 0 Then
- $Disconnects+=1
- EndIf
- $DisconnectState = 2
- MouseClick("LEFT", $NetworkCode[4], $NetworkCode[5], 1, 0)
- Sleep(3000 + $Computerlag)
- EndIf
- EndFunc
- Func CheckForDeath()
- $Death = PixelSearch($DeathBounds[0], $DeathBounds[0], $DeathBounds[0]+4, $DeathBounds[0]+4, 0xFFFFFF)
- if not @error Then
- ConsoleWrite("Died" & @LF)
- LeaveGame()
- Sleep(12000 + $Computerlag)
- return True
- Else
- return False
- EndIf
- EndFunc
- Func CheckForRepair()
- $RepairNeeded = PixelSearch($RepairCheck[0],$RepairCheck[1], $RepairCheck[0]+5, $RepairCheck[1]+5, 0xFFE801,10)
- if Not @error Then
- return True
- Else
- return False
- EndIf
- EndFunc
- Func InGameLobby()
- MouseMove($GameLobbyCode[0],$GameLobbyCode[1])
- Sleep(300 + $Computerlag)
- PixelSearch($GameLobbyCode[0],$GameLobbyCode[1],$GameLobbyCode[0]+10,$GameLobbyCode[1]+10, $GameLobbyCode[2], 10)
- if not @error Then
- return True
- Else
- return False
- EndIf
- EndFunc
- Func InGameplayScreen()
- PixelSearch($GameScreenCode[0],$GameScreenCode[1],$GameScreenCode[0]+4,$GameScreenCode[1]+3, $GameScreenCode[2], 10)
- if not @error Then
- return True
- Else
- return False
- EndIf
- EndFunc
- ;Actionfunctions
- Func Click($x, $y)
- MouseClick('left', $x, $y, 1, 0)
- Sleep(1250 + $Computerlag)
- EndFunc
- Func Move($x, $y)
- MouseClick('middle', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, 0)
- Sleep(1250 + $Computerlag)
- EndFunc
- Func Attack($x, $y)
- Send("{SHIFTDOWN}")
- MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, 0)
- Send("{SHIFTUP}")
- EndFunc
- Func AttackNearbyMonsters()
- while 1
- $MonsterData = PixelSearch($CharHitBox[0],$CharHitBox[1],$CharHitBox[2],$CharHitBox[3], 0xEE0000, 10)
- if @error Then
- ExitLoop
- EndIf
- send("{4}")
- Sleep(300 + $Computerlag)
- for $i = 10 To 0 step -1
- Attack($MonsterData[0], $MonsterData[1])
- Sleep(100 + $Computerlag)
- Next
- WEnd
- EndFunc
- Func RepairItems()
- if not CheckForRepair() Then
- Return
- EndIf
- Move($RepairCords[0][0] , $RepairCords[0][1])
- Sleep(2500 + $Computerlag)
- MouseMove($RepairCords[1][0] , $RepairCords[1][1], 0)
- Sleep(300 + $Computerlag)
- Click($RepairCords[1][0] , $RepairCords[1][1])
- Sleep(1250 + $Computerlag)
- Click($RepairCords[2][0] , $RepairCords[2][1])
- Sleep(500 + $Computerlag)
- Click($RepairCords[3][0] , $RepairCords[3][1])
- Sleep(250 + $Computerlag)
- Send("{ESC}")
- EndFunc
- Func SellItems()
- Sleep(500 + $Computerlag)
- Send("{t}")
- Sleep(7000 + $Computerlag)
- Move($RepairCords[0][0] , $RepairCords[0][1])
- Sleep(2000 + $Computerlag)
- MouseMove($RepairCords[1][0] , $RepairCords[1][1], 0)
- Sleep(300 + $Computerlag)
- Click($RepairCords[1][0] , $RepairCords[1][1])
- Sleep(1200 + $Computerlag)
- For $gI = 1 to 2
- $array = StringSplit($Items[5][$gI],"|")
- $file = $array[1]
- $accuracy = $array[2]
- for $i = 40 To 0 step -1
- $target = _ImageSearchArea($ImgDir & $file, 1, $SellArea[0], $SellArea[1], $SellArea[2], $SellArea[3], $ISx, $ISy, $accuracy)
- If $target = 1 Then
- $Sold+=1
- MouseClick("RIGHT", $ISx, $ISy, 1, 0)
- Sleep(200 + $Computerlag)
- EndIf
- Next
- Next
- $RareLootAttempts = 0
- $MagicLootAttempts = 0
- $TomeLootAttempts = 0
- $GemLootAttempts = 0
- Move($PortalCords[0][0] , $PortalCords[0][1])
- Sleep(1500 + $Computerlag)
- Move($PortalCords[1][0] , $PortalCords[1][1])
- Sleep(1000 + $Computerlag)
- MouseMove($PortalCords[2][0], $PortalCords[2][1], 0)
- Sleep(500 + $Computerlag)
- MouseClick("LEFT")
- Sleep(2000 + $Computerlag)
- EndFunc
- Func LeaveGame()
- $Runs+=1
- $Sek = Floor(TimerDiff($Timer) / 1000)
- $Min = Floor($Sek / 60)
- $Hour = Floor($Min / 60)
- $Runtime = $Hour & "h " & ($Min-$Hour*60) & "m " & ($Sek-$Min*60) & "s"
- If $ShowStatTooltip = True Then
- ToolTip("Start: " & $StartTime & " | Runs: " & $Runs & " | Closed: " & $Closed & " | Disconnects: " & $Disconnects & " | Runtime: " & $Runtime & " | Legendaries: " & $Legendaries & " | Sets: " & $Sets & " | Rares: " & $Rares & " | Magics: " & $Magics & " | Tomes: " & $Tomes & " | Gems: " & $Gems & " | Sold: " $Sold, 530, 0)
- EndIf
- send("{ESC}")
- Sleep(200 + $Computerlag)
- Click($Leave[0], $Leave[1])
- EndFunc
- ;Miscfunctions
- Func Pause()
- $Paused = Not $Paused
- While $Paused
- Sleep(100 + $Computerlag)
- ToolTip('Paused... Press {PAUSE} to continue...', 850, 0)
- WEnd
- If $ShowStatTooltip = True Then
- ToolTip("Start: " & $StartTime & " | Runs: " & $Runs & " | Closed: " & $Closed & " | Disconnects: " & $Disconnects & " | Runtime: " & $Runtime & " | Legendaries: " & $Legendaries & " | Sets: " & $Sets & " | Rares: " & $Rares & " | Magics: " & $Magics & " | Tomes: " & $Tomes & " | Gems: " & $Gems & " | Sold: " $Sold, 530, 0)
- Else
- ToolTip("")
- EndIf
- EndFunc
- Func Relog()
- MouseClick("LEFT", $PasswordLoc[0], $PasswordLoc[1], 1, 0)
- Send($Password)
- Sleep(1000 + $Computerlag)
- Send("{ENTER}")
- Sleep(8000 + $Computerlag)
- $DisconnectState = 0
- EndFunc
- Func Terminate()
- Exit 0
- EndFunc
- Func OnAutoItExit()
- If $Stats = True Then
- If $Runtime = "0h 0m 0s" Then
- Else
- $File = FileOpen ("statistics.txt", 1)
- FileWriteLine($File, "==========================")
- FileWriteLine($File, "Startime: " & @TAB & @TAB & $StartTime & @LF & "Runs: " & @TAB & @TAB & $Runs & @LF & "Closed: " & @TAB & @TAB & $Closed & @LF & "Runtime: " & @TAB & @TAB & $Runtime & @LF & "Endtime: " & @TAB & @TAB & @HOUR & ":" & @MIN & " Uhr" & @LF & @LF & "Legendaries: " & @TAB & $Legendaries & @LF & "Sets: " & @TAB & @TAB & $Sets & @LF & "Rares: " & @TAB & @TAB & $Rares & @LF & "Blues: " & @TAB & @TAB & $Magics & @LF & "Gems: " & @TAB & @TAB & $Gems & @LF & "Tomes: " & @TAB & @TAB & $Tomes & @LF)
- FileWriteLine($File, "==========================" & @LF & @LF)
- MsgBox(32, "Statistics", "Startime: " & @TAB & $StartTime & @LF & "Runs: " & @TAB & @TAB & $Runs & @LF & "Closed: " & @TAB & @TAB & $Closed & @LF & "Runtime: " & @TAB & $Runtime & @LF & "Endtime: " & @TAB & @HOUR & ":" & @MIN & " Uhr" & @LF & @LF & "Legendaries: " & @TAB & $Legendaries & @LF & "Sets: " & @TAB & @TAB & $Sets & @LF & "Rares: " & @TAB & @TAB & $Rares & @LF & "Blues: " & @TAB & @TAB & $Magics & @LF & "Gems: " & @TAB & @TAB & $Gems & @LF & "Tomes: " & @TAB & @TAB & $Tomes & @LF)
- EndIf
- EndIf
- EndFunc
- Func DrawLootArea()
- $hFullScreen = WinGetHandle("Program Manager")
- $hGUI = GUICreate("", $LootingAreaWidth + 2, $LootingAreaHeight + 2, $LootingArea[0], $LootingArea[1], $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TRANSPARENT))
- GuiSetBkColor(0xABCDEF)
- _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 0xA0)
- WinSetOnTop($hGUI, "", 1)
- GuiSetState()
- $hDC = _WinAPI_GetWindowDC($hGUI)
- $hPen = _WinAPI_CreatePen($PS_SOLID, 2, 0x0000FF)
- $obj_orig = _WinAPI_SelectObject($hDC, $hPen)
- $user32_dll = DllOpen("user32.dll")
- _WinAPI_DrawLine($hDC, 0, 1, $LootingAreaWidth, 0)
- _WinAPI_DrawLine($hDC, 1, 0, 0, $LootingAreaHeight)
- _WinAPI_DrawLine($hDC, $LootingAreaWidth, $LootingAreaHeight, $LootingAreaWidth, 0)
- _WinAPI_DrawLine($hDC, $LootingAreaWidth, $LootingAreaHeight, 0, $LootingAreaHeight)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment