Advertisement
Guest User

witch doctor autoit 0.2 revision by cib

a guest
Jun 11th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 26.06 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("{3}")
  398.                      Sleep(200)
  399.                      Send("{2}")
  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.               #cs old looting gold path
  460.               Move(1206, 211)
  461.               sleep(Random(600, 700))
  462.               AttackNearbyMonsters()
  463.               Move(635, 415)
  464.               ;Move(555, 377)
  465.               sleep(Random(400, 500))
  466.               AttackNearbyMonsters()
  467.               Move(106, 1038)
  468.               sleep(Random(1200, 1300))
  469.               AttackNearbyMonsters()
  470.               Move(1334, 783)
  471.               sleep(Random(400, 500))
  472.               AttackNearbyMonsters()
  473.               Move(1117, 331)
  474.               ;Move(1068, 228)
  475.               sleep(Random(800, 900))
  476.               AttackNearbyMonsters()
  477.               #ce
  478.               sleep(300)
  479.  
  480.               Move(1145, 185)
  481.               sleep(1200)
  482.               Move(392, 572)
  483.               sleep(800)
  484.               Move(354, 932)
  485.               sleep(900)
  486.               Move(1493, 654)
  487.               sleep(800)
  488.               Move(969, 300)
  489.               sleep(600)
  490.               AttackNearbyMonsters()
  491.  
  492.               ToolTip("")
  493.  
  494.               ;Move($GoldLoot1[$R][0], $GoldLoot1[$R][1])   original looting gold path
  495.               ;Sleep(Random(800, 900))
  496.               ;AttackNearbyMonsters()
  497.               ;Move($GoldLoot2[$R][0], $GoldLoot2[$R][1])
  498.               ;Sleep(Random(400,500))
  499.               ;AttackNearbyMonsters()
  500.               ;Move($GoldLoot3[$R][0], $GoldLoot3[$R][1])
  501.               ;sleep(Random(400,500))
  502.               ;AttackNearbyMonsters()
  503.  
  504.               ;Loot items
  505.               Sleep(350)
  506.               Send("{k}")
  507.               Sleep(250)
  508.  
  509.               if $LootBlues then
  510.                      LootBlues()
  511.                      $LootAttemps = 0
  512.                  EndIf
  513.               if $LootRares then
  514.                      LootRares()
  515.                      $LootAttemps = 0
  516.                      ;LootLegendaries()
  517.                      ;$LootAttemps = 0
  518.                  EndIf
  519.               if $LootGems Then
  520.                      LootGems()
  521.                  EndIf
  522.  
  523.               ;Check to see if we died
  524.               if CheckForDeath() Then
  525.                      ContinueLoop
  526.               EndIf
  527.  
  528.  
  529.               ;Teleport to town
  530.               send("{t}")
  531.               sleep(8000)
  532.  
  533.               ;Repair if needed
  534.               if $Repair then
  535.                      RepairItems()
  536.               EndIf
  537.  
  538.               ;Leave the game
  539.               LeaveGame()
  540.               Sleep(1000)
  541.  
  542.        EndIf
  543.     WEnd
  544.  
  545.     Func CheckForRepair()
  546.        $RepairNeeded = PixelSearch($RepairCheck[$R][0],$RepairCheck[$R][1], $RepairCheck[$R][0]+5, $RepairCheck[$R][1]+5, 0xFFE801,10)
  547.  
  548.        if Not @error Then
  549.               return True
  550.        Else
  551.               return False
  552.        EndIf
  553.     EndFunc
  554.  
  555.  
  556.     Func RepairItems()
  557.        if not CheckForRepair() Then
  558.               Return
  559.        EndIf
  560.  
  561.        Move($RepairCords[$R][0][0] , $RepairCords[$R][0][1])
  562.        Sleep(2700+$ComputerLag)
  563.        MouseMove($RepairCords[$R][1][0] , $RepairCords[$R][1][1])
  564.        Sleep(400)
  565.        Click($RepairCords[$R][1][0] , $RepairCords[$R][1][1])
  566.        sleep(2200+$ComputerLag)
  567.        click($RepairCords[$R][2][0] , $RepairCords[$R][2][1])
  568.        Sleep(Random(700-900))
  569.        Click($RepairCords[$R][3][0] , $RepairCords[$R][3][1])
  570.        Sleep(500)
  571.        send("{esc}")
  572.  
  573.     EndFunc
  574.  
  575.  
  576.     Func LeaveGame()
  577.        send("{esc}")
  578.        Sleep(400)
  579.        Click($Leave[$R][0], $Leave[$R][1])
  580.     EndFunc
  581.  
  582.     Func Pause()
  583.        $Paused = Not $Paused
  584.        While $Paused
  585.           Sleep(100)
  586.           ToolTip('Paused...', 0, 0)
  587.        WEnd
  588.        ToolTip("")
  589.     EndFunc   ;
  590.  
  591.     Func Click($x, $y)
  592.        MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
  593.        Sleep(Random(1000, 1500))
  594.     EndFunc
  595.  
  596.     Func Move($x, $y)
  597.        MouseClick('middle', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
  598.        Sleep(Random(1000, 1500))
  599.     EndFunc
  600.  
  601.     Func Attack($x, $y)
  602.        MouseClick('right', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
  603.     EndFunc
  604.  
  605.     Func Rest($z)
  606.        Sleep(Random($z, $z+25))
  607.     EndFunc
  608.  
  609.     Func CheckForDeath()
  610.        $Death = PixelSearch($DeathBounds[$R][0], $DeathBounds[$R][0], $DeathBounds[$R][0]+4, $DeathBounds[$R][0]+4, 0xFFFFFF)
  611.        if not @error Then
  612.               ConsoleWrite("Died" & @LF)
  613.               LeaveGame()
  614.               Sleep(12000)
  615.               return True
  616.        Else
  617.               return False
  618.        EndIf
  619.     EndFunc
  620.  
  621.     Func LootBlues()
  622.         $LootAttempts=0
  623.         While ($LootAttempts < 3)
  624.             $lootpass = "LOOT BLUE PASS "
  625.             $lootpass &= $LootAttempts
  626.             ToolTip($lootpass, 0, 150)
  627.             Send("!")
  628.             Sleep(250)
  629.             $Blue = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0x6969FF, 2) ;
  630.             If not @error Then
  631.                 Click($Blue[0], $Blue[1])
  632.                 Sleep(Random(800,1000))
  633.             EndIf
  634.             $LootAttempts+=1
  635.        WEnd
  636.        ToolTip("")
  637.    EndFunc
  638.  
  639.  
  640.    Func LootRares()
  641.         $LootAttempts=0
  642.         While ($LootAttempts < 2)
  643.             $lootpass = "LOOT RARE PASS "
  644.             $lootpass &= $LootAttempts
  645.             ToolTip($lootpass, 0, 150)
  646.             Send("!")
  647.             Sleep(250)
  648.             $Rare = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0xFFFF00, 6) ;
  649.             If not @error Then
  650.                 Click($Rare[0], $Rare[1])
  651.                 Sleep(1600))
  652.             EndIf
  653.             $LootAttempts+=1
  654.        WEnd
  655.        ToolTip("")
  656.  
  657.        #cs          remove #cs and next #ce line to activate lengendary item loot , not tested no legend in hell :)
  658.        $LootAttempts=0
  659.         While ($LootAttempts < 2)
  660.             $lootpass = "LOOT LEGEND PASS "
  661.             $lootpass &= $LootAttempts
  662.             ToolTip($lootpass, 0, 150)
  663.             Send("!")
  664.             Sleep(250)
  665.             $Legendary = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0xBF642F, 2) ;
  666.             If not @error Then
  667.                 Click($Legendary[0], $Legendary[1])
  668.                 Sleep(1600)
  669.             EndIf
  670.             Send("!")
  671.             Sleep(250)
  672.             $set = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3], 0x02CE01, 2) ;
  673.             If not @error Then
  674.                 Click($set[0], $set[1])
  675.                 Sleep(1600))
  676.             EndIf
  677.             $LootAttempts+=1
  678.        WEnd
  679.        #ce
  680.  
  681.        ToolTip("")
  682.    EndFunc
  683.  
  684. #cs
  685.     Func LootLegendaries()   ; loot legend original function
  686.         ToolTip('Looting Legendaries...', 0, 150)
  687.        $Legendary = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],0xBF642F, 2) ;
  688.        If not @error Then
  689.               Click($Legendary[0], $Legendary[1])
  690.               Sleep(Random(800,1000))
  691.        EndIf
  692.  
  693.         $set = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][2], 0x02CE01, 2) ;
  694.             If not @error Then
  695.               Click($set[0], $set[1])
  696.               Sleep(Random(800,1000))
  697.        EndIf
  698.  
  699.        $LootAttempts+=1
  700.        if($LootAttempts > 3) then
  701.               Return
  702.        Else
  703.               LootRares()
  704.           EndIf
  705.           ToolTip("")
  706.     EndFunc
  707. #ce
  708.  
  709.     Func LootGems()
  710.         ToolTip('Looting Gems...', 0, 150)
  711.         Send("!")
  712.         Sleep(250)
  713.        $Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Ruby,5) ;
  714.        If not @error Then
  715.               Click($Gem[0], $Gem[1]-7)
  716.               Sleep(Random(500,900))
  717.           EndIf
  718.           Send("!")
  719.  
  720.        $Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Amethyst,5) ;
  721.        If not @error Then
  722.               Click($Gem[0], $Gem[1]-7)
  723.               Sleep(Random(500,900))
  724.        EndIf
  725.  
  726.        $Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Emerald,5) ;
  727.        If not @error Then
  728.               Click($Gem[0], $Gem[1]-7)
  729.               Sleep(Random(500,900))
  730.           EndIf
  731.           Send("!")
  732.  
  733.        $Gem = PixelSearch($LootingArea[$R][0], $LootingArea[$R][1], $LootingArea[$R][2], $LootingArea[$R][3],$Topaz,5) ;
  734.        If not @error Then
  735.               Click($Gem[0], $Gem[1]-7)
  736.               Sleep(Random(500,900))
  737.           EndIf
  738.           Send("!")
  739.  
  740.  
  741.        $GemLootAttempts+=1
  742.        if($GemLootAttempts > 1) then
  743.               Return
  744.        Else
  745.               LootGems()
  746.           EndIf
  747.           ToolTip("")
  748.     EndFunc
  749.  
  750.  
  751.  
  752.     Func AttackNearbyMonsters()
  753.        while 1
  754.               $MonsterData =  PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
  755.                      if @error Then
  756.                             ExitLoop
  757.                      EndIf
  758.  
  759.               send("{4}")
  760.               sleep(300)
  761.               for $i = 10 To 0 step -1
  762.                      Attack($MonsterData[0], $MonsterData[1])
  763.                      Sleep(100)
  764.               Next
  765.        WEnd
  766.     EndFunc
  767.  
  768.     Func CheckForNearbyMonsters()
  769.        $MonsterData =  PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
  770.        if @error Then
  771.               return False
  772.        Else
  773.                return True
  774.             EndIf
  775.      EndFunc
  776.  
  777.  
  778.     Func SnareNearbyEnemies()
  779.        $MonsterData =  PixelSearch($CharHitBox[$R][0],$CharHitBox[$R][1],$CharHitBox[$R][2],$CharHitBox[$R][3], 0xEE0000, 10)
  780.        if not @error Then
  781.                MouseMove($MonsterData[0], $MonsterData[1])
  782.                Sleep(350)
  783.                Send("{3}")
  784.                sleep(250)
  785.             EndIf
  786.      EndFunc
  787.  
  788.  
  789.      Func InGameLobby()
  790.             MouseMove($GameLobbyCode[$R][0],$GameLobbyCode[$R][1])
  791.             Sleep(300)
  792.             PixelSearch($GameLobbyCode[$R][0],$GameLobbyCode[$R][1],$GameLobbyCode[$R][0]+10,$GameLobbyCode[$R][1]+10, $GameLobbyCode[$R][2], 10)
  793.         if not @error Then
  794.                return True
  795.             Else
  796.                return False
  797.        EndIf
  798.     EndFunc
  799.  
  800.      Func InGameplayScreen()
  801.             PixelSearch($GameScreenCode[$R][0],$GameScreenCode[$R][1],$GameScreenCode[$R][0]+4,$GameScreenCode[$R][1]+3, $GameScreenCode[$R][2], 10)
  802.             if not @error Then
  803.                return True
  804.             Else
  805.                return False
  806.        EndIf
  807.     EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement