Advertisement
zEEneXx

farming_sarkoth_dank_cellar_wd_1.1d_zeenexx

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