Advertisement
zEEneXx

farming_sarkoth_dank_cellar_wd_1.1f_zeenexx

Jun 22nd, 2012
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 46.32 KB | None | 0 0
  1. #include <WindowsConstants.au3>
  2. #include <Misc.au3>
  3. #include <WinAPI.au3>
  4. #include <StaticConstants.au3>
  5. #include <GuiListBox.au3>
  6. #include <ScrollBarConstants.au3>
  7. #include <Array.au3>
  8.  
  9. Initialize()
  10.  
  11. #cs
  12.  
  13.    [Gold/Itemfarming] [AutoIt] Sarkoth Act I Dank Cellar [WD] [Stash, Sell, Repair, +++]
  14.                                     by zEEneXx
  15.                                  
  16.                                   Version: 1.1f
  17.                                
  18.                                  www.ownedcore.com
  19.                  
  20. #ce
  21.  
  22.  
  23. ;///////////////////////////////////////--CONFIG--////////////////////////////////////////////////////////////////////////////////////
  24. ;                                                                                                                                   //
  25. ;                                       Important                                                                                   //
  26. $ComputerLag            = 0                                         ;Increase this in steps of 200 if you have a slow computer      //
  27. $MoveDelay              = 0                                         ;Increase this in steps of 100 if you have movement issues      //
  28. $LootDelay              = 0                                         ;Increase this in steps of 200 if you have looting issues       //
  29. $ImgDir                 = "C:\Program Files (x86)\AutoIt3\pics\"    ;Location of the image folder                                   //
  30. ;                                                                                                                                   //
  31. ;                                       Functions                                                                                   //
  32. $Repair                 = True                                      ;Orders the bot to repair when items are damaged                //
  33. $Sell                   = True                                      ;Orders the bot to sell magic items when bag is full            //
  34. $UseStash               = True                                      ;Orders the bot to put gems and rare items into the stash       //
  35. $HighGoldRadius         = False                                     ;Set this to true if you have more than +18 gold radius         //
  36. ;                                                                                                                                   //
  37. ;                                     Miscellaneous                                                                                 //
  38. $Sounds                 = True                                      ;Enable pickup sounds                                           //
  39. $SoundsDir              = "C:\Program Files (x86)\AutoIt3\sounds\"  ;Location of the sounds folder                                  //
  40. $ShowLootArea           = True                                      ;Shows lootarea                                                 //
  41. $ShowLog                = True                                      ;Shows log overlay                                              //
  42. $SaveStats              = True                                      ;Saves current statistics to a *.txt file                       //
  43. $SaveLogsPath           = "C:\Program Files (x86)\AutoIt3\logs\"    ;Folder to save the logs and statistics in                      //
  44. ;                                                                                                                                   //
  45. ;                                      Relogging                                                                                    //                                 
  46. $UseRelogging           = False                                     ;Enable Relogging                                               //
  47. $Password               = "XXXXXXXXXXX"                             ;Your password                                                  //
  48. ;                                                                                                                                   //
  49. ;                                        Looting                                                                                    //
  50. $LootLegendaries        = True                                      ;Loot legendary items                                           //
  51. $LootSets               = True                                      ;Loot set items                                                 //
  52. $LootRares              = True                                      ;Loot rare items                                                //
  53. $LootMagics             = True                                      ;Loot magic items (includes tomes)                              //
  54. $LootTomes              = True                                      ;Loot tomes                                                     //
  55. $LootGems               = True                                      ;Loot gems                                                      //
  56. ;                                                                                                                                   //
  57. ;      <<<Changes below have an significant impact on the needed for looting>>>                                                     //
  58. ;                                                                                                                                   //
  59. $LegendaryLootAmount    = 1                                         ;Amount of legendary items to loot                              //
  60. $SetLootAmount          = 1                                         ;Amount of set items to loot                                    //
  61. $RareLootAmount         = 1                                         ;Amount of rare items to loot                                   //
  62. $MagicLootAmount        = 3                                         ;Amount of magic items to loot (including tomes)                //
  63. $TomeLootAmount         = 1                                         ;Amount of tomes to loot                                        //
  64. $GemLootAmount          = 2                                         ;Amount of gems to loot                                         //
  65. ;                                                                                                                                   //
  66. $LootingArea[0]         = 570                                       ;Left   (lower -> bigger)                                       //
  67. $LootingArea[1]         = 185                                       ;Top    (lower -> bigger)                                       //
  68. $LootingArea[2]         = 1375                                      ;Right  (higher -> bigger)                                      //
  69. $LootingArea[3]         = 720                                       ;Bot    (higher -> bigger)                                      //
  70. ;                                                                                                                                   //
  71. ;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  72.  
  73. ScriptStarted()
  74.  
  75. While 1
  76.    While WinActive('Diablo III')
  77.       Randomize()
  78.      
  79.       Switch ResumeGame()
  80.          Case "LeftGame"
  81.             ExitLoop
  82.          Case "Network connection lost"
  83.             ExitLoop
  84.          Case "Relogged"
  85.             ExitLoop
  86.       EndSwitch
  87.      
  88.       MoveToCellar()
  89.      
  90.       Switch EnterCellar()
  91.          Case "LeftGame"
  92.             ExitLoop
  93.          Case "Network connection lost"
  94.             ExitLoop
  95.          Case "Relogged"
  96.             ExitLoop
  97.       EndSwitch
  98.      
  99.       MoveInCellar()
  100.       UseSkills()
  101.       KillSarkoth()
  102.       LootGold()
  103.      
  104.       Switch LootItems()
  105.          Case "LeftGame"
  106.             ExitLoop
  107.          Case "Network connection lost"
  108.             ExitLoop
  109.          Case "Relogged"
  110.             ExitLoop
  111.       EndSwitch
  112.      
  113.       Switch TeleportToTown()
  114.          Case "LeftGame"
  115.             ExitLoop
  116.          Case "Network connection lost"
  117.             ExitLoop
  118.          Case "Relogged"
  119.             ExitLoop  
  120.       EndSwitch
  121.      
  122.       LeaveGame()
  123.    WEnd
  124. WEnd
  125.  
  126. ;Routine
  127. Func ResumeGame()
  128.    Switch InGameLobby()
  129.       Case "InGameLobby"
  130.          ToLog("Resuming game...")
  131.          MouseClick('LEFT', $ResumeButton[0], $ResumeButton[1], 1, 5)
  132.       Case "LeftGame"
  133.          Return "LeftGame"
  134.    EndSwitch
  135.    
  136.    Switch InGameplayScreen()
  137.       Case "LeftGame"
  138.          Return "LeftGame"
  139.       Case "InGamePlayScreen"
  140.          Return "InGamePlayScreen"
  141.       Case "Network connection lost"
  142.          Return "Network connection lost"
  143.       Case "Relogged"
  144.          Return "Relogged"
  145.    EndSwitch
  146. EndFunc
  147.  
  148. Func MoveToCellar()
  149.    ToLog("Starting run...")
  150.    $Runs+=1
  151.    RefreshStats()
  152.    
  153.    Sleep(200 + $Computerlag)
  154.    Send("{2}")
  155.    Sleep(200 + $Computerlag)
  156.    
  157.    ToLog("Moving to cellar - 1")
  158.    Move($MoveToCellar1[0], $MoveToCellar1[1])
  159.    Sleep(1400 + $MoveDelay)
  160.    
  161.    Send("{4}")
  162.    Sleep(500)
  163.    
  164.    ToLog("Moving to cellar - 2")
  165.    Move($MoveToCellar2[0], $MoveToCellar2[1])
  166.    Sleep(2150 + $MoveDelay)
  167.    
  168.    ToLog("Moving to cellar - 3")
  169.    Move($MoveToCellar3[0], $MoveToCellar3[1])
  170.    Sleep(1250 + $MoveDelay)
  171. EndFunc
  172.  
  173. Func EnterCellar()
  174.    MouseMove($CellarLocation[0], $CellarLocation[1], 5)
  175.    Sleep(400 + $ComputerLag)
  176.    
  177.    $CellarPixel = PixelSearch($CellarLocation[0]-$CellarOffset, $CellarLocation[1]-$CellarOffset, $CellarLocation[0]+4, $CellarLocation[1]+4, 0x334FB7, 6)
  178.    If @error Then
  179.       ToLog("Cellar is closed")
  180.       $Closed+=1
  181.       RefreshStats()
  182.       Switch TeleportToTown()
  183.          Case "LeftGame"
  184.             Return "LeftGame"
  185.          Case "Network connection lost"
  186.             Return "Network connection lost"
  187.          Case "Relogged"
  188.             Return "Relogged"    
  189.       EndSwitch
  190.       LeaveGame()
  191.       Return "LeftGame"
  192.    Else
  193.       ToLog("Entering cellar...")
  194.       MouseClick('LEFT', $CellarLocation[0], $CellarLocation[1], 1, 5)
  195.       Switch InCellar()
  196.       Case "InCellar"
  197.          Return "InCellar"
  198.       Case "LeftGame"
  199.          Return "LeftGame"
  200.       Case "Network connection lost"
  201.          Return "Network connection lost"
  202.       Case "Relogged"
  203.          Return "Relogged"
  204.       EndSwitch
  205.    EndIf  
  206. EndFunc
  207.  
  208. Func MoveInCellar()
  209.    ToLog("Moving in cellar - 1")
  210.    Move($MoveInCellar1[0], $MoveInCellar1[1])
  211.    Sleep(2250 + $MoveDelay)
  212.    
  213.    ToLog("Moving in cellar - 2")
  214.    Move($MoveInCellar2[0], $MoveInCellar2[1])
  215.    Sleep(1260 + $MoveDelay)
  216.    
  217.    MouseMove($MonsterLocation[0],$MonsterLocation[1], 5)
  218.    Sleep(150 + $Computerlag)
  219. EndFunc
  220.    
  221. Func UseSkills()
  222.    ToLog("Using skills...")
  223.    Send("{1}")
  224.    Sleep(400 + $Computerlag)
  225.    
  226.    Send("{3}")
  227.    Sleep(400 + $Computerlag)
  228.    
  229.    MouseClick('RIGHT')
  230.    Sleep(250 + $Computerlag)
  231. EndFunc
  232.    
  233. Func KillSarkoth()
  234.    ToLog("Killing Sarkoth...")
  235.    While 1
  236.       $MonsterBar = PixelSearch($MonsterSearchArea[0], $MonsterSearchArea[1], $MonsterSearchArea[2], $MonsterSearchArea[3], 0xEE0000, 10)
  237.       If @error Then
  238.          Attack($MonsterLocation[0],$MonsterLocation[1])
  239.          Sleep(600)
  240.          
  241.          $MonsterBar =  PixelSearch($MonsterSearchArea[0], $MonsterSearchArea[1], $MonsterSearchArea[2], $MonsterSearchArea[3], 0xEE0000, 10)
  242.          If @error Then
  243.             ExitLoop
  244.          EndIf
  245.       EndIf
  246.      
  247.       Attack($MonsterBar[0], $MonsterBar[1])
  248.       Sleep(100)
  249.    WEnd
  250.    ToLog("All monsters are dead")
  251. EndFunc
  252.  
  253. Func LootGold()
  254.    ToLog("Looting gold...")
  255.    If $HighGoldRadius = False Then
  256.       Move($MoveToGoldLoot1a[0], $MoveToGoldLoot1a[1])
  257.       Sleep(1500 + $MoveDelay)
  258.       AttackNearbyMonsters()
  259.      
  260.       Move($MoveToGoldLoot2[0], $MoveToGoldLoot2[1])
  261.       Sleep(1500 + $MoveDelay)
  262.       AttackNearbyMonsters()
  263.      
  264.       Move($MoveToGoldLoot3[0], $MoveToGoldLoot3[1])
  265.       Sleep(1500 + $MoveDelay)
  266.       AttackNearbyMonsters()
  267.    Else
  268.       Move($MoveToGoldLoot1b[0], $MoveToGoldLoot1b[1])
  269.       Sleep(1500 + $MoveDelay)
  270.       AttackNearbyMonsters()
  271.    EndIf
  272.    
  273.    MouseMove(Random(100, 140, 1), Random(100, 140, 1), 3)
  274.    Sleep(100)
  275. EndFunc
  276.  
  277. Func LootItems()
  278.    If $LootSets Then
  279.       Switch LootSets()
  280.          Case "LeftGame"
  281.             Return "LeftGame"
  282.          Case "Network connection lost"
  283.             Return "Network connection lost"
  284.          Case "Relogged"
  285.             Return "Relogged"
  286.       EndSwitch
  287.    EndIf
  288.    
  289.    If $LootLegendaries Then
  290.       Switch LootLegendaries()
  291.          Case "LeftGame"
  292.             Return "LeftGame"
  293.          Case "Network connection lost"
  294.             Return "Network connection lost"
  295.          Case "Relogged"
  296.             Return "Relogged"
  297.       EndSwitch
  298.    EndIf
  299.    
  300.    If $LootRares Then
  301.       Switch LootRares()
  302.          Case "LeftGame"
  303.             Return "LeftGame"
  304.          Case "Network connection lost"
  305.             Return "Network connection lost"
  306.          Case "Relogged"
  307.             Return "Relogged"
  308.       EndSwitch
  309.       $RareLootAttempts = 0
  310.    EndIf
  311.    
  312.    If $LootMagics Then
  313.       Switch LootMagics()
  314.          Case "LeftGame"
  315.             Return "LeftGame"
  316.          Case "Network connection lost"
  317.             Return "Network connection lost"
  318.          Case "Relogged"
  319.             Return "Relogged"
  320.       EndSwitch
  321.       $MagicLootAttempts = 0
  322.    Else
  323.       If $LootTomes Then
  324.          Switch LootTomes()
  325.          Case "LeftGame"
  326.             Return "LeftGame"
  327.          Case "Network connection lost"
  328.             Return "Network connection lost"
  329.          Case "Relogged"
  330.             Return "Relogged"
  331.          EndSwitch
  332.          $TomesLootAttempts = 0
  333.       EndIf
  334.    EndIf
  335.    
  336.    If $LootGems Then
  337.       Switch LootGems()
  338.          Case "LeftGame"
  339.             Return "LeftGame"
  340.          Case "Network connection lost"
  341.             Return "Network connection lost"
  342.          Case "Relogged"
  343.             Return "Relogged"
  344.       EndSwitch
  345.       $GemLootAttempts = 0
  346.    EndIf
  347.    Return "Looted"
  348. EndFunc
  349.    
  350. Func TeleportToTown()
  351.    ToLog("Teleporting to town...")
  352.    Sleep(500)
  353.    Send("{t}")
  354.    Switch InTown()
  355.       Case "InTown"
  356.          Return "InTown"
  357.       Case "LeftGame"
  358.          Return "LeftGame"
  359.       Case "Network connection lost"
  360.          Return "Network connection lost"
  361.       Case "Relogged"
  362.          Return "Relogged"
  363.    EndSwitch
  364. EndFunc
  365.  
  366.  
  367. ;Loot
  368. Func LootLegendaries()
  369.    While $LegendaryLootAttempts < $LegendaryLootAmount
  370.       ToLog("Searching for legendaries... " & $LegendaryLootAttempts + 1)
  371.       For $gI = 0 to 4
  372.          $Array = StringSplit($ImageFiles[0][$gI],"|")
  373.          $File = $Array[1]
  374.          $Accuracy = $Array[2]
  375.      
  376.          $Target = _ImageSearchArea($ImgDir & $File, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $Accuracy)
  377.          If $Target = 1 Then
  378.             ToLog("Legendary found")
  379.          
  380.             If $Sounds = True Then
  381.                SoundPlay($SoundsDir & $SoundFiles[0], 0)
  382.             EndIf
  383.          
  384.             MouseClick("LEFT", $ISx, $ISy, 1, 4)
  385.             Sleep(700 + $LootDelay)
  386.          
  387.             MouseMove(Random(100, 140, 1), Random(100, 140, 1), 3)
  388.             Sleep(100)
  389.          
  390.             If $Sell = True Then
  391.                Switch CheckBagFull()
  392.                Case "LeftGame"
  393.                   Return "LeftGame"
  394.                Case "Network connection lost"
  395.                   Return "Network connection lost"
  396.                Case "Relogged"
  397.                   Return "Relogged"
  398.             EndSwitch
  399.                If $FullBag = True Then
  400.                   $FullBag = False
  401.                Else
  402.                   $LegendaryLootAttempts+=1
  403.                   $Legendaries+=1
  404.                   RefreshStats()
  405.                EndIf
  406.             EndIf
  407.             ExitLoop
  408.          EndIf
  409.       Next
  410.       If $Target = 0 Then ExitLoop
  411.    WEnd
  412.    Return "Looted"
  413. EndFunc
  414.  
  415. Func LootSets()
  416.    While $SetLootAttempts < $SetLootAmount
  417.       ToLog("Searching for sets... " & $SetLootAttempts + 1)
  418.       For $gI = 0 to 4
  419.          $Array = StringSplit($ImageFiles[1][$gI],"|")
  420.          $File = $Array[1]
  421.          $Accuracy = $Array[2]
  422.      
  423.          $Target = _ImageSearchArea($ImgDir & $File, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $Accuracy)
  424.          If $Target = 1 Then
  425.             ToLog("Set found")
  426.          
  427.             If $Sounds = True Then
  428.                SoundPlay($SoundsDir & $SoundFiles[1], 0)
  429.             EndIf
  430.          
  431.             MouseClick("LEFT", $ISx, $ISy, 1, 4)
  432.             Sleep(700 + $LootDelay)
  433.          
  434.             MouseMove(Random(100, 140, 1), Random(100, 140, 1), 3)
  435.             Sleep(100)
  436.          
  437.             If $Sell = True Then
  438.                CheckBagFull()
  439.                If $FullBag = True Then
  440.                   $FullBag = False
  441.                Else
  442.                   $SetLootAttempts+=1  
  443.                   $Sets+=1
  444.                   RefreshStats()
  445.                EndIf
  446.             EndIf
  447.             ExitLoop
  448.          EndIf
  449.       Next
  450.       If $Target = 0 Then ExitLoop
  451.    WEnd
  452.    Return "Looted"
  453. EndFunc
  454.  
  455. Func LootRares()
  456.    While $RareLootAttempts < $RareLootAmount
  457.       ToLog("Searching for rares... " & $RareLootAttempts + 1)
  458.       For $gI = 0 to 4
  459.          $Array = StringSplit($ImageFiles[2][$gI],"|")
  460.          $File = $Array[1]
  461.          $Accuracy = $Array[2]
  462.      
  463.          $Target = _ImageSearchArea($ImgDir & $File, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $Accuracy)
  464.          If $Target = 1 Then
  465.             ToLog("Rare found")
  466.          
  467.             If $Sounds = True Then
  468.                SoundPlay($SoundsDir & $SoundFiles[2], 0)
  469.             EndIf
  470.          
  471.             MouseClick("LEFT", $ISx, $ISy, 1, 4)
  472.             Sleep(700 + $LootDelay)
  473.          
  474.             MouseMove(Random(100, 140, 1), Random(100, 140, 1), 3)
  475.             Sleep(100)
  476.          
  477.             If $Sell = True Then
  478.                Switch CheckBagFull()
  479.                Case "LeftGame"
  480.                   Return "LeftGame"
  481.                Case "Network connection lost"
  482.                   Return "Network connection lost"
  483.                Case "Relogged"
  484.                   Return "Relogged"
  485.             EndSwitch
  486.                If $FullBag = True Then
  487.                   $FullBag = False
  488.                   $RareLootAttempts-=1
  489.                Else
  490.                   $Rares+=1
  491.                   RefreshStats()
  492.                EndIf
  493.             EndIf
  494.             ExitLoop
  495.          EndIf
  496.       Next
  497.       $RareLootAttempts+=1 
  498.    WEnd
  499.    Return "Looted"
  500. EndFunc
  501.  
  502. Func LootMagics()
  503.    While $MagicLootAttempts < $MagicLootAmount
  504.       ToLog("Searching for magics... " & $MagicLootAttempts + 1)
  505.       For $gI = 0 to 4
  506.          $Array = StringSplit($ImageFiles[3][$gI],"|")
  507.          $File = $Array[1]
  508.          $Accuracy = $Array[2]
  509.      
  510.          $Target = _ImageSearchArea($ImgDir & $File, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $Accuracy)
  511.          If $Target = 1 Then
  512.             ToLog("Magic found")
  513.          
  514.             If $Sounds = True Then
  515.                SoundPlay($SoundsDir & $SoundFiles[3], 0)
  516.             EndIf
  517.          
  518.             MouseClick("LEFT", $ISx, $ISy, 1, 4)
  519.             Sleep(700 + $LootDelay)
  520.          
  521.             MouseMove(Random(100, 140, 1), Random(100, 140, 1), 3)
  522.             Sleep(100)
  523.          
  524.             If $Sell = True Then
  525.                Switch CheckBagFull()
  526.                   Case "LeftGame"
  527.                      Return "LeftGame"
  528.                   Case "Network connection lost"
  529.                      Return "Network connection lost"
  530.                   Case "Relogged"
  531.                      Return "Relogged"
  532.                EndSwitch
  533.                If $FullBag = True Then
  534.                   $FullBag = False
  535.                Else
  536.                   $MagicLootAttempts+=1
  537.                   $Magics+=1
  538.                   RefreshStats()
  539.                EndIf
  540.             EndIf
  541.             ExitLoop
  542.          EndIf
  543.       Next
  544.       If $Target = 0 Then ExitLoop
  545.    WEnd
  546.    Return "Looted"
  547. EndFunc
  548.  
  549. Func LootTomes()
  550.    While $TomeLootAttempts < $TomeLootAmount
  551.       ToLog("Searching for Tomes of Secrets... " & $TomeLootAttempts + 1)
  552.       $Array = StringSplit($ImageFiles[4][0],"|")
  553.       $File = $Array[1]
  554.       $Accuracy = $Array[2]
  555.      
  556.       $Target = _ImageSearchArea($ImgDir & $File, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $Accuracy)
  557.       If $Target = 1 Then
  558.          ToLog("Tome of Secrets found")
  559.          
  560.          If $Sounds = True Then
  561.             SoundPlay($SoundsDir & $SoundFiles[4], 0)
  562.          EndIf
  563.          
  564.          MouseClick("LEFT", $ISx, $ISy, 1, 4)
  565.          Sleep(700 + $LootDelay)
  566.          
  567.          MouseMove(Random(100, 140, 1), Random(100, 140, 1), 3)
  568.          Sleep(100)
  569.          
  570.          If $Sell = True Then
  571.             Switch CheckBagFull()
  572.                Case "LeftGame"
  573.                   Return "LeftGame"
  574.                Case "Network connection lost"
  575.                   Return "Network connection lost"
  576.                Case "Relogged"
  577.                   Return "Relogged"
  578.             EndSwitch
  579.             If $FullBag = True Then
  580.                $FullBag = False
  581.             Else
  582.                $TomeLootAttempts+=1
  583.                $Tomes+=1
  584.                RefreshStats()
  585.             EndIf
  586.          EndIf
  587.       EndIf
  588.       If $Target = 0 Then ExitLoop
  589.    WEnd
  590.    Return "Looted"
  591. EndFunc
  592.    
  593. Func LootGems()
  594.    While $GemLootAttempts < $GemLootAmount
  595.       ToLog("Searching for Gems... " & $GemLootAttempts + 1)
  596.       $Array = StringSplit($ImageFiles[4][1],"|")
  597.       $File = $Array[1]
  598.       $Accuracy = $Array[2]
  599.      
  600.       $Target = _ImageSearchArea($ImgDir & $File, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $Accuracy)
  601.       If $Target = 1 Then
  602.          ToLog("Gem found")
  603.          
  604.          If $Sounds = True Then
  605.             SoundPlay($SoundsDir & $SoundFiles[5], 0)
  606.          EndIf
  607.          
  608.          MouseClick("LEFT", $ISx, $ISy, 1, 4)
  609.          Sleep(700 + $LootDelay)
  610.          
  611.          MouseMove(Random(100, 140, 1), Random(100, 140, 1), 3)
  612.          Sleep(100)
  613.          
  614.          If $Sell = True Then
  615.             Switch CheckBagFull()
  616.                Case "LeftGame"
  617.                   Return "LeftGame"
  618.                Case "Network connection lost"
  619.                   Return "Network connection lost"
  620.                Case "Relogged"
  621.                   Return "Relogged"
  622.             EndSwitch
  623.             If $FullBag = True Then
  624.                $FullBag = False
  625.             Else
  626.                $GemLootAttempts+=1 
  627.                $Gems+=1
  628.                RefreshStats()
  629.             EndIf
  630.          EndIf
  631.       EndIf
  632.       If $Target = 0 Then ExitLoop
  633.    WEnd
  634.    Return "Looted"
  635. EndFunc
  636.  
  637.  
  638. ;Sell, store and repair
  639. Func CheckBagFull()
  640.    $Array = StringSplit($ImageFiles[5][0],"|")
  641.    $File = $Array[1]
  642.    $Accuracy = $Array[2]
  643.    
  644.    $Target = _ImageSearchArea($ImgDir & $File, 1, $FullBagSearchArea[0], $FullBagSearchArea[1], $FullBagSearchArea[2], $FullBagSearchArea[3], $ISx, $ISy, $Accuracy)
  645.    If $Target = 1 Then
  646.       ToLog("Our bag is full")
  647.       $FullBag = True
  648.       Switch SellItems()
  649.          Case "LeftGame"
  650.             Return "LeftGame"
  651.          Case "Network connection lost"
  652.             Return "Network connection lost"
  653.          Case "Relogged"
  654.             Return "Relogged"
  655.       EndSwitch
  656.    EndIf
  657.    Return "BagNotFull"
  658. EndFunc
  659.  
  660. Func SellItems()  
  661.    Switch TeleportToTown()
  662.       Case "LeftGame"
  663.          Return "LeftGame"
  664.       Case "Network connection lost"
  665.          Return "Network connection lost"
  666.       Case "Relogged"
  667.          Return "Relogged"
  668.    EndSwitch
  669.    
  670.    Switch MoveToMerchant()
  671.       Case "LeftGame"
  672.          Return "LeftGame"
  673.       Case "Network connection lost"
  674.          Return "Network connection lost"
  675.       Case "Relogged"
  676.          Return "Relogged"
  677.    EndSwitch
  678.    
  679.    ToLog("Selling...")
  680.    
  681.    $Count = 0
  682.    
  683.    For $gI = 1 to 3
  684.       $Array = StringSplit($ImageFiles[5][$gI],"|")
  685.       $File = $Array[1]
  686.       $Accuracy = $Array[2]
  687.      
  688.       For $i = 0 To 30
  689.          $Target = _ImageSearchArea($ImgDir & $File, 1, $SellItemsArea1[0], $SellItemsArea1[1], $SellItemsArea1[2], $SellItemsArea1[3], $ISx, $ISy, $Accuracy)
  690.          If $Target = 1 Then
  691.             $Count+=1
  692.             $Sold+=1
  693.             RefreshStats()
  694.            
  695.             MouseClick("RIGHT", $ISx, $ISy, 1, 2)
  696.             Sleep(150)
  697.          EndIf
  698.       Next
  699.    Next
  700.    
  701.    For $gI = 1 to 3
  702.       $Array = StringSplit($ImageFiles[5][$gI],"|")
  703.       $File = $Array[1]
  704.       $Accuracy = $Array[2]
  705.      
  706.       For $i = 0 To 4
  707.          $Target = _ImageSearchArea($ImgDir & $File, 1, $SellItemsArea2[0], $SellItemsArea2[1], $SellItemsArea2[2], $SellItemsArea2[3], $ISx, $ISy, $Accuracy)
  708.          If $Target = 1 Then
  709.             $Count+=1
  710.             $Sold+=1
  711.             RefreshStats()
  712.            
  713.             MouseClick("RIGHT", $ISx, $ISy, 1, 2)
  714.             Sleep(150)
  715.          EndIf
  716.       Next
  717.    Next
  718.    
  719.    ToLog("Selling... done - Sold " & $Count & " items!")
  720.    
  721.    $RareLootAttempts    = 0
  722.    $MagicLootAttempts   = 0
  723.    $TomeLootAttempts    = 0
  724.    $GemLootAttempts     = 0
  725.    
  726.    Switch MoveToStash()
  727.       Case "LeftGame"
  728.          Return "LeftGame"
  729.       Case "Network connection lost"
  730.          Return "Network connection lost"
  731.       Case "Relogged"
  732.          Return "Relogged"
  733.    EndSwitch
  734.      
  735.    Sleep(300 + $ComputerLag)
  736.    
  737.    MouseClick("LEFT", $PortalLocation[0], $PortalLocation[1], 1, 10)
  738.    Switch InCellar()
  739.       Case "InCellar"
  740.          Return "InCellar"
  741.       Case "LeftGame"
  742.          Return "LeftGame"
  743.       Case "Network connection lost"
  744.          Return "Network connection lost"
  745.       Case "Relogged"
  746.          Return "Relogged"
  747.       EndSwitch
  748. EndFunc
  749.  
  750. Func PutInStash()  
  751.    ToLog("Storing items in the stash...")
  752.  
  753.    While UBOUND($Stash) > 0
  754.       $r = Random(0, UBOUND($Stash)-1, 1)
  755.       MouseClick("RIGHT", $Stash[$r][0], $Stash[$r][1], 1, 0)
  756.          
  757.       Sleep(75)
  758.       If Not CheckStashFull() = 1 Then
  759.          _ArrayDelete($Stash, $r)
  760.       EndIf
  761.          
  762.       If $UseStash = False Then
  763.          ExitLoop
  764.       EndIf
  765.    WEnd
  766.    
  767.    ToLog("Storing items in the stash... done")
  768. EndFunc
  769.  
  770. Func CheckStashFull()
  771.    $Array = StringSplit($ImageFiles[5][4],"|")
  772.    $File = $Array[1]
  773.    $Accuracy = $Array[2]
  774.    
  775.    $Target = _ImageSearchArea($ImgDir & $File, 1, $FullStashSearchArea[0], $FullStashSearchArea[1], $FullStashSearchArea[2], $FullStashSearchArea[3], $ISx, $ISy, $Accuracy)
  776.    If $Target = 1 Then
  777.       Switch $StashBag
  778.          Case 1
  779.             ToLog("First stashbag is full - changing...")
  780.             Sleep(200)
  781.             MouseClick("LEFT", $StashBag2[0], $StashBag2[1], 1, 5)
  782.             $StashBag = 2
  783.             Sleep(5000)
  784.          Case 2
  785.             ToLog("Second stashbag is full - changing...")
  786.             Sleep(200)
  787.             MouseClick("LEFT", $StashBag3[0], $StashBag3[1], 1, 5)
  788.             $StashBag = 3
  789.             Sleep(5000)
  790.          Case 3
  791.             ToLog("Third stashbag is full - aborting...")
  792.             $UseStash = False
  793.       EndSwitch
  794.       Return 1
  795.    EndIf
  796.    Return 0
  797. EndFunc
  798.  
  799. Func RepairItems()
  800.    If Not CheckForRepair() Then
  801.       Return "NotDamaged"
  802.    EndIf
  803.    
  804.    Switch MoveToMerchant()
  805.       Case "LeftGame"
  806.          Return "LeftGame"
  807.       Case "Network connection lost"
  808.          Return "Network connection lost"
  809.       Case "Relogged"
  810.          Return "Relogged"
  811.    EndSwitch
  812.    
  813.    ToLog("Repairing...")
  814.    MouseClick('LEFT', $RepairButton[0], $RepairButton[1], 1, 5)
  815.    Sleep(500)
  816.    
  817.    MouseClick('LEFT', $AllItemsButton[0], $AllItemsButton[1], 1, 5)
  818.    Sleep(500)
  819.    
  820.    Send("{ESC}")
  821.    ToLog("Repairing... done")
  822.    Return "Repaired"
  823. EndFunc
  824.  
  825. Func CheckForRepair()
  826.    $RepairNeeded = PixelSearch($RepairSearchArea[0], $RepairSearchArea[1], $RepairSearchArea[2], $RepairSearchArea[3], 0xFFE801, 10)
  827.    If Not @error Then
  828.       ToLog("We need to repair")
  829.       Return True
  830.    Else
  831.       $RepairNeeded = PixelSearch($RepairSearchArea[0], $RepairSearchArea[1], $RepairSearchArea[2], $RepairSearchArea[3], 0xDE0000, 10)
  832.       If Not @error Then
  833.          ToLog("We need to repair")
  834.          Return True
  835.       Else
  836.          Return False
  837.       EndIf
  838.    EndIf
  839. EndFunc
  840.  
  841. Func MoveToMerchant()
  842.    Sleep(500)
  843.    ToLog("Waiting to get to the merchant...")
  844.    
  845.    ToLog("Moving to merchant - 1")
  846.    Move($MoveToMerchant[0] , $MoveToMerchant[1])
  847.    Sleep(3500 + $MoveDelay)
  848.    
  849.    ToLog("Moving to merchant - 2")
  850.    MouseClick('LEFT', $MerchantLocation[0], $MerchantLocation[1], 1, 10)
  851.    
  852.    Switch AtMerchant()
  853.       Case "AtMerchant"
  854.          Return "AtMerchant"
  855.       Case "LeftGame"
  856.          Return "LeftGame"
  857.       Case "Network connection lost"
  858.          Return "Network connection lost"
  859.       Case "Relogged"
  860.          Return "Relogged"
  861.    EndSwitch
  862. EndFunc
  863.  
  864. Func MoveToStash()
  865.    ToLog("Waiting to get to the stash...")
  866.    
  867.    ToLog("Moving to stash - 1")
  868.    Move($MoveToStash1[0] , $MoveToStash1[1])
  869.    Sleep(2050 + $MoveDelay)
  870.    
  871.    ToLog("Moving to stash - 2")
  872.    Move($MoveToStash2[0] , $MoveToStash2[1])
  873.    Sleep(2650 + $MoveDelay)
  874.    
  875.    If $UseStash = True Then
  876.       $StashBag = 1
  877.       MouseClick("LEFT", $StashLocation[0], $StashLocation[1], 1, 10)
  878.       Switch AtStash()
  879.          Case "LeftGame"
  880.             Return "LeftGame"
  881.          Case "Network connection lost"
  882.             Return "Network connection lost"
  883.          Case "Relogged"
  884.             Return "Relogged"
  885.       EndSwitch
  886.       PutInStash()
  887.       Sleep(200)
  888.       Send("{ESC}")
  889.    EndIf
  890.    Return "AtStash"
  891. EndFunc
  892.  
  893.  
  894. ;Check gamestate, disconnect and death
  895. Func InLoginScreen()
  896.    ToLog("Waiting to get into the login screen...")
  897.    
  898.    While 1
  899.       $Array = StringSplit($ImageFiles[7][4],"|")
  900.       $File = $Array[1]
  901.       $Accuracy = $Array[2]
  902.    
  903.       $Target = _ImageSearchArea($ImgDir & $File, 1, $LoginButtonSearchArea[0], $LoginButtonSearchArea[1], $LoginButtonSearchArea[2], $LoginButtonSearchArea[3], $ISx, $ISy, $Accuracy)
  904.       If $Target = 1 Then
  905.          Return True
  906.       Else
  907.          Sleep(350)
  908.       EndIf
  909.    WEnd  
  910. EndFunc
  911.  
  912. Func InGameLobby()
  913.    ToLog("Waiting to get into the game lobby...")
  914.    $TimeOutTimer = TimerInit()
  915.    
  916.    While 1
  917.       $Array = StringSplit($ImageFiles[7][2],"|")
  918.       $File = $Array[1]
  919.       $Accuracy = $Array[2]
  920.    
  921.       $Target = _ImageSearchArea($ImgDir & $File, 1, $ResumeButtonSearchArea[0], $ResumeButtonSearchArea[1], $ResumeButtonSearchArea[2], $ResumeButtonSearchArea[3], $ISx, $ISy, $Accuracy)
  922.       If $Target = 1 Then
  923.          Return "InGameLobby"
  924.       Else
  925.          If Floor(TimerDiff($TimeOutTimer) / 1000) >= 13 Then
  926.             ToLog("GameLobby TimeOut - Leaving again")
  927.             ToLog("Waiting to get into the game lobby...")
  928.             LeaveGame()
  929.             Return "LeftGame"
  930.          EndIf
  931.          Switch CheckForDisconnect()
  932.             Case "Network connection lost"
  933.                Return "Network connection lost"
  934.             Case "Relogged"
  935.                Return "Relogged"
  936.          EndSwitch
  937.          Sleep(350)
  938.       EndIf
  939.    WEnd  
  940. EndFunc
  941.  
  942. Func InGameplayScreen()
  943.    ToLog("Waiting to get into the game...")
  944.    $TimeOutTimer = TimerInit()
  945.    
  946.    While 1
  947.       $Array = StringSplit($ImageFiles[7][3],"|")
  948.       $File = $Array[1]
  949.       $Accuracy = $Array[2]
  950.    
  951.       $Target = _ImageSearchArea($ImgDir & $File, 1, $PortalIconSearchArea[0], $PortalIconSearchArea[1], $PortalIconSearchArea[2], $PortalIconSearchArea[3], $ISx, $ISy, $Accuracy)
  952.       If $Target = 1 Then
  953.          $Alive = True
  954.          $DisconnectState = 0
  955.          Return "InGamePlayScreen"
  956.       Else
  957.          If Floor(TimerDiff($TimeOutTimer) / 1000) >= 13 Then
  958.             $TimeOutTimer = TimerInit()
  959.             ToLog("GameplayScreen TimeOut - Resuming")
  960.             Return "LeftGame"
  961.          EndIf
  962.          If CheckForDeath() = "LeftGame" Then
  963.             Return "LeftGame"
  964.          EndIf
  965.          Sleep(200)
  966.          Switch CheckForDisconnect()
  967.             Case "Network connection lost"
  968.                Return "Network connection lost"
  969.             Case "Relogged"
  970.                Return "Relogged"
  971.          EndSwitch
  972.          Sleep(200)
  973.       EndIf
  974.    WEnd  
  975. EndFunc
  976.  
  977. Func InCellar()
  978.    ToLog("Waiting to get into the cellar...")
  979.    $TimeOutTimer = TimerInit()
  980.    
  981.    While 1
  982.       $Array = StringSplit($ImageFiles[7][0],"|")
  983.       $File = $Array[1]
  984.       $Accuracy = $Array[2]
  985.    
  986.       $Target = _ImageSearchArea($ImgDir & $File, 1, $CellarNameSearchArea[0], $CellarNameSearchArea[1], $CellarNameSearchArea[2], $CellarNameSearchArea[3], $ISx, $ISy, $Accuracy)
  987.       If $Target = 1 Then
  988.          Return "InCellar"
  989.       Else
  990.          If Floor(TimerDiff($TimeOutTimer) / 1000) >= 8 Then
  991.             ToLog("TimeOut - Leaving")
  992.             LeaveGame()
  993.             Return "LeftGame"
  994.          EndIf
  995.          If CheckForDeath() = "LeftGame" Then
  996.             Return "LeftGame"
  997.          EndIf
  998.          Sleep(200)
  999.          Switch CheckForDisconnect()
  1000.             Case "Network connection lost"
  1001.                Return "Network connection lost"
  1002.             Case "Relogged"
  1003.                Return "Relogged"
  1004.          EndSwitch
  1005.          Sleep(200)
  1006.       EndIf
  1007.    WEnd
  1008. EndFunc
  1009.  
  1010. Func InTown()
  1011.    ToLog("Waiting to get into the town...")
  1012.    $TimeOutTimer = TimerInit()
  1013.    
  1014.    While 1
  1015.       $Array = StringSplit($ImageFiles[7][1],"|")
  1016.       $File = $Array[1]
  1017.       $Accuracy = $Array[2]
  1018.    
  1019.       $Target = _ImageSearchArea($ImgDir & $File, 1, $TownNameSearchArea[0], $TownNameSearchArea[1], $TownNameSearchArea[2], $TownNameSearchArea[3], $ISx, $ISy, $Accuracy)
  1020.       If $Target = 1 Then
  1021.          If $Repair And Not $FullBag Then
  1022.          Switch RepairItems()
  1023.             Case "LeftGame"
  1024.                Return "LeftGame"
  1025.             Case "Network connection lost"
  1026.                Return "Network connection lost"
  1027.             Case "Relogged"
  1028.                Return "Relogged"
  1029.             EndSwitch
  1030.          EndIf
  1031.          Return "InTown"
  1032.       Else
  1033.          If Floor(TimerDiff($TimeOutTimer) / 1000) >= 8 Then
  1034.             $TimeOutCount+=1
  1035.             If $TimeOutCount = 3 Then
  1036.                ToLog("Teleport TimeOut - Leaving")
  1037.                $TimeOutCount = 0
  1038.                LeaveGame()
  1039.                Return "LeftGame"
  1040.             EndIf
  1041.             $TimeOutTimer = TimerInit()
  1042.             ToLog("Teleport TimeOut - Trying to teleport again")
  1043.             ToLog("Teleporting to town...")
  1044.             Sleep(500)
  1045.             Send("{t}")
  1046.          EndIf
  1047.          If CheckForDeath() = "LeftGame" Then
  1048.             Return "LeftGame"
  1049.          EndIf
  1050.          Sleep(200)
  1051.          Switch CheckForDisconnect()
  1052.             Case "Network connection lost"
  1053.                Return "Network connection lost"
  1054.             Case "Relogged"
  1055.                Return "Relogged"
  1056.          EndSwitch
  1057.       EndIf
  1058.    WEnd  
  1059. EndFunc
  1060.  
  1061. Func AtMerchant()
  1062.    $TimeOutTimer = TimerInit()
  1063.    
  1064.    While 1
  1065.       $Array = StringSplit($ImageFiles[7][5],"|")
  1066.       $File = $Array[1]
  1067.       $Accuracy = $Array[2]
  1068.    
  1069.       $Target = _ImageSearchArea($ImgDir & $File, 1, $MerchStashSearchArea[0], $MerchStashSearchArea[1], $MerchStashSearchArea[2], $MerchStashSearchArea[3], $ISx, $ISy, $Accuracy)
  1070.       If $Target = 1 Then
  1071.          Return "AtMerchant"
  1072.       Else
  1073.          If Floor(TimerDiff($TimeOutTimer) / 1000) >= 8 Then
  1074.             ToLog("Merchant TimeOut - Leaving")
  1075.             LeaveGame()
  1076.             Return "LeftGame"
  1077.          EndIf
  1078.          If CheckForDeath() = "LeftGame" Then
  1079.             Return "LeftGame"
  1080.          EndIf
  1081.          Sleep(200)
  1082.          Switch CheckForDisconnect()
  1083.             Case "Network connection lost"
  1084.                Return "Network connection lost"
  1085.             Case "Relogged"
  1086.                Return "Relogged"
  1087.          EndSwitch
  1088.       EndIf
  1089.    WEnd  
  1090. EndFunc
  1091.  
  1092. Func AtStash()
  1093.    $TimeOutTimer = TimerInit()
  1094.    
  1095.    While 1
  1096.       $Array = StringSplit($ImageFiles[7][6],"|")
  1097.       $File = $Array[1]
  1098.       $Accuracy = $Array[2]
  1099.    
  1100.       $Target = _ImageSearchArea($ImgDir & $File, 1, $MerchStashSearchArea[0], $MerchStashSearchArea[1], $MerchStashSearchArea[2], $MerchStashSearchArea[3], $ISx, $ISy, $Accuracy)
  1101.       If $Target = 1 Then
  1102.          Return "AtStash"
  1103.       Else
  1104.          If Floor(TimerDiff($TimeOutTimer) / 1000) >= 8 Then
  1105.             ToLog("Stash TimeOut - Leaving")
  1106.             LeaveGame()
  1107.             Return "LeftGame"
  1108.          EndIf
  1109.          If CheckForDeath() = "LeftGame" Then
  1110.             Return "LeftGame"
  1111.          EndIf
  1112.          Sleep(200)
  1113.          Switch CheckForDisconnect()
  1114.             Case "Network connection lost"
  1115.                Return "Network connection lost"
  1116.             Case "Relogged"
  1117.                Return "Relogged"
  1118.          EndSwitch
  1119.       EndIf
  1120.    WEnd  
  1121. EndFunc
  1122.  
  1123. Func CheckForDisconnect()
  1124.    $Array = StringSplit($ImageFiles[6][0],"|")
  1125.    $File = $Array[1]
  1126.    $Accuracy = $Array[2]
  1127.    
  1128.    $Target = _ImageSearchArea($ImgDir & $File, 1, $DisconnectSearchArea[0], $DisconnectSearchArea[1], $DisconnectSearchArea[2], $DisconnectSearchArea[3], $ISx, $ISy, $Accuracy)
  1129.    If $Target = 1 Then
  1130.       ToLog("We got disconnected")
  1131.       $Disconnects+=1
  1132.       RefreshStats()
  1133.       $DisconnectState = 1
  1134.      
  1135.       MouseClick("LEFT", $DisconnectButton[0], $DisconnectButton[1], 1, 5)
  1136.       Return "Network connection lost"
  1137.    EndIf
  1138.    
  1139.    $Array = StringSplit($ImageFiles[6][1],"|")
  1140.    $File = $Array[1]
  1141.    $Accuracy = $Array[2]
  1142.    
  1143.    $Target = _ImageSearchArea($ImgDir & $File, 1, $DisconnectSearchArea[0], $DisconnectSearchArea[1], $DisconnectSearchArea[2], $DisconnectSearchArea[3], $ISx, $ISy, 10)
  1144.    If $Target = 1 Then
  1145.       ToLog("We got totally disconnected")
  1146.       If $DisconnectState = 0 Then
  1147.          $Disconnects+=1
  1148.          RefreshStats()
  1149.       EndIf
  1150.       $DisconnectState = 2
  1151.      
  1152.       MouseClick("LEFT", $DisconnectButton[0], $DisconnectButton[1], 1, 5)
  1153.       InLoginScreen()  
  1154.      
  1155.       If $UseRelogging = True Then
  1156.          Relog()
  1157.          Return "Relogged"
  1158.       Else
  1159.          Terminate()
  1160.       EndIf
  1161.    EndIf
  1162.    Return "Connected"
  1163. EndFunc
  1164.  
  1165. Func CheckForDeath()
  1166.    If $Alive = True Then
  1167.       $Death = PixelSearch($DeathSearchArea[0], $DeathSearchArea[1], $DeathSearchArea[2], $DeathSearchArea[3], 0xFFFFFF)
  1168.       If Not @error Then
  1169.          $Alive = False
  1170.          ToLog("We are dead... :(")
  1171.          $Deaths+=1
  1172.          RefreshStats()
  1173.          LeaveGame()
  1174.          Return "LeftGame"
  1175.       EndIf
  1176.    EndIf
  1177.    Return "Alive"
  1178. EndFunc
  1179.  
  1180.  
  1181. ;Miscellaneous
  1182. Func ScriptStarted()
  1183.    Pause()
  1184.    
  1185.    $RuntimeTimer = TimerInit()
  1186.    
  1187.    If $ShowLootArea = True Then
  1188.       DrawLootArea()   
  1189.    EndIf
  1190.    
  1191.    If $ShowLog = True Then
  1192.       $Log = FileOpen($SaveLogsPath & "log.txt", 1)
  1193.       DrawLog()
  1194.    EndIf
  1195.    
  1196.    If $ShowLog = True Or $SaveStats = True Then
  1197.       DirGetSize($SaveLogsPath)
  1198.       If @error= 1 Then
  1199.          DirCreate($SaveLogsPath)
  1200.       EndIf  
  1201.    EndIf
  1202.    
  1203.    ToLog("Bot started")
  1204.    
  1205.    WinActivate('Diablo III')  
  1206. EndFunc
  1207.  
  1208. Func Pause()
  1209.    $Paused = Not $Paused
  1210.    If $Paused Then ToLog("Paused...")
  1211.      
  1212.    While $Paused
  1213.       Sleep(100)
  1214.       ToolTip('Paused... Press {PAUSE} to continue...', 850, 0)
  1215.    WEnd
  1216.    
  1217.    ToolTip("")
  1218. EndFunc
  1219.  
  1220. Func Initialize()
  1221.    OnAutoItExitRegister ('OnAutoItExit')
  1222.    Opt('MouseCoordMode', 2)
  1223.    Opt('PixelCoordMode', 2)
  1224.  
  1225.    HotKeySet('{PAUSE}', 'Pause')
  1226.    HotKeySet('{END}', 'Terminate')
  1227.  
  1228.    Global $ImageFiles[8][7]
  1229.    Global $SoundFiles[6]
  1230.    Global $PasswordField[2]
  1231.    Global $ResumeButton[2]
  1232.    Global $LeaveButton[2]
  1233.    Global $DisconnectButton[2]
  1234.    Global $MoveToCellar1[2]
  1235.    Global $MoveToCellar2[2]
  1236.    Global $MoveToCellar3[2]
  1237.    Global $MoveInCellar1[2]
  1238.    Global $MoveInCellar2[2]
  1239.    Global $MoveToGoldLoot1a[2]
  1240.    Global $MoveToGoldLoot1b[2]         
  1241.    Global $MoveToGoldLoot2[2]          
  1242.    Global $MoveToGoldLoot3[2]  
  1243.    Global $MoveToMerchant[2]
  1244.    Global $MoveToStash1[2]
  1245.    Global $MoveToStash2[2]
  1246.    Global $CellarLocation[2]   
  1247.    Global $MonsterLocation[2]
  1248.    Global $MerchantLocation[2]
  1249.    Global $StashLocation[2]
  1250.    Global $PortalLocation[2]
  1251.    Global $CharHitBox[4]
  1252.    Global $LoginButtonSearchArea[4]
  1253.    Global $ResumeButtonSearchArea[4]
  1254.    Global $PortalIconSearchArea[4]
  1255.    Global $CellarNameSearchArea[4]
  1256.    Global $TownNameSearchArea[4]
  1257.    Global $MerchStashSearchArea[4]
  1258.    Global $MonsterSearchArea[4]
  1259.    Global $LootingArea[4]
  1260.    Global $FullBagSearchArea[4]
  1261.    Global $SellItemsArea1[4]
  1262.    Global $SellItemsArea2[4]
  1263.    Global $FullStashSearchArea[4]
  1264.    Global $RepairSearchArea[4] 
  1265.    Global $DeathSearchArea[4]
  1266.    Global $DisconnectSearchArea[4]
  1267.    Global $StashBag2[2]
  1268.    Global $StashBag3[2]
  1269.    Global $RepairButton[2]
  1270.    Global $AllItemsButton[2]
  1271.    Global $CellarOffset
  1272.    Global $CellarPixel
  1273.    Global $Log
  1274.    Global $Label
  1275.    Global $LogList
  1276.    Global $RuntimeTimer
  1277.    Global $TimeOutTimer
  1278.    Global $Paused
  1279.    Global $LegendaryLootAttempts    = 0
  1280.    Global $SetLootAttempts          = 0
  1281.    Global $RareLootAttempts         = 0
  1282.    Global $MagicLootAttempts        = 0
  1283.    Global $TomeLootAttempts         = 0
  1284.    Global $GemLootAttempts          = 0
  1285.    Global $StartTime                = @HOUR & ":" & @MIN
  1286.    Global $Runs                     = 0
  1287.    Global $Closed                   = 0
  1288.    Global $Runtime                  = "0h 0m 0s"
  1289.    Global $Disconnects              = 0
  1290.    Global $Deaths                   = 0
  1291.    Global $Legendaries              = 0
  1292.    Global $Sets                     = 0
  1293.    Global $Rares                    = 0
  1294.    Global $Magics                   = 0
  1295.    Global $Gems                     = 0
  1296.    Global $Tomes                    = 0
  1297.    Global $Sold                     = 0
  1298.    Global $ISx                      = 0
  1299.    Global $ISy                      = 0
  1300.    Global $StashBag                 = 1
  1301.    Global $Alive                    = True
  1302.    Global $DisconnectState          = 0
  1303.    Global $FullBag                  = False
  1304.    Global $TimeOutCount             = 0
  1305.  
  1306.    $ImageFiles[0][0]            = "legendaryA.png|65"
  1307.    $ImageFiles[0][1]            = "legendaryE.png|65"
  1308.    $ImageFiles[0][2]            = "legendaryI.png|65"
  1309.    $ImageFiles[0][3]            = "legendaryO.png|65"
  1310.    $ImageFiles[0][4]            = "legendaryU.png|65"
  1311.    $ImageFiles[1][0]            = "setA.png|90"
  1312.    $ImageFiles[1][1]            = "setE.png|90"
  1313.    $ImageFiles[1][2]            = "setU.png|90"
  1314.    $ImageFiles[1][3]            = "setO.png|90"
  1315.    $ImageFiles[1][4]            = "setI.png|90"
  1316.    $ImageFiles[2][0]            = "rareA.png|102"
  1317.    $ImageFiles[2][1]            = "rareE.png|102"
  1318.    $ImageFiles[2][2]            = "rareI.png|102"
  1319.    $ImageFiles[2][3]            = "rareO.png|102"
  1320.    $ImageFiles[2][4]            = "rareU.png|102"
  1321.    $ImageFiles[3][0]            = "blueA.png|70"
  1322.    $ImageFiles[3][1]            = "blueE.png|70"
  1323.    $ImageFiles[3][2]            = "blueI.png|70"
  1324.    $ImageFiles[3][3]            = "blueO.png|70"
  1325.    $ImageFiles[3][4]            = "blueU.png|70"
  1326.    $ImageFiles[4][0]            = "tome.png|140"
  1327.    $ImageFiles[4][1]            = "uare.png|110"
  1328.    $ImageFiles[5][0]            = "you.png|100"
  1329.    $ImageFiles[5][1]            = "sellNew.png|55"
  1330.    $ImageFiles[5][2]            = "sell1x1.png|40"
  1331.    $ImageFiles[5][3]            = "sell1x2.png|40"
  1332.    $ImageFiles[5][4]            = "not.png|120"
  1333.    $ImageFiles[6][0]            = "network.png|10"
  1334.    $ImageFiles[6][1]            = "lost.png|10"
  1335.    $ImageFiles[7][0]            = "dank.png|120"
  1336.    $ImageFiles[7][1]            = "new.png|120"
  1337.    $ImageFiles[7][2]            = "game.png|20"
  1338.    $ImageFiles[7][3]            = "portal.png|120"
  1339.    $ImageFiles[7][4]            = "login.png|5"
  1340.    $ImageFiles[7][5]            = "merchant.png|20"
  1341.    $ImageFiles[7][6]            = "stash.png|20"
  1342.  
  1343.    $SoundFiles[0]               = "legendary.wav"
  1344.    $SoundFiles[1]               = "set.wav"
  1345.    $SoundFiles[2]               = "rare.wav"
  1346.    $SoundFiles[3]               = "magic.wav"
  1347.    $SoundFiles[4]               = "tome.wav"
  1348.    $SoundFiles[5]               = "gem.wav"
  1349.  
  1350.    $CharHitBox[0]               = 790
  1351.    $CharHitBox[1]               = 315
  1352.    $CharHitBox[2]               = 1200
  1353.    $CharHitBox[3]               = 730
  1354.  
  1355.    $LoginButtonSearchArea[0]    = 930
  1356.    $LoginButtonSearchArea[1]    = 845
  1357.    $LoginButtonSearchArea[2]    = 985
  1358.    $LoginButtonSearchArea[3]    = 860
  1359.  
  1360.    $ResumeButtonSearchArea[0]   = 250
  1361.    $ResumeButtonSearchArea[1]   = 410
  1362.    $ResumeButtonSearchArea[2]   = 310
  1363.    $ResumeButtonSearchArea[3]   = 425
  1364.  
  1365.    $PortalIconSearchArea[0]     = 1095
  1366.    $PortalIconSearchArea[1]     = 1000
  1367.    $PortalIconSearchArea[2]     = 1140
  1368.    $PortalIconSearchArea[3]     = 1060
  1369.  
  1370.    $CellarNameSearchArea[0]     = 1760
  1371.    $CellarNameSearchArea[1]     = 10
  1372.    $CellarNameSearchArea[2]     = 1820
  1373.    $CellarNameSearchArea[3]     = 30
  1374.  
  1375.    $TownNameSearchArea[0]       = 1745
  1376.    $TownNameSearchArea[1]       = 10
  1377.    $TownNameSearchArea[2]       = 1795
  1378.    $TownNameSearchArea[3]       = 30
  1379.  
  1380.    $MerchStashSearchArea[0]     = 225
  1381.    $MerchStashSearchArea[1]     = 30
  1382.    $MerchStashSearchArea[2]     = 300
  1383.    $MerchStashSearchArea[3]     = 115
  1384.  
  1385.    $MonsterSearchArea[0]        = 170
  1386.    $MonsterSearchArea[1]        = 75
  1387.    $MonsterSearchArea[2]        = 1270
  1388.    $MonsterSearchArea[3]        = 470
  1389.  
  1390.    $FullBagSearchArea[0]        = 795
  1391.    $FullBagSearchArea[1]        = 125
  1392.    $FullBagSearchArea[2]        = 830
  1393.    $FullBagSearchArea[3]        = 160
  1394.  
  1395.    $SellItemsArea1[0]           = 1460
  1396.    $SellItemsArea1[1]           = 585
  1397.    $SellItemsArea1[2]           = 1900
  1398.    $SellItemsArea1[3]           = 875
  1399.    
  1400.    $SellItemsArea2[0]           = 1407
  1401.    $SellItemsArea2[1]           = 631
  1402.    $SellItemsArea2[2]           = 1464
  1403.    $SellItemsArea2[3]           = 879
  1404.  
  1405.    $FullStashSearchArea[0]      = 700
  1406.    $FullStashSearchArea[1]      = 135
  1407.    $FullStashSearchArea[2]      = 730
  1408.    $FullStashSearchArea[3]      = 155
  1409.  
  1410.    $RepairSearchArea[0]         = 1507
  1411.    $RepairSearchArea[1]         = 36
  1412.    $RepairSearchArea[2]         = 1512
  1413.    $RepairSearchArea[3]         = 41
  1414.  
  1415.    $DeathSearchArea[0]          = 538
  1416.    $DeathSearchArea[1]          = 335
  1417.    $DeathSearchArea[2]          = 542
  1418.    $DeathSearchArea[3]          = 339
  1419.  
  1420.    $DisconnectSearchArea[0]     = 840
  1421.    $DisconnectSearchArea[1]     = 410
  1422.    $DisconnectSearchArea[2]     = 950
  1423.    $DisconnectSearchArea[3]     = 440
  1424.  
  1425.    $CellarOffset                = 33
  1426. EndFunc
  1427.  
  1428. Func Randomize()
  1429.    Global $Stash[60][2]
  1430.    $c = 0
  1431.    $d = -2
  1432.    For $a = 0 to 59
  1433.       $d+=1
  1434.       If $a = 10 or $a = 20 or $a = 30 or $a = 40 or $a = 50 Then
  1435.          $c+=1
  1436.          $d=-1
  1437.       EndIf
  1438.       For $b = 0 to 1
  1439.          If $a = 0 Then
  1440.             If $b = 0 Then
  1441.                $Stash[$a][$b] = 1430
  1442.             Else
  1443.                $Stash[$a][$b] = 560
  1444.             EndIf
  1445.          Else
  1446.             If $b = 0 Then
  1447.                $Stash[$a][$b] = Random(1473, 1483, 1) + (49 * $d)
  1448.             Else
  1449.                $Stash[$a][$b] = Random(606, 614, 1) + (49 * $c)
  1450.             EndIf
  1451.          EndIf
  1452.       Next
  1453.    Next
  1454.    
  1455.    $MoveToCellar1[0]        = Random(498, 503, 1)
  1456.    $MoveToCellar1[1]        = Random(248, 253, 1)
  1457.    $MoveToCellar2[0]        = Random(1, 4, 1)
  1458.    $MoveToCellar2[1]        = Random(368, 373, 1)
  1459.    $MoveToCellar3[0]        = Random(398, 403, 1)
  1460.    $MoveToCellar3[1]        = Random(598, 603, 1)  
  1461.  
  1462.    $MoveInCellar1[0]        = Random(114, 119, 1)
  1463.    $MoveInCellar1[1]        = Random(984, 989, 1)          
  1464.    $MoveInCellar2[0]        = Random(774, 779, 1)
  1465.    $MoveInCellar2[1]        = Random(326, 331, 1)
  1466.  
  1467.    $MoveToGoldLoot1a[0]     = Random(400, 405, 1)
  1468.    $MoveToGoldLoot1a[1]     = Random(304, 309, 1)
  1469.    $MoveToGoldLoot1b[0]     = Random(575, 580, 1)
  1470.    $MoveToGoldLoot1b[1]     = Random(304, 309, 1)
  1471.    $MoveToGoldLoot2[0]      = Random(1258, 1263, 1)
  1472.    $MoveToGoldLoot2[1]      = Random(349, 354, 1)
  1473.    $MoveToGoldLoot3[0]      = Random(909, 914, 1)
  1474.    $MoveToGoldLoot3[1]      = Random(692, 697, 1)
  1475.  
  1476.    $MoveToMerchant[0]       = Random(1688, 1693, 1)
  1477.    $MoveToMerchant[1]       = Random(100, 105, 1)
  1478.  
  1479.    $MoveToStash1[0]         = Random(778, 783, 1)
  1480.    $MoveToStash1[1]         = Random(948, 953, 1)
  1481.    $MoveToStash2[0]         = Random(268, 273, 1)
  1482.    $MoveToStash2[1]         = Random(928, 933, 1)
  1483.  
  1484.    $CellarLocation[0]       = Random(305, 309, 1)
  1485.    $CellarLocation[1]       = Random(72, 76, 1)
  1486.  
  1487.    $MonsterLocation[0]      = Random(575, 580, 1)
  1488.    $MonsterLocation[1]      = Random(181, 186, 1)
  1489.  
  1490.    $MerchantLocation[0]     = Random(928, 933, 1)
  1491.    $MerchantLocation[1]     = Random(134, 139, 1)
  1492.  
  1493.    $StashLocation[0]        = Random(803, 808, 1)
  1494.    $StashLocation[1]        = Random(428, 433, 1)
  1495.  
  1496.    $PortalLocation[0]       = Random(648, 653, 1)
  1497.    $PortalLocation[1]       = Random(498, 503, 1)
  1498.  
  1499.    $StashBag2[0]            = Random(508, 513, 1)
  1500.    $StashBag2[1]            = Random(358, 363, 1)
  1501.  
  1502.    $StashBag3[0]            = Random(508, 513, 1)
  1503.    $StashBag3[1]            = Random(488, 493, 1)
  1504.  
  1505.    $RepairButton[0]         = Random(515, 520, 1)
  1506.    $RepairButton[1]         = Random(481, 486, 1)
  1507.  
  1508.    $AllItemsButton[0]       = Random(221, 226, 1)
  1509.    $AllItemsButton[1]       = Random(590, 595, 1)
  1510.    
  1511.    $PasswordField[0]        = Random(818, 823, 1)
  1512.    $PasswordField[1]        = Random(703, 708, 1)
  1513.  
  1514.    $ResumeButton[0]         = Random(317, 322, 1)
  1515.    $ResumeButton[1]         = Random(414, 419, 1)
  1516.  
  1517.    $LeaveButton[0]          = Random(967, 972, 1)
  1518.    $LeaveButton[1]          = Random(580, 584, 1)
  1519.  
  1520.    $DisconnectButton[0]     = Random(958, 963, 1)
  1521.    $DisconnectButton[1]     = Random(628, 633, 1)
  1522. EndFunc
  1523.  
  1524. Func DrawLootArea()
  1525.    $LootingAreaWidth    = $LootingArea[2] - $LootingArea[0]
  1526.    $LootingAreaHeight   = $LootingArea[3] - $LootingArea[1]
  1527.    $LootAreaGUI = GUICreate("", $LootingAreaWidth + 2, $LootingAreaHeight + 2, $LootingArea[0], $LootingArea[1], $WS_POPUP, BitOR($WS_EX_LAYERED, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TRANSPARENT)))
  1528.    GuiSetBkColor(0xABCDEF)
  1529.    _WinAPI_SetLayeredWindowAttributes($LootAreaGUI, 0xABCDEF, 0xA0)
  1530.    WinSetOnTop($LootAreaGUI, "", 1)
  1531.    GuiSetState()
  1532.    $hDC = _WinAPI_GetWindowDC($LootAreaGUI)
  1533.    $hPen = _WinAPI_CreatePen($PS_SOLID, 2, 0x0000FF)
  1534.    $obj_orig = _WinAPI_SelectObject($hDC, $hPen)
  1535.    $user32_dll = DllOpen("user32.dll")
  1536.    _WinAPI_DrawLine($hDC, 0, 1, $LootingAreaWidth, 0)
  1537.    _WinAPI_DrawLine($hDC, 1, 0, 0, $LootingAreaHeight)
  1538.    _WinAPI_DrawLine($hDC, $LootingAreaWidth, $LootingAreaHeight, $LootingAreaWidth, 0)
  1539.    _WinAPI_DrawLine($hDC, $LootingAreaWidth, $LootingAreaHeight, 0, $LootingAreaHeight)
  1540.    
  1541.    _WinAPI_SetTextColor($hDC, 0x0000FF)
  1542.    _WinAPI_SetBkMode($hDC, $TRANSPARENT)
  1543.    
  1544.    $tRECT = DllStructCreate($tagRect)
  1545.    DllStructSetData($tRECT, "Left", 5)
  1546.    DllStructSetData($tRECT, "Top", 5)
  1547.    DllStructSetData($tRECT, "Right", 250)
  1548.    DllStructSetData($tRECT, "Bottom", 50)
  1549.    
  1550.    _WinAPI_DrawText($hDC, "Loot Area", $tRect, 0)
  1551. EndFunc
  1552.  
  1553. Func DrawLog()
  1554.    $Width = 475
  1555.    $Height = 200
  1556.    $LogGUI = GUICreate("", $Width, $Height, 1920 - $Width - 5, 1080 - $Height - 5, $WS_POPUPWINDOW, BitOR($WS_EX_LAYERED, BitOr($WS_EX_TOOLWINDOW, $WS_EX_TRANSPARENT)))
  1557.    GuiSetBkColor(0x000000)
  1558.    _WinAPI_SetLayeredWindowAttributes($LogGUI, 0xEEEEEF, 0xEE) ;0xA0
  1559.    WinSetOnTop($LogGUI, "", 1)
  1560.    GuiSetState()
  1561.    
  1562.    $Label = GUICtrlCreateLabel("", 0, 10, $Width, 100, $SS_CENTER)
  1563.    GUICtrlSetFont($Label, 8, 500, 0, "")
  1564.    GuiCtrlSetColor($Label, 0xFFFFFF)
  1565.    
  1566.    $LogList = GUICtrlCreateList("", 5, 60, $Width - 10, $Height - 60, $LBS_NOSEL)
  1567.    GUICtrlSetColor($LogList, 0x000000)
  1568.    GUICtrlSetFont($LogList, 8)
  1569.    
  1570.    RefreshStats()
  1571. EndFunc
  1572.  
  1573. Func RefreshStats()
  1574.    If $ShowLog = True Then
  1575.       GUICtrlSetData($Label, "Start: " & $StartTime & "  |  Runs: " & $Runs & "  |  Closed:  " & $Closed & "  |  Deaths: " & $Deaths & "  |  Disconnects: " & $Disconnects & @LF & @LF & "Legendaries: " & $Legendaries & "  |  Sets: " & $Sets & "  |  Rares: " & $Rares & "  |  Magics: " & $Magics & "  |  Tomes: " & $Tomes & "  |  Gems: " & $Gems & "  |  Sold: " & $Sold)
  1576.    EndIf
  1577. EndFunc
  1578.  
  1579. Func ToLog($Text)
  1580.    If $ShowLog = True Then
  1581.       GUICtrlSetData($LogList, "<" & @Hour & ":" & @MIN & ":" & @SEC & "> " & $Text)
  1582.       GUICtrlSendMsg($LogList, $WM_VSCROLL, $SB_LINEDOWN, 0)
  1583.    
  1584.       FileWriteLine($Log, "<" & @Hour & ":" & @MIN & ":" & @SEC & "> " & $Text)
  1585.       If $Text = "Bot closed" Then
  1586.          FileWriteLine($Log, @LF)  
  1587.       EndIf
  1588.    EndIf
  1589. EndFunc
  1590.  
  1591. Func Relog()
  1592.    ToLog("Relogging...")
  1593.    MouseClick("LEFT", $PasswordField[0], $PasswordField[1], 1, 5)
  1594.    Send($Password)
  1595.    
  1596.    Sleep(1000 + $Computerlag)
  1597.    Send("{ENTER}")
  1598.    
  1599.    $DisconnectState = 0
  1600. EndFunc
  1601.  
  1602. Func SaveStats()
  1603.    $File = FileOpen($SaveLogsPath & "statistics.txt", 1)
  1604.    FileWriteLine($File, "=========" & @HOUR & ":" & @MIN & ":" & @SEC & "=========")
  1605.    FileWriteLine($File, "Startime: " & @TAB & @TAB & $StartTime & @LF & "Runs: " & @TAB & @TAB & $Runs & @LF & "Closed: " & @TAB & @TAB & $Closed & @LF & "Deaths: " & @TAB & @TAB & $Deaths & @LF & "Disconnects: " & @TAB & $Disconnects & @LF & "Runtime: " & @TAB & @TAB & $Runtime & @LF & @LF & "Legendaries: " & @TAB & $Legendaries & @LF & "Sets: " & @TAB & @TAB & $Sets & @LF & "Rares: " & @TAB & @TAB & $Rares & @LF & "Magics: " & @TAB & @TAB & $Magics & @LF & "Tomes: " & @TAB & @TAB & $Tomes & @LF & "Gems: " & @TAB & @TAB & $Gems & @LF & "Sold: " & @TAB & @TAB & $Sold)
  1606.    FileWriteLine($File, @LF)
  1607.    FileClose($File)
  1608. EndFunc
  1609.  
  1610. Func Move($x, $y)
  1611.    MouseClick('MIDDLE', $x, $y, 1, 5)
  1612. EndFunc
  1613.  
  1614. Func Attack($x, $y)
  1615.    Send("{SHIFTDOWN}")
  1616.    MouseClick('LEFT', $x, $y, 1, 2)
  1617.    Send("{SHIFTUP}")
  1618. EndFunc
  1619.  
  1620. Func AttackNearbyMonsters()
  1621.    $Logged = False
  1622.    While 1
  1623.       $MonsterData =  PixelSearch($CharHitBox[0], $CharHitBox[1], $CharHitBox[2], $CharHitBox[3], 0xEE0000, 10)
  1624.       If @error Then
  1625.          ExitLoop
  1626.       EndIf
  1627.      
  1628.       If $Logged = False Then
  1629.          ToLog("Monster found...")
  1630.       EndIf
  1631.      
  1632.       Send("{4}")
  1633.       Sleep(300)
  1634.      
  1635.       Attack($MonsterData[0], $MonsterData[1])
  1636.       Sleep(100)
  1637.      
  1638.       $Logged = True
  1639.    WEnd
  1640. EndFunc
  1641.  
  1642. Func LeaveGame()
  1643.    ToLog("Leaving the game")
  1644.      
  1645.    Sleep(1000 + $ComputerLag)
  1646.    
  1647.    Send("{ESC}")
  1648.    Sleep(200)
  1649.    
  1650.    MouseClick('LEFT', $LeaveButton[0], $LeaveButton[1], 1, 5)
  1651.    Sleep(1250 + $Computerlag)
  1652.    Return "LeftGame"
  1653. EndFunc
  1654.  
  1655. Func Terminate()
  1656.    ToLog("Terminating... Good bye :)")
  1657.    Exit 0
  1658. EndFunc
  1659.  
  1660. Func _ImageSearchArea($FindImage,$ResultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $Tolerance)
  1661.     If $Tolerance > 0 Then $FindImage = "*" & $Tolerance & " " & $FindImage
  1662.        
  1663.     If @AutoItX64 Then
  1664.          $Result = DllCall("ImageSearchDLL_x64.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$FindImage)
  1665.       Else
  1666.          $Result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$FindImage)
  1667.       EndIf
  1668.      
  1669.    If $Result = "0" Then Return 0
  1670.      
  1671.    $Array = StringSplit($Result[0],"|")
  1672.    
  1673.    If(UBound($Array) >= 4) Then
  1674.       $x=Int(Number($Array[2]))
  1675.       $y=Int(Number($Array[3]))
  1676.      
  1677.       If $ResultPosition=1 Then
  1678.          $x=$x + Int(Number($Array[4])/2)
  1679.          $y=$y + Int(Number($Array[5])/2)
  1680.       Endif
  1681.       Return 1
  1682.    EndIf
  1683. EndFunc
  1684.  
  1685. Func OnAutoItExit()
  1686.    $Sek     = Floor(TimerDiff($RuntimeTimer) / 1000)
  1687.    $Min     = Floor($Sek / 60)
  1688.    $Hour    = Floor($Min / 60)
  1689.    $Runtime = $Hour & "h " & ($Min - $Hour * 60) & "m " & ($Sek - $Min * 60) & "s"
  1690.    If $SaveStats = True Then
  1691.       SaveStats()
  1692.    EndIf
  1693.    ToLog("Bot closed")
  1694. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement