Advertisement
Guest User

Untitled

a guest
Jun 11th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 25.65 KB | None | 0 0
  1. #cs
  2.  
  3.     ADD detection of character screen and loading screen done
  4.  
  5.               Witch Doctor Cellar Farming Bot - Version 0.2 revision by cib, HELL VERSION TESTED
  6.               Developed by Avatar88343 @ Ownedcore
  7.  
  8.  
  9.               What it does:
  10.                             *This bot will travel to the cellar in Act 1, kill the mobs, collect the gold and items, and repair your gear.
  11.  
  12.               Instructions:
  13.                             1.) Bind your middle mouse button to Move (found in Key Bindings Option)
  14.                             1.a) Ensure T is bound to teleport to town
  15.                             1.b) Ensure ALT is bound to reveal items names
  16.                             1.c) Ensure that reveal items names option is set to display 10 sec
  17.                             2.) Set your build to this http://us.battle.net/d3/en/calculator/witch-doctor#ZhiTPU!VeW!abcZba
  18.                             3.) Set your game resolution to 1920x1080 (required)
  19.                             3.) Start Act 1, Quest 6 - Talk to Alaric
  20.                             4.) Hire the Scoundrel
  21.                             5.) Teleport to The Old Ruins using the waypoint and run left until you reach a checkpoint
  22.                             6.) Log out of the game
  23.                             7.) Press Space to start the bot! Space is used to pause and resume the bot
  24.                             8.) Press Z to turn off the bot
  25.  
  26.               NOTE:
  27.                             *1920 x 1080 is the only resolution currently supported (800x600 is not supported in this revision)
  28.                             *You must be running the game in Fullscreen Windoed mode
  29.                             *You may need to edit the values below the comments for better results
  30.  
  31.               FEATURES:
  32.                             *Automatic looting of Rare, Legendary, and Set items ( Revision: Legend implemented but not active and not tested because in hell )
  33.                             *Repairs Items when damaged
  34.                             *Detects death and responds accordingly
  35.                             *Able to detect
  36.                             *Randomization for increased safety
  37.                             *Added ability to find Cellar during bad runs
  38.                             *Loots Gems
  39.  
  40.               IN DEVELOPMENT:
  41.                             *Multi-resolution support (very soon)
  42.                             *Inventory check and stash use
  43.                             *Improved combat
  44.                             *Speed improvements
  45.                             *Multiple routes to improve safety
  46.                             *45 min timeout bug
  47.                             *Pickup blues
  48.                             *edit d3config
  49.  
  50.  
  51.               **Based on the code by notAres and mackus101. Special thanks to them!
  52.     #ce
  53.  
  54.     ;======EDIT THESE VALUES ACCORDINLY ===================================
  55.     $R                              = 0                             ;0 for 1920x1080, 1 for
  56.     $ComputerLag    = 1100                  ;Increase this by 100-5000 if you have a slow PC. Gently tune it down until timings are right
  57.     $LootRares              = True                  ;Whether or not to loot only rare items
  58.     $LootBlues              = False                 ;currently supported
  59.     $Repair                 = True                  ;Orders the bot to repair when items are damaged
  60.     $LootGems               = True
  61.     $UseStash               = False                 ;Not currently supported
  62.     ;======================================================================
  63.  
  64.     Global $Resume[2][2]                    ;Location of the Resume Button
  65.     Global $Leave[2][2]                             ;Location of the in-game leave button
  66.     Global $GameLobbyCode[2][3]     ;Contains X, Y, and Hex color of Resume button so we can see if we're there
  67.     Global $GameScreenCode[2][3]    ;Contains X, Y, and Hex color used to check if we are in an unpaused game
  68.     Global $Loc1[2][2]                              ;First movement
  69.     Global $Loc2[2][2]                              ;Second movement
  70.     Global $Loc3[2][2]                              ;Third movement ttt
  71.  
  72.     Global $CellarLocation[2][2]    ;Cellar door location
  73.     Global $CellarLocation2[2][2]   ;Location of cellar during bad runs (ugly workaround for now)
  74.     Global $AltCellar = False
  75.  
  76.     Global $Loc5[2][2]                              ;Cellar hallway
  77.     Global $Loc6[2][2]                              ;Cellar doorway
  78.     Global $MonsterLoc[2][2]                ;Initial boss location
  79.     Global $MonsterSearch[2][4]             ;Bounds of where we will find our monsters
  80.     Global $GoldLoot1[2][2]                 ;First place to run when looting
  81.     Global $GoldLoot2[2][2]                 ;Second place to run when looting
  82.     Global $GoldLoot3[2][2]                 ;Third place to run when looting
  83.     Global $LootingArea[2][4]               ; looting bounds (TL X, TL Y, BR X, BR Y)
  84.     Global $CharHitBox[2][4]                ; Hitbox around user's character
  85.     Global $DeathBounds[2][2]               ; Used to detect the "You Have Died" text
  86.     Global $RepairCheck[2][2]               ; Used to check for repair icon
  87.     Global $RepairCords[2][4][2]    ; Four clicks needed to repair
  88.     Global $CellarOffset[2]
  89.     ;Global $MonsterData[2]
  90.  
  91.     ;All locations are N dimensional arrays. [0][x] is for 1080P and [1][x] is for 800x600
  92.     ;1080P
  93.     $Resume[0][0] = 319
  94.     $Resume[0][1] = 416
  95.     $GameLobbyCode[0][0] = 319
  96.     $GameLobbyCode[0][1] = 416
  97.     $GameLobbyCode[0][2] = 4065536 ;dec
  98.     $GameScreenCode[0][0] = 1119
  99.     $GameScreenCode[0][1] = 1044
  100.     $GameScreenCode[0][2] = 0xDEFDFE
  101.  
  102.     ;800x600
  103.     $Resume[1][0] = 142
  104.     $Resume[1][1] = 251
  105.     $GameLobbyCode[1][0] = 0                        ;Undefined
  106.     $GameLobbyCode[1][1] = 0
  107.     $GameLobbyCode[1][2] = 0
  108.     $GameScreenCode[1][0] = 0
  109.     $GameScreenCode[1][1] = 0
  110.     $GameScreenCode[1][2] = 0
  111.  
  112.     ;1080P
  113.     $Leave[0][0] = 1042
  114.     $Leave[0][1] = 582
  115.  
  116.     ;800x600
  117.     $Leave[1][0] = 400
  118.     $Leave[1][1] = 342
  119.  
  120.     ;1920x1080
  121.     $Loc1[0][0]             = 500           ;First movement
  122.     $loc1[0][1]             = 250
  123.     $loc2[0][0]             = 1                     ;Second movement
  124.     $loc2[0][1]             = 370
  125.     $loc3[0][0]             = 400           ;Third Movement
  126.     $loc3[0][1]             = 600
  127.  
  128.     ;800x600
  129.     $Loc1[1][0]             = 8                     ;First movement
  130.     $loc1[1][1]             = 146
  131.     $loc2[1][0]             = 7                     ;Second movement
  132.     $loc2[1][1]             = 300
  133.     $loc3[1][0]             = 8                     ;Third Movement
  134.     $loc3[1][1]             = 300
  135.  
  136.     ;1080P
  137.     $CellarLocation[0][0] = 307             ;Cellar door location
  138.     $CellarLocation[0][1] = 74
  139.     ;800x600
  140.     $CellarLocation[1][0] = 38              ;Cellar door location
  141.     $CellarLocation[1][1] = 98
  142.     $CellarLocation2[1][0] = 10             ;Location of cellar during bad runs
  143.     $CellarLocation2[1][1] = 34
  144.  
  145.     $CellarOffset[0] = 33;
  146.     $CellarOffset[1] = 14;
  147.  
  148.     ;1080P
  149.     $loc5[0][0]             = 116           ;Walk down hallway
  150.     $loc5[0][1]             = 986
  151.     $loc6[0][0]             = 740           ;enter hallway
  152.     $loc6[0][1]             = 295
  153.     ;$loc6[0][0]             = 776           ;enter hallway
  154.     ;$loc6[0][1]             = 328
  155.     ;800x600
  156.     $loc5[1][0]             = 3                     ;Walk down hallway
  157.     $loc5[1][1]             = 504
  158.     $loc6[1][0]             = 255           ;enter hallway
  159.     $loc6[1][1]             = 190
  160.  
  161.     ;1080P
  162.     $MonsterLoc[0][0] =     590
  163.     $MonsterLoc[0][1] =     261
  164.     ;800x600
  165.     $MonsterLoc[1][0] =     188
  166.     $MonsterLoc[1][1] =     111
  167.  
  168.     ;1920x1080
  169.     $MonsterSearch[0][0] = 10
  170.     $MonsterSearch[0][1] = 90
  171.     $MonsterSearch[0][2] = 1500
  172.     $MonsterSearch[0][3] = 750
  173.     ;800x600
  174.     $MonsterSearch[1][0] = 40
  175.     $MonsterSearch[1][1] = 53
  176.     $MonsterSearch[1][2] = 424
  177.     $MonsterSearch[1][3] = 191
  178.  
  179.     ;1920x1080
  180.     $GoldLoot1[0][0] = 402
  181.     $GoldLoot1[0][1] = 306
  182.     $GoldLoot2[0][0] = 1260
  183.     $GoldLoot2[0][1] = 351
  184.     $GoldLoot3[0][0] = 911
  185.     $GoldLoot3[0][1] = 694
  186.     ;800x600
  187.     $GoldLoot1[1][0] = 96
  188.     $GoldLoot1[1][1] = 181
  189.     $GoldLoot2[1][0] = 560
  190.     $GoldLoot2[1][1] = 191
  191.     $GoldLoot3[1][0] = 349
  192.     $GoldLoot3[1][1] = 418
  193.  
  194.     ;1080P
  195.     $LootingArea[0][0] = 15
  196.     $LootingArea[0][1] = 20
  197.     $LootingArea[0][2] = 1550
  198.     $LootingArea[0][3] = 890
  199.     ;800x600
  200.     $LootingArea[1][0] = 75
  201.     $LootingArea[1][1] = 90
  202.     $LootingArea[1][2] = 630
  203.     $LootingArea[1][3] = 360
  204.  
  205.     ;1080P
  206.     $CharHitBox[0][0] = 790
  207.     $CharHitBox[0][1] = 315
  208.     $CharHitBox[0][2] = 1200
  209.     $CharHitBox[0][3] = 730
  210.     ;800x600
  211.     $CharHitBox[1][0] = 304
  212.     $CharHitBox[1][1] = 190
  213.     $CharHitBox[1][2] = 468
  214.     $CharHitBox[1][3] = 323
  215.  
  216.     ;1080P (NOT DONEEEEEEEEEEEEE)
  217.     $DeathBounds[0][0] = 538
  218.     $DeathBounds[0][1] = 335
  219.     ;800x600
  220.     $DeathBounds[1][0] = 210
  221.     $DeathBounds[1][1] = 180
  222.  
  223.     ;1080P
  224.     $RepairCords[0][0][0] = 1690
  225.     $RepairCords[0][0][1] = 102
  226.     $RepairCords[0][1][0] = 930
  227.     $RepairCords[0][1][1] = 136
  228.     $RepairCords[0][2][0] = 517
  229.     $RepairCords[0][2][1] = 483
  230.     $RepairCords[0][3][0] = 223
  231.     $RepairCords[0][3][1] = 592
  232.     ;800x600
  233.     $RepairCords[1][0][0] = 691
  234.     $RepairCords[1][0][1] = 88
  235.     $RepairCords[1][1][0] = 505
  236.     $RepairCords[1][1][1] = 52
  237.     $RepairCords[1][2][0] = 282
  238.     $RepairCords[1][2][1] = 261
  239.     $RepairCords[1][3][0] = 157
  240.     $RepairCords[1][3][1] = 329
  241.  
  242.     ;1080P
  243.     $RepairCheck[0][0] = 1507
  244.     $RepairCheck[0][1] = 36
  245.     ;800x600
  246.     $RepairCheck[1][0] = 573
  247.     $RepairCheck[1][1] = 21
  248.  
  249.     $Amethyst = 0xE7A7FD
  250.     $Ruby = 0xFF8E7E
  251.     $Emerald = 0x36FD30
  252.     $Topaz = 0xFFFF3B
  253.  
  254.  
  255.     HotKeySet("z", "Terminate")
  256.     HotKeySet("w","InGameplayScreen")
  257.     HotKeySet("p","Pause")
  258.  
  259.     Func Terminate()
  260.         Exit 0
  261.      EndFunc
  262.  
  263.     Opt('MouseCoordMode', 2)
  264.     Opt('PixelCoordMode', 2)
  265.     HotKeySet('{SPACE}', 'Pause')
  266.     Global $Paused
  267.  
  268.     ;bot starts paused. press space to start.
  269.     Pause()
  270.  
  271.     $LootAttempts = 0
  272.     $GemLootAttempts = 0
  273.  
  274.     WinActivate('Diablo III')
  275.     While 1
  276.        If WinActive('Diablo III') Then
  277.  
  278.               $AltCellar = False
  279.               $LootAttempts = 0
  280.               $GemLootAttempts = 0
  281.               $Whatoloot = "OPTIONS : "
  282.               ToolTip ( $Whatoloot, 10, 100 )
  283.  
  284.               if $LootBlues then
  285.  
  286.                      $Whatoloot &= "BLUE "
  287.                  EndIf
  288.               if $LootRares then
  289.                      $Whatoloot &= "RARE "
  290.                  EndIf
  291.               if $LootGems Then
  292.                       $Whatoloot &= "GEMS "
  293.                   EndIf
  294.                   if $Repair Then
  295.                       $Whatoloot &= "REPAIR "
  296.                   EndIf
  297.                   ToolTip ( $Whatoloot, 10, 100 )
  298.  
  299.  
  300.  
  301.  
  302.  
  303.               ;Make sure that we are in the character selection screen ( we are looking at a spot in the Resume game button)
  304.               for $i = 12 To 0 step -1
  305.                      if InGameLobby() Then
  306.                             ExitLoop
  307.                      EndIf
  308.  
  309.                      sleep(600)
  310.                      if $i == 1 Then
  311.                             MsgBox(4096, "Error Resuming Game", "You don't seem to be in the lobby. Bot will now exit", 50)
  312.                             Terminate()
  313.                      EndIf
  314.               Next
  315.  
  316.                ;Resume the game
  317.           Click($Resume[$R][0], $Resume[$R][1])
  318.  
  319.                ;Make sure that we are in the game
  320.               for $i = 12 To 0 step -1
  321.                      if InGameplayScreen() Then
  322.                             ExitLoop
  323.                      EndIf
  324.  
  325.                      sleep(1000)
  326.                      if $i == 1 Then
  327.                             MsgBox(4096, "Error Starting the Game", "The game did not properly load...", 50)
  328.                             Terminate()
  329.                      EndIf
  330.               Next
  331.  
  332.  
  333.               ;Get close to the cellar
  334.               Sleep(500)
  335.               Move($Loc1[$R][0], $Loc1[$R][1])
  336.               Sleep(400)
  337.               Send("{4}")
  338.               Sleep(700)
  339.               if $R > 0 Then
  340.                      sleep(500)
  341.               EndIf
  342.               Move($Loc2[$R][0], $Loc2[$R][1])
  343.               Sleep(1100)
  344.               Move($Loc3[$R][0], $Loc3[$R][1])
  345.  
  346.  
  347.               ;Check to see if it's there
  348.               MouseMove($CellarLocation[$R][0], $CellarLocation[$R][1])
  349.               Sleep(700)
  350.               $CellarPixel = PixelSearch($CellarLocation[$R][0]-$CellarOffset[$R], $CellarLocation[$R][1]-$CellarOffset[$R],$CellarLocation[$R][0]+4,$CellarLocation[$R][1]+4, 0x334FB7,8)
  351.  
  352.               ;Sometimes the 800x600 path gets buggy and we need to adjust...
  353.               if @error AND $R > 0 Then
  354.                      MouseMove($CellarLocation2[$R][0],$CellarLocation2[$R][1])
  355.                      Sleep(350)
  356.                      $CellarPixel = PixelSearch(6, 18,9,23, 0x334FB7,6)
  357.                      if not @error Then
  358.                             $AltCellar = True
  359.                      EndIf
  360.               EndIf
  361.  
  362.  
  363.               ;Leave the game if the Cellar is not there
  364.               if @error Then
  365.                      Send("{3}")
  366.                      Sleep(200)
  367.                      Send("{2}")
  368.                      Sleep(200)
  369.                      ConsoleWrite("Did not find the cellar " & @LF)
  370.                      SnareNearbyEnemies()
  371.                      leaveGame()
  372.                      Sleep(12000)
  373.                      ContinueLoop
  374.               EndIf
  375.  
  376.               ;Enter the cellar
  377.               ConsoleWrite("Found the cellar" & @LF)
  378.              ; if not $AltCellar Then
  379.  
  380.               if $R > 0 AND $AltCellar Then
  381.                      Click($CellarLocation2[$R][0] - 4, $CellarLocation2[$R][1] - 4)
  382.               Else
  383.                      Click($CellarLocation[$R][0], $CellarLocation[$R][1])
  384.               endif
  385.               ;else
  386.                     ; Click($CellarLocation2[$R][0], $CellarLocation2[$R][1])
  387.               ;EndIf
  388.               Sleep(2500 + $ComputerLag)
  389.  
  390.                ;Check to see if we died
  391.               if CheckForDeath() Then
  392.                      ContinueLoop
  393.               EndIf
  394.  
  395.               ;Inside the celler now - Move to the doorway and summon minions
  396.  
  397.               Send("{2}")
  398.                      Sleep(200)
  399.                      Send("{3}")
  400.                      Sleep(600)
  401.               Move($Loc5[$R][0], $Loc5[$R][1])
  402.               Sleep(1700)
  403.               Move($Loc6[$R][0], $Loc6[$R][1])
  404.               Sleep(300)
  405.  
  406.  
  407.               ;Cast spell 1 on the pack
  408.               MouseMove(611, 247)
  409.               Send ("{SHIFTDOWN}")
  410.               Sleep(150)
  411.               MouseClick("left")
  412.               Sleep(50)
  413.               Send ("{SHIFTUP}")
  414.               MouseMove(611, 247)
  415.               Sleep(150)
  416.               Send("{1}")
  417.               Sleep(500)
  418.               Send("{1}")
  419.               Sleep(500)
  420.               Send("{1}")
  421.               Sleep(500)
  422.               Send("{4}")
  423.               Sleep(250)
  424.  
  425.               ;Kill all the enemies inside
  426.               while 1
  427.  
  428.                      $MonsterBar =  PixelSearch($MonsterSearch[$R][0], $MonsterSearch[$R][1], $MonsterSearch[$R][2], $MonsterSearch[$R][3], 0xEE0000, 10)
  429.                      if @error Then
  430.                             ConsoleWrite("Didn't find any, attacking to discover potential enemies" & @LF)
  431.                             Attack($MonsterLoc[$R][0],$MonsterLoc[$R][1])
  432.                             sleep(500)
  433.                             Attack($MonsterLoc[$R][0]-20,$MonsterLoc[$R][1]-10)
  434.                             sleep(500)
  435.                             Attack($MonsterLoc[$R][0]+30,$MonsterLoc[$R][1]+10)
  436.                             Sleep(400)
  437.                             $MonsterBar =  PixelSearch($MonsterSearch[$R][0], $MonsterSearch[$R][1], $MonsterSearch[$R][2], $MonsterSearch[$R][3], 0xEE0000, 10)
  438.                             if @error Then
  439.                                ConsoleWrite("No monsters found - Moving on")
  440.                                ExitLoop
  441.                             EndIf
  442.                      EndIf
  443.  
  444.                      ;if CheckForNearbyMonsters() Then
  445.                             ;send("{4}")
  446.                      ;EndIf
  447.  
  448.                      for $i = 7 To 0 step -1
  449.                             Attack($MonsterBar[0], $MonsterBar[1])
  450.                             Sleep(100)
  451.                       Next
  452.                   WEnd
  453.  
  454.  
  455.               ToolTip('Looting Gold...', 0, 150)
  456.  
  457.               ;Loot the gold and attack anything we missed
  458.  
  459.  
  460.               sleep(300)
  461. #cs OLD
  462.               Move(1145, 185)
  463.               sleep(1200)
  464.               Move(392, 572)
  465.               sleep(800)
  466.               Move(354, 932)
  467.               sleep(900)
  468.               Move(1493, 654)
  469.               sleep(800)
  470.               Move(969, 300)
  471.               sleep(600)
  472. #ce
  473.               Move(437, 338)
  474.               Sleep(900)
  475.               Move(1322, 315)
  476.               Sleep(500)
  477.               Move(838, 762)
  478.               Sleep(500)
  479.  
  480.               AttackNearbyMonsters()
  481.  
  482.               ToolTip("")
  483.  
  484.               ;Move($GoldLoot1[$R][0], $GoldLoot1[$R][1])   original looting gold path
  485.               ;Sleep(Random(800, 900))
  486.               ;AttackNearbyMonsters()
  487.               ;Move($GoldLoot2[$R][0], $GoldLoot2[$R][1])
  488.               ;Sleep(Random(400,500))
  489.               ;AttackNearbyMonsters()
  490.               ;Move($GoldLoot3[$R][0], $GoldLoot3[$R][1])
  491.               ;sleep(Random(400,500))
  492.               ;AttackNearbyMonsters()
  493.  
  494.               ;Loot items
  495.               Sleep(350)
  496.               Send("{k}")
  497.               Sleep(250)
  498.  
  499.               if $LootBlues then
  500.                      LootBlues()
  501.                      $LootAttemps = 0
  502.                  EndIf
  503.               if $LootRares then
  504.                      LootRares()
  505.                      $LootAttemps = 0
  506.                      ;LootLegendaries()
  507.                      ;$LootAttemps = 0
  508.                  EndIf
  509.               if $LootGems Then
  510.                      LootGems()
  511.                  EndIf
  512.  
  513.               ;Check to see if we died
  514.               if CheckForDeath() Then
  515.                      ContinueLoop
  516.               EndIf
  517.  
  518.  
  519.               ;Teleport to town
  520.               send("{t}")
  521.               sleep(8000)
  522.  
  523.               ;Repair if needed
  524.               if $Repair then
  525.                      RepairItems()
  526.               EndIf
  527.  
  528.               ;Leave the game
  529.               LeaveGame()
  530.               Sleep(1000)
  531.  
  532.        EndIf
  533.     WEnd
  534.  
  535.     Func CheckForRepair()
  536.        $RepairNeeded = PixelSearch($RepairCheck[$R][0],$RepairCheck[$R][1], $RepairCheck[$R][0]+5, $RepairCheck[$R][1]+5, 0xFFE801,10)
  537.  
  538.        if Not @error Then
  539.               return True
  540.        Else
  541.               return False
  542.        EndIf
  543.     EndFunc
  544.  
  545.  
  546.     Func RepairItems()
  547.        if not CheckForRepair() Then
  548.               Return
  549.        EndIf
  550.  
  551.        Move($RepairCords[$R][0][0] , $RepairCords[$R][0][1])
  552.        Sleep(2700+$ComputerLag)
  553.        MouseMove($RepairCords[$R][1][0] , $RepairCords[$R][1][1])
  554.        Sleep(400)
  555.        Click($RepairCords[$R][1][0] , $RepairCords[$R][1][1])
  556.        sleep(2200+$ComputerLag)
  557.        click($RepairCords[$R][2][0] , $RepairCords[$R][2][1])
  558.        Sleep(Random(700-900))
  559.        Click($RepairCords[$R][3][0] , $RepairCords[$R][3][1])
  560.        Sleep(500)
  561.        send("{esc}")
  562.  
  563.     EndFunc
  564.  
  565.  
  566.     Func LeaveGame()
  567.        send("{esc}")
  568.        Sleep(400)
  569.        Click($Leave[$R][0], $Leave[$R][1])
  570.     EndFunc
  571.  
  572.     Func Pause()
  573.        $Paused = Not $Paused
  574.        While $Paused
  575.           Sleep(100)
  576.           ToolTip('Paused...', 0, 0)
  577.        WEnd
  578.        ToolTip("")
  579.     EndFunc   ;
  580.  
  581.     Func Click($x, $y)
  582.        MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
  583.        Sleep(Random(1000, 1500))
  584.     EndFunc
  585.  
  586.     Func Move($x, $y)
  587.        MouseClick('middle', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
  588.        Sleep(Random(1000, 1500))
  589.     EndFunc
  590.  
  591.     Func Attack($x, $y)
  592.        MouseClick('right', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
  593.     EndFunc
  594.  
  595.     Func Rest($z)
  596.        Sleep(Random($z, $z+25))
  597.     EndFunc
  598.  
  599.     Func CheckForDeath()
  600.        $Death = PixelSearch($DeathBounds[$R][0], $DeathBounds[$R][0], $DeathBounds[$R][0]+4, $DeathBounds[$R][0]+4, 0xFFFFFF)
  601.        if not @error Then
  602.               ConsoleWrite("Died" & @LF)
  603.               LeaveGame()
  604.               Sleep(12000)
  605.               return True
  606.        Else
  607.               return False
  608.        EndIf
  609.     EndFunc
  610.  
  611.     Func LootBlues()
  612.         $LootAttempts=0
  613.         While ($LootAttempts < 3)
  614.             $lootpass = "LOOT BLUE PASS "
  615.             $lootpass &= $LootAttempts
  616.             ToolTip($lootpass, 0, 150)
  617.             Send("!")
  618.             Sleep(250)
  619.             $Blue = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0x6969FF, 2) ;
  620.             If not @error Then
  621.                 Click($Blue[0], $Blue[1])
  622.                 Sleep(Random(800,1000))
  623.             EndIf
  624.             $LootAttempts+=1
  625.        WEnd
  626.        ToolTip("")
  627.    EndFunc
  628.  
  629.  
  630.    Func LootRares()
  631.         $LootAttempts=0
  632.         While ($LootAttempts < 2)
  633.             $lootpass = "LOOT RARE PASS "
  634.             $lootpass &= $LootAttempts
  635.             ToolTip($lootpass, 0, 150)
  636.             Send("!")
  637.             Sleep(250)
  638.             $Rare = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0xFFFF00, 6) ;
  639.             If not @error Then
  640.                 Click($Rare[0], $Rare[1])
  641.                 Sleep(1600))
  642.             EndIf
  643.             $LootAttempts+=1
  644.        WEnd
  645.        ToolTip("")
  646.  
  647.        #cs          remove cs and next ce line to activate lengendary item loot , not tested no legend in hell
  648.        $LootAttempts=0
  649.         While ($LootAttempts < 2)
  650.             $lootpass = "LOOT LEGEND PASS "
  651.             $lootpass &= $LootAttempts
  652.             ToolTip($lootpass, 0, 150)
  653.             Send("!")
  654.             Sleep(250)
  655.             $Legendary = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0xBF642F, 2) ;
  656.             If not @error Then
  657.                 Click($Legendary[0], $Legendary[1])
  658.                 Sleep(1600)
  659.             EndIf
  660.             Send("!")
  661.             Sleep(250)
  662.             $set = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0x02CE01, 2) ;
  663.             If not @error Then
  664.                 Click($set[0], $set[1])
  665.                 Sleep(1600))
  666.             EndIf
  667.             $LootAttempts+=1
  668.        WEnd
  669.        #ce
  670.  
  671.        ToolTip("")
  672.    EndFunc
  673.  
  674. #cs
  675.     Func LootLegendaries()   ; loot legend original function
  676.         ToolTip('Looting Legendaries...', 0, 150)
  677.        $Legendary = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],0xBF642F, 2) ;
  678.        If not @error Then
  679.               Click($Legendary[0], $Legendary[1])
  680.               Sleep(Random(800,1000))
  681.        EndIf
  682.  
  683.         $set = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][2], 0x02CE01, 2) ;
  684.             If not @error Then
  685.               Click($set[0], $set[1])
  686.               Sleep(Random(800,1000))
  687.        EndIf
  688.  
  689.        $LootAttempts+=1
  690.        if($LootAttempts > 3) then
  691.               Return
  692.        Else
  693.               LootRares()
  694.           EndIf
  695.           ToolTip("")
  696.     EndFunc
  697. #ce
  698.  
  699.     Func LootGems()
  700.         ToolTip('Looting Gems...', 0, 150)
  701.         Send("!")
  702.         Sleep(250)
  703.        $Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Ruby,5) ;
  704.        If not @error Then
  705.               Click($Gem[0], $Gem[1]-7)
  706.               Sleep(Random(500,900))
  707.           EndIf
  708.           Send("!")
  709.  
  710.        $Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Amethyst,5) ;
  711.        If not @error Then
  712.               Click($Gem[0], $Gem[1]-7)
  713.               Sleep(Random(500,900))
  714.        EndIf
  715.  
  716.        $Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Emerald,5) ;
  717.        If not @error Then
  718.               Click($Gem[0], $Gem[1]-7)
  719.               Sleep(Random(500,900))
  720.           EndIf
  721.           Send("!")
  722.  
  723.        $Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Topaz,5) ;
  724.        If not @error Then
  725.               Click($Gem[0], $Gem[1]-7)
  726.               Sleep(Random(500,900))
  727.           EndIf
  728.           Send("!")
  729.  
  730.  
  731.        $GemLootAttempts+=1
  732.        if($GemLootAttempts > 1) then
  733.               Return
  734.        Else
  735.               LootGems()
  736.           EndIf
  737.           ToolTip("")
  738.     EndFunc
  739.  
  740.  
  741.  
  742.     Func AttackNearbyMonsters()
  743.        while 1
  744.               $MonsterData =  PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
  745.                      if @error Then
  746.                             ExitLoop
  747.                      EndIf
  748.  
  749.               send("{4}")
  750.               sleep(300)
  751.               for $i = 10 To 0 step -1
  752.                      Attack($MonsterData[0], $MonsterData[1])
  753.                      Sleep(100)
  754.               Next
  755.        WEnd
  756.     EndFunc
  757.  
  758.     Func CheckForNearbyMonsters()
  759.        $MonsterData =  PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
  760.        if @error Then
  761.               return False
  762.        Else
  763.                return True
  764.             EndIf
  765.      EndFunc
  766.  
  767.  
  768.     Func SnareNearbyEnemies()
  769.        $MonsterData =  PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
  770.        if not @error Then
  771.                MouseMove($MonsterData[0], $MonsterData[1])
  772.                Sleep(350)
  773.                Send("{3}")
  774.                sleep(250)
  775.             EndIf
  776.      EndFunc
  777.  
  778.  
  779.      Func InGameLobby()
  780.             MouseMove($GameLobbyCode[$R][0],$GameLobbyCode[$R][1])
  781.             Sleep(300)
  782.             PixelSearch($GameLobbyCode[$R][0],$GameLobbyCode[$R][1],$GameLobbyCode[$R][0]+10,$GameLobbyCode[$R][1]+10, $GameLobbyCode[$R][2], 10)
  783.         if not @error Then
  784.                return True
  785.             Else
  786.                return False
  787.        EndIf
  788.     EndFunc
  789.  
  790.      Func InGameplayScreen()
  791.             PixelSearch($GameScreenCode[$R][0],$GameScreenCode[$R][1],$GameScreenCode[$R][0]+4,$GameScreenCode[$R][1]+3, $GameScreenCode[$R][2], 10)
  792.             if not @error Then
  793.                return True
  794.             Else
  795.                return False
  796.        EndIf
  797.     EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement