Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.8.1
- Author: myName
- Script Function:
- Template AutoIt script.
- #ce ----------------------------------------------------------------------------
- ; Script Start - Add your code below here
- ; We need to require admin to interact with D3
- #RequireAdmin
- ; Colors of loot types
- $blue = 0x6969FF;
- $yellow = 0xFFFF00
- $green = 0x00FF00
- $legend = 0xFF8000
- $gem = 0x99bbff
- ; Config variables
- $pickupGem = IniRead("config.ini", "LootType", "Gems", True)
- $pickupYellow = IniRead("config.ini", "LootType", "Yellow", True)
- $pickupLegend = IniRead("config.ini", "LootType", "Legendary", True)
- $bossTimer = IniRead("config.ini", "Settings", "bossTimer", 8000) ;Time to wait before checking loots. May help if your character leaves before the end
- $instantLeave = IniRead("config.ini", "Settings", "instantLeave", True) ; Uses town portal to leave or not
- ; Window to scan for loots
- $lootX = 550
- $lootY = 150
- $endLootX = 1300
- $endLootY = 800
- WinActivate("Diablo III")
- Global $paused;
- Global $start = TimerInit()
- HotKeySet("{PAUSE}", "TogglePause")
- Global $state = "Init";
- Init();
- While 1
- StartGame()
- WEnd
- Func TogglePause ()
- $paused = NOT $paused
- while $paused
- sleep(10)
- WEnd
- EndFunc
- Func Init()
- EndFunc
- ; From the menu, creates a game
- Func StartGame ()
- $found = False
- while NOT $found
- ; Looks for the "play" button
- $coord = PixelSearch(340, 513, 341, 514, 0x290400, 20)
- If Not @error Then
- $found = true;
- Sleep(1500)
- MouseClick("left", 340, 513, 1, 50)
- Else
- Sleep(10);
- EndIf;
- WEnd
- $start = TimerInit()
- usePortal()
- EndFunc
- ; Use the portal to go to the boss
- Func usePortal()
- $found = false;
- while not $found
- ; Looks for the blue portal in town
- $coord = PixelSearch(25, 25, 25, 24, 0x22295C, 10)
- If Not @error Then
- $found = True
- Sleep(1500)
- MouseClick("left", 25, 25, 1, 10)
- Else
- Sleep(10)
- EndIf
- WEnd
- GoToBoss()
- EndFunc
- ; Goes to the boss room
- Func GoToBoss()
- Sleep(3000)
- $found = False
- while not $found
- ; Looks for the blue door
- $coord = PixelSearch(545, 178, 545, 178, 0x56A7F6, 30)
- If Not @error Then
- $found = True
- Sleep(1000)
- Else
- Sleep(10)
- EndIf
- WEnd
- LookForReflection()
- EndFunc
- ; Checks if there is a yellow xp bonus thing
- Func LookForReflection()
- ; Looks for the yellow liquid
- $coords = PixelSearch(1650, 700, 1850, 900, 0xE0AD1D, 20)
- If Not @error Then
- ; Go to it
- Sleep(1000)
- MouseClick("left", $coords[0], $coords[1], 1, 10)
- Sleep(3000) ; Wait a bit
- ;Searches back for the blue door
- $coordDoor = PixelSearch(70, 0, 551, 253, 0x4070D9, 50)
- If Not @error Then
- sleep(1000)
- MouseClick("left", $coordDoor[0], $coordDoor[1], 1, 10)
- EndIf
- Else
- MouseClick("left", 545, 178, 1, 10)
- EndIf
- StartBoss()
- EndFunc
- ; Go into position for the boss
- Func StartBoss()
- Sleep(1500)
- $found = False
- while not $found
- ; Looks for candles in the top left corner
- $coord = PixelSearch(50, 532, 50, 532, 0x504D2F, 30)
- If Not @error Then
- $found = True
- Sleep(500)
- ; Go at the bottom of the room
- MouseClick("left", 840, 915, 2, 20)
- Else
- sleep(10)
- EndIf
- WEnd
- BeatBoss()
- EndFunc
- ; Fights the boss
- Func BeatBoss()
- Sleep(2500) ; Waits for the player to arrive at the battle spot. Dont put this too low
- $dead = False
- ; Use some spells
- Send("1")
- Sleep(200)
- Send("2")
- Sleep(200)
- Send("3")
- Sleep(200)
- Send("4")
- MouseMove(940, 71)
- MouseDown("right")
- Sleep(200)
- sleep($bossTimer)
- while not $dead
- ; Looks for loots
- $coords = PixelSearch($lootX, $lootY, $endLootX, $endLootY, $legend, 1)
- If Not @error Then
- $dead = True
- MouseUp("right")
- MouseClick("left", $coords[0], $coords[1], 1, 10)
- Sleep(100)
- Else
- $coords = PixelSearch($lootX, $lootY, $endLootX, $endLootY, $blue, 0)
- If Not @error Then
- $dead = True
- MouseUp("right")
- Sleep(100)
- EndIf
- EndIf
- ; If nothing found (bug/dead/whatever), leaves the game after 60 seconds
- if TimerDiff($start) > 60000 Then
- $dead = True
- MouseUp("right")
- EndIf
- WEnd
- Loot()
- EndFunc
- ; Get every loot
- Func Loot()
- Sleep(2000)
- $nothingToFind = false
- while not $nothingToFind
- $nothingToFind = True
- if $pickupYellow Then
- if LootItem($yellow) Then
- $nothingToFind = false;
- EndIf;
- EndIf
- Sleep(200)
- If $pickupGem Then
- If LootItem($gem) Then
- $nothingToFind = false;
- EndIf
- EndIf
- Sleep(200)
- if $pickupLegend Then
- If LootItem($legend) Then
- $nothingToFind = False
- EndIf
- Sleep(200)
- If LootItem($green) Then
- $nothingToFind = False
- EndIf
- EndIf
- WEnd
- Sleep(500)
- LootGold()
- EndFunc
- Func LootGold ()
- Sleep(100)
- MouseClick("left", 811, 0, 1, 10)
- Sleep(1500)
- MouseClick("left", 1274, 745, 1, 10)
- Sleep(500)
- if $instantLeave Then
- tpTown()
- Else
- menuLeave()
- EndIf
- EndFunc
- ; Loot function
- Func LootItem ($color)
- $coords = PixelSearch($lootX, $lootY, $endLootX, $endLootY, $color, 0)
- If Not @error Then
- MouseClick("left", $coords[0], $coords[1], 1, 10)
- Sleep(1000)
- return True;
- Else
- return False;
- EndIf
- EndFunc
- ; Teleport back to town
- Func tpTown ()
- MouseClick("right", 675, 906, 1, 10)
- Send("T")
- Sleep(3000)
- LeaveGame()
- EndFunc
- ; Leaves the game with escape
- Func menuLeave()
- send ("{ESCAPE}")
- sleep(100)
- MouseClick("left", 340, 473, 1, 10)
- Sleep(3000)
- EndFunc
- ; Leaves the game with town portal
- Func LeaveGame ()
- $inTown = False
- while not $inTown
- ; Deects Lea's room in town
- $coords = PixelSearch(556, 267, 556, 267, 0xFCEE63, 30)
- If Not @error Then
- $inTown = True
- Else
- Sleep(10)
- EndIf
- WEnd
- send ("{ESCAPE}")
- sleep(100)
- MouseClick("left", 340, 473, 1, 10)
- Sleep(3000)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement