Advertisement
Guest User

Sarkoth Farmer

a guest
Jun 18th, 2012
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 30.92 KB | None | 0 0
  1. #include <ImageSearch.au3>
  2. #include <WindowsConstants.au3>
  3. #include <Misc.au3>
  4. #Include <WinAPI.au3>
  5. #include <File.au3>
  6. #include <Date.au3>
  7.  
  8. Global $ImageFiles[6][5]
  9. Global $SoundFiles[6]
  10. Global $PasswordField[2]
  11. Global $ResumeButton[2]
  12. Global $LeaveButton[2]
  13. Global $DisconnectButton[2]
  14. Global $GameLobbyCode[3]
  15. Global $GameScreenCode[3]
  16. Global $MoveToCellar1[2]
  17. Global $MoveToCellar2[2]
  18. Global $MoveToCellar3[2]
  19. Global $MoveInCellar1[2]
  20. Global $MoveInCellar2[2]
  21. Global $MoveToGoldLoot1[2]         
  22. Global $MoveToGoldLoot2[2]         
  23. Global $MoveToGoldLoot3[2] 
  24. Global $MoveToMerchant[2]
  25. Global $MoveToStash1[2]
  26. Global $MoveToStash2[2]
  27. Global $CellarLocation[2]  
  28. Global $MonsterLocation[2]
  29. Global $MerchantLocation[2]
  30. Global $StashLocation[2]
  31. Global $PortalLocation[2]
  32. Global $CharHitBox[4]
  33. Global $MonsterSearchArea[4]
  34. Global $LootingArea[4]
  35. Global $FullBagSearchArea[4]
  36. Global $SellItemsArea[4]
  37. Global $FullStashSearchArea[4]
  38. Global $RepairSearchArea[4]
  39. Global $DeathSearchArea[4]
  40. Global $DisconnectSearchArea[4]
  41. Global $StashBag2[2]
  42. Global $StashBag3[2]
  43. Global $RepairButton[2]
  44. Global $AllItemsButton[2]
  45. Global $CellarOffset
  46. Global $CellarPixel
  47. Global $Paused
  48. Global $runtimeHour, $runtimeMins, $runtimeSecs, $runtime, $sruntime
  49. Global $runtimeinit = TimerInit()
  50. Global $CellerRunTime = TimerInit()
  51. Global $wintitle="Diablo III"
  52. Global $winhandle=Wingethandle($wintitle)
  53. Global $ingamewait
  54.  
  55. ;///////////////////////////////////////--CONFIG--////////////////////////////////////////////////////////////////////////////////
  56. ;                                                                                                                               //
  57. ;                                       Important                                                                               //
  58. $ComputerLag        = 0                                         ;Increase this in steps of 400 if you have slow loading times   //
  59. $MoveDelay          = 0                                         ;Increase this in steps of 100 if you have movement issues      //
  60. $LootDelay          = 0                                         ;Increase this in steps of 200 if you have looting issues       //
  61. $ImgDir             = "C:\Users\Administrator\Desktop\Am\"      ;Location of the image folder                                   //
  62. ;                                                                                                                               //
  63. ;                                       Functions                                                                               //
  64. $Repair             = True                                      ;Orders the bot to repair when items are damaged                //
  65. $Sell               = True                                      ;Orders the bot to sell magic items when bag is full            //
  66. $UseStash           = True                                      ;Orders the bot to put gems and rare items into the stash       //
  67. $HighGoldRadius     = False                                     ;Set this to true if you have more than +18 gold radius         //
  68. ;                                                                                                                               //
  69. ;                                     Miscellaneous                                                                             //
  70. $Sounds             = False                                     ;Enable pickup sounds                                           //
  71. $SoundsDir          = "C:\Users\Administrator\Desktop\Am\"      ;Location of the sounds folder                                  //
  72. $ShowLootArea       = True                                      ;Shows lootarea                                                 //
  73. $ShowStatTooltip    = True                                      ;Shows statistics from current session                          //
  74. ;                                                                                                                               //
  75. ;                                      Relogging                                                                                //                                 
  76. $UseRelogging       = False                                     ;Enable Relogging                                               //
  77. $Password           = "XXXXXXXX"                                ;Your password                                                  //
  78. ;                                                                                                                               //
  79. ;                                                                                                                               //
  80. ;                                        Looting                                                                                //
  81. $LootLegendaries    = True                                      ;Loot legendary items                                           //
  82. $LootSets           = True                                      ;Loot set items                                                 //
  83. $LootRares          = True                                      ;Loot rare items                                                //
  84. $LootMagics         = True                                      ;Loot magic items (includes tomes)                              //
  85. $LootTomes          = True                                      ;Loot tomes                                                     //
  86. $LootGems           = True                                      ;Loot gems                                                      //
  87. ;                                                                                                                               //
  88. ;      <<<Changes below have an significant impact on the needed time for one run>>>                                            //
  89. ;                                                                                                                               //
  90. $RareLootAmount     = 2                                         ;Amount of rare items to loot                                   //
  91. $MagicLootAmount    = 3                                         ;Amount of magic items to loot (including tomes)                //
  92. $TomeLootAmount     = 1                                         ;Amount of tomes to loot                                        //
  93. $GemLootAmount      = 2                                         ;Amount of gems to loot                                         //
  94. ;                                                                                                                               //
  95. $LootingArea[0]     = 600                                       ;Left   (lower -> bigger)                                       //
  96. $LootingArea[1]     = 250                                       ;Top    (lower -> bigger)                                       //
  97. $LootingArea[2]     = 1350                                      ;Right  (higher -> bigger)                                      //
  98. $LootingArea[3]     = 700                                       ;Bot    (higher -> bigger)                                      //
  99. ;                                                                                                                               //
  100. ;/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  101.  
  102. $ImageFiles[0][0]           = "legendaryA.png|110"
  103. $ImageFiles[0][1]           = "legendaryE.png|110"
  104. $ImageFiles[0][2]           = "legendaryI.png|110"
  105. $ImageFiles[0][3]           = "legendaryO.png|110"
  106. $ImageFiles[0][4]           = "legendaryU.png|110"
  107. $ImageFiles[1][0]           = "setA.png|110"
  108. $ImageFiles[1][1]           = "setE.png|110"
  109. $ImageFiles[1][2]           = "setU.png|110"
  110. $ImageFiles[1][3]           = "setO.png|110"
  111. $ImageFiles[1][4]           = "setI.png|110"
  112. $ImageFiles[2][0]           = "rareA.png|110"
  113. $ImageFiles[2][1]           = "rareE.png|110"
  114. $ImageFiles[2][2]           = "rareI.png|110"
  115. $ImageFiles[2][3]           = "rareO.png|110"
  116. $ImageFiles[2][4]           = "rareU.png|110"
  117. $ImageFiles[3][0]           = "blueA.png|250"
  118. $ImageFiles[3][1]           = "blueE.png|250"
  119. $ImageFiles[3][2]           = "blueI.png|250"
  120. $ImageFiles[3][3]           = "blueO.png|250"
  121. $ImageFiles[3][4]           = "blueU.png|250"
  122. $ImageFiles[4][0]           = "tome.png|200"
  123. $ImageFiles[4][1]           = "uare.png|110"
  124. $ImageFiles[5][0]           = "you.png|100"
  125. $ImageFiles[5][1]           = "sellNew.png|55"
  126. $ImageFiles[5][2]           = "sell1x1.png|50"
  127. $ImageFiles[5][3]           = "not.png|120"
  128.  
  129. $SoundFiles[0]              = "legendary.wav"
  130. $SoundFiles[1]              = "set.wav"
  131. $SoundFiles[2]              = "rare.wav"
  132. $SoundFiles[3]              = "magic.wav"
  133. $SoundFiles[4]              = "tome.wav"
  134. $SoundFiles[5]              = "gem.wav"
  135.  
  136. $PasswordField[0]           = 820
  137. $PasswordField[1]           = 705
  138.  
  139. $ResumeButton[0]            = 319
  140. $ResumeButton[1]            = 416
  141.  
  142. $LeaveButton[0]             = 969
  143. $LeaveButton[1]             = 582
  144.  
  145. $DisconnectButton[0]        = 960
  146. $DisconnectButton[1]        = 630
  147.  
  148. $GameLobbyCode[0]           = 319
  149. $GameLobbyCode[1]           = 416
  150. $GameLobbyCode[2]           = 4065536
  151.  
  152. $GameScreenCode[0]          = 1119
  153. $GameScreenCode[1]          = 1044
  154. $GameScreenCode[2]          = 0xDEFDFE
  155.  
  156. $MoveToCellar1[0]           = 500
  157. $MoveToCellar1[1]           = 250
  158. $MoveToCellar2[0]           = 1
  159. $MoveToCellar2[1]           = 370
  160. $MoveToCellar3[0]           = 400
  161. $MoveToCellar3[1]           = 600  
  162.  
  163. $MoveInCellar1[0]           = 116
  164. $MoveInCellar1[1]           = 986          
  165. $MoveInCellar2[0]           = 776
  166. $MoveInCellar2[1]           = 328
  167.  
  168. $MoveToGoldLoot1[0]         = 577
  169. $MoveToGoldLoot1[1]         = 306
  170. $MoveToGoldLoot2[0]         = 1260
  171. $MoveToGoldLoot2[1]         = 351
  172. $MoveToGoldLoot3[0]         = 911
  173. $MoveToGoldLoot3[1]         = 694
  174.  
  175. $MoveToMerchant[0]          = 1690
  176. $MoveToMerchant[1]          = 102
  177.  
  178. $MoveToStash1[0]            = 780
  179. $MoveToStash1[1]            = 950
  180. $MoveToStash2[0]            = 270
  181. $MoveToStash2[1]            = 930
  182.  
  183. $CellarLocation[0]          = 307
  184. $CellarLocation[1]          = 74
  185.  
  186. $MonsterLocation[0]         = 577
  187. $MonsterLocation[1]         = 183
  188.  
  189. $MerchantLocation[0]        = 930
  190. $MerchantLocation[1]        = 136
  191.  
  192. $StashLocation[0]           = 805
  193. $StashLocation[1]           = 430
  194.  
  195. $PortalLocation[0]          = 650
  196. $PortalLocation[1]          = 500
  197.  
  198. $CharHitBox[0]              = 790
  199. $CharHitBox[1]              = 315
  200. $CharHitBox[2]              = 1200
  201. $CharHitBox[3]              = 730
  202.  
  203. $MonsterSearchArea[0]       = 150
  204. $MonsterSearchArea[1]       = 20
  205. $MonsterSearchArea[2]       = 1248
  206. $MonsterSearchArea[3]       = 446
  207.  
  208. $FullBagSearchArea[0]       = 795
  209. $FullBagSearchArea[1]       = 125
  210. $FullBagSearchArea[2]       = 830
  211. $FullBagSearchArea[3]       = 160
  212.  
  213. $SellItemsArea[0]           = 1460
  214. $SellItemsArea[1]           = 585
  215. $SellItemsArea[2]           = 1900
  216. $SellItemsArea[3]           = 875
  217.  
  218. $FullStashSearchArea[0]     = 700
  219. $FullStashSearchArea[1]     = 135
  220. $FullStashSearchArea[2]     = 730
  221. $FullStashSearchArea[3]     = 155
  222.  
  223. $RepairSearchArea[0]        = 1507
  224. $RepairSearchArea[1]        = 36
  225. $RepairSearchArea[2]        = 1512
  226. $RepairSearchArea[3]        = 41
  227.  
  228. $DeathSearchArea[0]         = 538
  229. $DeathSearchArea[1]         = 335
  230. $DeathSearchArea[2]         = 542
  231. $DeathSearchArea[3]         = 339
  232.  
  233. $DisconnectSearchArea[0]    = 840
  234. $DisconnectSearchArea[1]    = 410
  235. $DisconnectSearchArea[2]    = 950
  236. $DisconnectSearchArea[3]    = 440
  237.  
  238. $StashBag2[0]               = 510
  239. $StashBag2[1]               = 360
  240.  
  241. $StashBag3[0]               = 510
  242. $StashBag3[1]               = 490
  243.  
  244. $RepairButton[0]            = 517
  245. $RepairButton[1]            = 483
  246.  
  247. $AllItemsButton[0]          = 223
  248. $AllItemsButton[1]          = 592
  249.  
  250. $CellarOffset               = 33
  251.  
  252. $RareLootAttempts           = 0
  253. $MagicLootAttempts          = 0
  254. $TomeLootAttempts           = 0
  255. $GemLootAttempts            = 0
  256.  
  257. $StartTime                  = @HOUR & ":" & @MIN & " Uhr"
  258. $Runs                       = 0
  259. $Closed                     = 0
  260. $Runtime                    = "0h 0m 0s"
  261. $Disconnects                = 0
  262.  
  263. $Legendaries                = 0
  264. $Sets                       = 0
  265. $Rares                      = 0
  266. $Magics                     = 0
  267. $Gems                       = 0
  268. $Tomes                      = 0
  269. $Sold                       = 0
  270.  
  271. $ISx                        = 0
  272. $ISy                        = 0
  273. $StashBag                   = 1
  274. $DisconnectState            = 0
  275. $FullBag                    = False
  276.  
  277. $LootingAreaWidth           = $LootingArea[2] - $LootingArea[0]
  278. $LootingAreaHeight          = $LootingArea[3] - $LootingArea[1]
  279.  
  280. If $ShowLootArea = True Then
  281.    DrawLootArea()  
  282. EndIf    
  283.  
  284. Opt('MouseCoordMode', 2)
  285. Opt('PixelCoordMode', 2)
  286.  
  287. HotKeySet('=', 'Pause')
  288. HotKeySet('{END}', 'Terminate')
  289.  
  290. Pause()
  291.  
  292.    ;Logging Var
  293.    $Deaths=0
  294.    $Repairs=0
  295.    $Found=0
  296.    $NotFound=0
  297. Global $RunNum=0
  298.    $Leave = False
  299.    $Dead = False
  300.    $Window = False
  301.    $Logout = False
  302.    $i = 0
  303.    $CellarClickFail=False
  304.    $default_resolutionX = 1920
  305.    $default_resolutionY = 1080
  306.    $x_ratio = @Desktopwidth / $default_resolutionX
  307.    $y_ratio = @Desktopheight / $default_resolutionY
  308.    $gX = 0
  309.    $gY = 0
  310.    $gX0 = 0
  311.    $gY0 = 0
  312.  
  313. WinActivate('Diablo III')
  314. While 1
  315.    If WinActive('Diablo III') Then
  316.  
  317. If $ShowStatTooltip = True Then
  318.    $RunNum = $Found + $NotFound
  319.    $Repairp = $Repairs / $RunNum
  320.    $DeathsP = $Deaths / $RunNum
  321.    $FoundP = $Found /  $RunNum
  322.    $NotfoundP = $NotFound / $RunNum
  323.    ToolTip("Runs: " & $Runs & @CRLF & "Found: " & $Found & " (" & Round($FoundP * 100,.00) & "%" & ")" & @CRLF & "Not Found: " & $NotFound & " (" & Round($NotFoundP * 100,.00) & "%" & ")"& _
  324.    @CRLF & "Deaths: " & $Deaths &  " (" & Round($DeathsP * 100,.00) & "%" & ")"& @CRLF & "Legendaries: " & $Legendaries & @CRLF & "Sets: " & $Sets & @CRLF & "Rares: " & $Rares & @CRLF & "Magics: " & $Magics & @CRLF & "Tomes: " & $Tomes & @CRLF & "Gems: " & $Gems & @CRLF & "Sold: " & $Sold & @CRLF & "Repairs: " & $Repairs &  " (" & Round($RepairP * 100,.00) & "%" & ")", 20, 20, "Run Time: " & Call("Update_Time",$runtimeinit), 1)
  325. EndIf
  326.  
  327.       While $DisconnectState < 2
  328.       For $i = 18 To 0 step -1
  329.          If InGameLobby() Then
  330.             ExitLoop
  331.          EndIf
  332.          
  333.          Sleep(500)
  334.          If $i == 1 Then
  335.             CheckForDisconnectState()
  336.             Sleep(500 + $Computerlag)
  337.          EndIf
  338.       Next
  339.      
  340.       MouseClick('LEFT', $ResumeButton[0], $ResumeButton[1], 1, 5)
  341.       Sleep(1250 + $Computerlag)
  342.      
  343.       For $i = 20 To 0 step -1
  344.          If InGameplayScreen() Then
  345.             $DisconnectState = 0
  346.             ExitLoop
  347.          EndIf
  348.          
  349.          Sleep(500)
  350.          If $i == 1 Then
  351.             CheckForDisconnectState()
  352.             Sleep(500 + $Computerlag)
  353.          EndIf
  354.       Next
  355.      
  356.       If $DisconnectState = 2 Then
  357.          If $UseRelogging = True Then
  358.             Relog()
  359.          Else
  360.             Terminate()
  361.          EndIf
  362.       Else
  363.          If $DisconnectState = 0 Then
  364.             ExitLoop
  365.          EndIf
  366.       EndIf
  367.       WEnd
  368.  
  369.       MouseClick("middle", Round(0 * $x_ratio),Round(250 * $y_ratio)) ;starts the main run
  370.       Send("{3 down}")
  371.       Sleep(1900)
  372.       Send("{3 up}")
  373.       send("1")
  374.       MouseMove(Round(255*$x_ratio),Round(290*$y_ratio),1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
  375.       Sleep(500)
  376.       Sleep(250)
  377.       Call("CheckForDeath")
  378.  
  379.       If $Window Then
  380.          Call("InputReqScrn")
  381.          $Window = False
  382.          ExitLoop
  383.       ElseIf $Dead or $Logout Then
  384.          ExitLoop
  385.       EndIf
  386.  
  387.       $Pixel2 = PixelSearch(0,0,Round(600 * $x_ratio),Round(400 * $y_ratio),0x334FB7,6) ;searches for the specific blue pixel that only occurs when mouse hovers over open cellar
  388.       If Not @error Then
  389.          MouseClick("left",Round(255*$x_ratio),Round(290*$y_ratio)) ;Entrance to cellar
  390.          Cellarwait()
  391.          If $CellarClickFail=true Then
  392.            ExitLoop
  393.          Endif
  394.          
  395.          MouseClick("middle",Round(20*$x_ratio),Round(708*$y_ratio)) ;moves to doorway leading to rare inside cellar
  396.          Sleep(3100)
  397.          MouseMove(Round(440*$x_ratio),Round(80*$y_ratio),1) ;hovers over the rare Sarkoth
  398.          Send(4)
  399.          Sleep(600)
  400.          Send("{SHIFTDOWN}")
  401.          MouseDown("right") ;attack middle
  402.          Sleep(3300)
  403.          ;MouseMove(Round(521 * $x_ratio),Round(260 * $y_ratio),1) ;attack left, add more sleep time if you can't kill minion on left
  404.          MouseUP("right")
  405.          ;MouseClick("right",Round(620*$x_ratio),Round(20*$y_ratio),2) ;break the table & chair
  406.          Sleep(10)
  407.          Send("{SHIFTUP}")
  408.          MouseClick("right",694,929) ;cancel archon
  409.          Sleep(400)
  410.          Call("Logs","killed")
  411.       Else
  412.          OhShit()
  413.          If Not $Logout And Not $Dead And Not $Window Then
  414.             Sleep(300)
  415.             Call("CheckForDeath")
  416.             LeaveGame()
  417.             If Not $Logout Then
  418.                Call("InputReqScrn")
  419.             EndIf
  420.          Else
  421.             Call("InputReqScrn")
  422.             $Window = False ; reset the flag so it doesn't think a window is always up
  423.          Endif
  424.       Endif
  425.  
  426.       If $HighGoldRadius = True Then
  427.          Move($MoveToGoldLoot1[0], $MoveToGoldLoot1[1])
  428.          Sleep(250 + $MoveDelay)
  429.          AttackNearbyMonsters()
  430.       Else
  431.          Move(402, 306)
  432.          Sleep(250 + $MoveDelay)
  433.          AttackNearbyMonsters()
  434.          Move($MoveToGoldLoot2[0], $MoveToGoldLoot2[1])
  435.          Sleep(250 + $MoveDelay)
  436.          AttackNearbyMonsters()
  437.          Move($MoveToGoldLoot3[0], $MoveToGoldLoot3[1])
  438.          Sleep(250 + $MoveDelay)
  439.          AttackNearbyMonsters()
  440.       EndIf
  441.      
  442.       MouseMove(120, 120, 2)
  443.       Sleep(100)
  444.      
  445.       If $LootSets Then
  446.          LootSets()
  447.       EndIf
  448.      
  449.       If $LootLegendaries Then
  450.          LootLegendaries()
  451.       EndIf
  452.      
  453.       If $LootRares Then
  454.          LootRares()
  455.          $RareLootAttempts = 0
  456.       EndIf
  457.      
  458.       If $LootMagics Then
  459.          LootMagics()
  460.          $MagicLootAttempts = 0
  461.       Else
  462.          If $LootTomes Then
  463.             LootTomes()
  464.             $TomesLootAttempts = 0
  465.          EndIf
  466.       EndIf
  467.      
  468.       If $LootGems Then
  469.          LootGems()
  470.          $GemLootAttempts = 0
  471.       EndIf
  472.      
  473.       If CheckForDeath() Then
  474.          ContinueLoop
  475.       EndIf
  476.      
  477.       Sleep(500)
  478.       Send("{t}")
  479.       Sleep(7000 + $Computerlag)
  480.      
  481.       If $Repair Then
  482.          RepairItems()
  483.       EndIf
  484.      
  485.       LeaveGame()
  486.       Sleep(1000 + $Computerlag)
  487.    EndIf
  488. WEnd
  489.  
  490. Func InputReqScrn()
  491.    Menuwait()
  492.    MouseClick("left", Round(198*$x_ratio),Round(417*$y_ratio)) ;button to resume game from main menu
  493.    Ingamewait()
  494.    $Target = _ImageSearchArea($ImgDir & "DisconnectError.png",1,0,0,@DesktopHeight,@DesktopWidth,$gX0,$gY0,0)
  495.    If $Target And ($gX > 15) And ($gY > 15) Then
  496.       sleep(1500)
  497.       MouseClick("left", Round(960*$y_ratio), Round(635*$x_ratio), 50 ,10)
  498.       Sleep(Random(1000, 2000))
  499.       MouseClick("left", Round(198*$x_ratio),Round(417*$y_ratio)) ;button to resume game from main menu
  500.       $gX0 = 0
  501.       $gY0 = 0
  502.       Ingamewait()
  503.    EndIf
  504. EndFunc
  505.  
  506. Func Menuwait()
  507.    $menuwait=0
  508.    Do
  509.       sleep(100)
  510.       $menuwait=$menuwait+1
  511.       PixelSearch(1630*$x_ratio ,990*$y_ratio, 1660*$x_ratio ,1030*$y_ratio, 0xAF681B, 20, 1, $winhandle) ; wait for that helmet button to appear
  512.    Until (Not @Error OR $menuwait=100)
  513.  
  514.    If $menuwait=100 Then
  515.       send("{ESC}")
  516.       sleep(2000)
  517.       send("{ESC}")
  518.       $menuwait=0
  519.    EndIf
  520.    $menuwait=0
  521.    sleep(100)
  522.  EndFunc
  523.  
  524. Func Ingamewait()
  525.    Do
  526.       sleep(100)
  527.       $ingamewait=$ingamewait+1
  528.       PixelSearch(1100*$x_ratio ,1000*$y_ratio,1140*$x_ratio ,1060*$y_ratio, 0x426AFA, 20, 1, $winhandle) ; wait for blue townportalbutton to appear
  529.    Until (Not @Error OR $ingamewait=100)
  530.    $ingamewait=0
  531.    sleep(200)
  532. EndFunc
  533.  
  534. Func Cellarwait()
  535.    $menuwait=0
  536.    Do
  537.       sleep(100)
  538.       $menuwait=$menuwait+1
  539.       PixelSearch(811*$x_ratio ,222*$y_ratio, 900*$x_ratio ,320*$y_ratio, 0xFDFD34, 40, 1, $winhandle) ; wait for the light of the lamp next to the entrance appears
  540.    Until (Not @Error OR $menuwait=100)
  541.    If $menuwait=100 Then
  542.       OhShit()
  543.       $CellarClickFail=True
  544.       $menuwait=0
  545.    EndIf
  546. EndFunc
  547.  
  548. Func OhShit()
  549.    mousemove(962,518,1)
  550.    Send("4")
  551.    Sleep(620)
  552.    send("2")
  553.    Sleep(400)
  554.    send("{SHIFTDOWN}")
  555.    sleep(200)
  556.    Mouseclick("left")
  557.    sleep(300)
  558.    send("{SHIFTUP}")
  559.    sleep(400)
  560.    Send("t")
  561.    Sleep(7000)
  562.    Call("CheckForDeath")
  563.    Call("Logs","notpresent")
  564. EndFunc
  565.  
  566. Func Logs($LogStats)
  567.    $Sarkothkill=Iniread("Sarkoth.ini","Misc","Sarkothkill",0)
  568.    $Sarkothnotfound=Iniread("Sarkoth.ini","Misc","Sarkothnotfound",0)
  569.    $Died=Iniread("Sarkoth.ini","Misc","Died",0)
  570.    $Repair=Iniread("Sarkoth.ini","Misc","Repair",0)
  571.    $RunNum = $Found + $NotFound
  572.    $Repairp = $Repairs / $RunNum
  573.    $DeathsP = $Deaths / $RunNum
  574.    $FoundP = $Found /  $RunNum
  575.    $NotfoundP = $NotFound / $RunNum
  576.  
  577.    If $LogStats = "repair" Then
  578.       _FileWriteLog("Botlog.txt", "Repaired Items, it took " & Call("Update_Time",$CellerRunTime))
  579.       $Repairs=$Repairs+1
  580.       $Repair=$Repair+1
  581.       $NotFound=$NotFound+1
  582.       $Sarkothnotfound=$Sarkothnotfound+1
  583.       IniWrite("Sarkoth.ini","Misc","Died",$Repair)
  584.       IniWrite("Sarkoth.ini","Misc","Sarkothnotfound",$Sarkothnotfound)
  585.    ElseIf $LogStats = "dead" then
  586.       _FileWriteLog("Botlog.txt", "Oh my you have died, it took " & Call("Update_Time",$CellerRunTime))
  587.       $Died=$Died+1
  588.       $Sarkothnotfound=$Sarkothnotfound+1
  589.       $Deaths=$Deaths+1
  590.       $NotFound=$NotFound+1
  591.       IniWrite("Sarkoth.ini","Misc","Died",$Died)
  592.       IniWrite("Sarkoth.ini","Misc","Sarkothnotfound",$Sarkothnotfound)
  593.    ElseIf $LogStats = "killed" then
  594.       _FileWriteLog("Botlog.txt", "Sarkoth down, it took " & Call("Update_Time",$CellerRunTime))
  595.       $Sarkothkill=$Sarkothkill+1
  596.       $Found=$Found+1
  597.       IniWrite("Sarkoth.ini","Misc","Sarkothkill",$Sarkothkill)
  598.    ElseIf $LogStats = "notpresent" then
  599.       _FileWriteLog("Botlog.txt", "Cellar Not Found, it took " & Call("Update_Time",$CellerRunTime))
  600.       $Sarkothnotfound=$Sarkothnotfound+1
  601.       $Notfound=$NotFound+1
  602.       IniWrite("Sarkoth.ini","Misc","Sarkothnotfound",$Sarkothnotfound)
  603.    ElseIf $LogStats = "stoped" Then
  604.       _FileWriteLog("Botlog.txt",  @CRLF & "************************************************" & @CRLF & _
  605.       "Dave's Dank Celler" & @CRLF & "Run has completed in:  " & Call("Update_Time",$runtimeinit) & @CRLF & _
  606.       "Total Cellars Found: " & $Found & " (" & Round($FoundP * 100,.00) & "%" & ")" & @CRLF & "Total Cellars Not Found: " & $NotFound & " (" & Round($NotFoundP * 100,.00) & "%" & ")" & @CRLF & "Totals Deaths: " & $Deaths &  " (" & Round($DeathsP * 100,.00) & "%" & ")" & @CRLF & _
  607.       "Total Repairs: " & $Repairs &  " (" & Round($RepairP * 100,.00) & "%" & ")" & @CRLF & "************************************************")
  608.    Endif
  609. EndFunc
  610.  
  611. ;Loot
  612. Func LootLegendaries()
  613.    For $gI = 0 to 4
  614.       $array = StringSplit($ImageFiles[0][$gI],"|")
  615.       $file = $array[1]
  616.       $accuracy = $array[2]
  617.    
  618.       $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
  619.       If $target = 1 Then
  620.          If $Sounds = True Then
  621.             SoundPlay($SoundsDir & $SoundFiles[0], 0)
  622.          EndIf
  623.          $Legendaries+=1
  624.          MouseClick("LEFT", $ISx, $ISy, 1, 1)
  625.          Sleep(300 + $LootDelay)
  626.          MouseMove(120, 120, 2)
  627.          Sleep(100)
  628.          If $Sell = True Then
  629.             CheckBagFull()
  630.             If $FullBag = True Then
  631.             $FullBag = False
  632.             Sleep(300)
  633.             LootLegendaries()
  634.             EndIf
  635.          EndIf
  636.       EndIf
  637.    Next
  638. EndFunc
  639.  
  640. Func LootSets()
  641.    For $gI = 0 to 4
  642.       $array = StringSplit($ImageFiles[1][$gI],"|")
  643.       $file = $array[1]
  644.       $accuracy = $array[2]
  645.    
  646.       $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
  647.       If $target = 1 Then
  648.          If $Sounds = True Then
  649.             SoundPlay($SoundsDir & $SoundFiles[1], 0)
  650.          EndIf
  651.          $Sets+=1
  652.          MouseClick("LEFT", $ISx, $ISy, 1, 1)
  653.          Sleep(300 + $LootDelay)
  654.          MouseMove(120, 120, 2)
  655.          Sleep(100)
  656.          If $Sell = True Then
  657.             CheckBagFull()
  658.             If $FullBag = True Then
  659.                $FullBag = False
  660.                Sleep(300)
  661.                LootSets()
  662.             EndIf
  663.          EndIf
  664.       EndIf
  665.    Next  
  666. EndFunc
  667.  
  668. Func LootRares()
  669.    For $gI = 0 to 4
  670.       $array = StringSplit($ImageFiles[2][$gI],"|")
  671.       $file = $array[1]
  672.       $accuracy = $array[2]
  673.    
  674.       $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
  675.       If $target = 1 Then
  676.          If $Sounds = True Then
  677.             SoundPlay($SoundsDir & $SoundFiles[2], 0)
  678.          EndIf
  679.          $Rares+=1
  680.          MouseClick("LEFT", $ISx, $ISy, 1, 1)
  681.          Sleep(300 + $LootDelay)
  682.          MouseMove(120, 120, 2)
  683.          Sleep(100)
  684.          If $Sell = True Then
  685.             CheckBagFull()
  686.             If $FullBag = True Then
  687.                $FullBag = False
  688.                Sleep(300)
  689.                LootRares()
  690.             EndIf
  691.          EndIf
  692.       EndIf
  693.    Next
  694.        
  695.    $RareLootAttempts+=1    
  696.          
  697.    If($RareLootAttempts >= $RareLootAmount) Then
  698.       Return
  699.    Else
  700.       LootRares()
  701.    EndIf
  702. EndFunc
  703.  
  704. Func LootMagics()
  705.    For $gI = 0 to 4
  706.       $array = StringSplit($ImageFiles[3][$gI],"|")
  707.       $file = $array[1]
  708.       $accuracy = $array[2]
  709.    
  710.       $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
  711.       If $target > 0 Then
  712.          If $Sounds = True Then
  713.             SoundPlay($SoundsDir & $SoundFiles[3], 0)
  714.          EndIf
  715.          $Magics+=1
  716.          MouseClick("LEFT", $ISx, $ISy, 1, 1)
  717.          Sleep(300 + $LootDelay)
  718.          MouseMove(120, 120, 2)
  719.          Sleep(100)
  720.          If $Sell = True Then
  721.             CheckBagFull()
  722.             If $FullBag = True Then
  723.                $FullBag = False
  724.                Sleep(300)
  725.                LootMagics()
  726.             EndIf
  727.          EndIf
  728.       EndIf
  729.    Next
  730.  
  731.    $MagicLootAttempts+=1
  732.    
  733.    If($MagicLootAttempts >= $MagicLootAmount) Then
  734.       Return
  735.    Else
  736.       LootMagics()
  737.    EndIf
  738. EndFunc
  739.  
  740. Func LootTomes()
  741.    $array = StringSplit($ImageFiles[4][0],"|")
  742.    $file = $array[1]
  743.    $accuracy = $array[2]
  744.    
  745.    $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
  746.    If $target = 1 Then
  747.       If $Sounds = True Then
  748.             SoundPlay($SoundsDir & $SoundFiles[4], 0)
  749.          EndIf
  750.       $Tomes+=1
  751.       MouseClick("LEFT", $ISx, $ISy, 1, 1)
  752.       Sleep(750 + $LootDelay)
  753.       MouseMove(120, 120, 2)
  754.       Sleep(100)
  755.       If $Sell = True Then
  756.          CheckBagFull()
  757.          If $FullBag = True Then
  758.             $FullBag = False
  759.             Sleep(300)
  760.             LootTomes()
  761.          EndIf
  762.       EndIf
  763.    EndIf
  764.    
  765.    $TomeLootAttempts+=1
  766.          
  767.    If($TomeLootAttempts >= $TomeLootAmount) Then
  768.       Return
  769.    Else
  770.       LootTomes()
  771.    EndIf
  772. EndFunc
  773.    
  774. Func LootGems()
  775.    $array = StringSplit($ImageFiles[4][1],"|")
  776.    $file = $array[1]
  777.    $accuracy = $array[2]
  778.    
  779.    $target = _ImageSearchArea($ImgDir & $file, 1, $LootingArea[0], $LootingArea[1], $LootingArea[2], $LootingArea[3], $ISx, $ISy, $accuracy)
  780.    If $target = 1 Then
  781.       If $Sounds = True Then
  782.             SoundPlay($SoundsDir & $SoundFiles[5], 0)
  783.          EndIf
  784.       $Gems+=1
  785.       MouseClick("LEFT", $ISx, $ISy, 1, 1)
  786.       Sleep(750 + $LootDelay)
  787.       MouseMove(120, 120, 2)
  788.       Sleep(100)
  789.       If $Sell = True Then
  790.          CheckBagFull()
  791.          If $FullBag = True Then
  792.             $FullBag = False
  793.             Sleep(300)
  794.             LootGems()
  795.          EndIf
  796.       EndIf
  797.    EndIf
  798.    
  799.    $GemLootAttempts+=1
  800.          
  801.    If($GemLootAttempts >= $GemLootAmount) Then
  802.       Return
  803.    Else
  804.       LootGems()
  805.    EndIf
  806. EndFunc
  807.  
  808.  
  809. ;Sell, store and repair
  810. Func CheckBagFull()
  811.    $array = StringSplit($ImageFiles[5][0],"|")
  812.    $file = $array[1]
  813.    $accuracy = $array[2]
  814.    
  815.    $target = _ImageSearchArea($ImgDir & $file, 1, $FullBagSearchArea[0], $FullBagSearchArea[1], $FullBagSearchArea[2], $FullBagSearchArea[3], $ISx, $ISy, $accuracy)
  816.    If $target = 1 Then
  817.       $FullBag = True
  818.       SellItems()
  819.    EndIf
  820. EndFunc
  821.  
  822. Func SellItems()
  823.    Sleep(750)
  824.    Send("{t}")
  825.    Sleep(7000 + $Computerlag)
  826.    Move($MoveToMerchant[0] , $MoveToMerchant[1])
  827.    Sleep(2500 + $MoveDelay)
  828.    MouseClick('LEFT', $MerchantLocation[0], $MerchantLocation[1], 1, 10)
  829.    Sleep(2250 + $MoveDelay)
  830.    
  831.    For $gI = 1 to 2
  832.       $array = StringSplit($ImageFiles[5][$gI],"|")
  833.       $file = $array[1]
  834.       $accuracy = $array[2]
  835.  
  836.       For $i = 40 To 0 step -1
  837.          $target = _ImageSearchArea($ImgDir & $file, 1, $SellItemsArea[0], $SellItemsArea[1], $SellItemsArea[2], $SellItemsArea[3], $ISx, $ISy, $accuracy)
  838.          If $target = 1 Then
  839.             $Sold+=1
  840.             MouseClick("RIGHT", $ISx, $ISy, 1, 0)
  841.             Sleep(250)
  842.          EndIf
  843.       Next
  844.    Next
  845.    
  846.    $RareLootAttempts    = 0
  847.    $MagicLootAttempts   = 0
  848.    $TomeLootAttempts    = 0
  849.    $GemLootAttempts     = 0
  850.    
  851.    Move($MoveToStash1[0] , $MoveToStash1[1])
  852.    Sleep(800 + $MoveDelay)
  853.    Move($MoveToStash2[0] , $MoveToStash2[1])
  854.    Sleep(1200 + $MoveDelay)
  855.    If $UseStash = True Then
  856.       ToStash()
  857.       Sleep(200)
  858.       Send("{ESC}")
  859.    EndIf
  860.    Sleep(700)
  861.    MouseClick("LEFT", $PortalLocation[0], $PortalLocation[1], 1, 10)
  862.    Sleep(3000 + $Computerlag)
  863. EndFunc
  864.  
  865. Func ToStash()
  866.    Sleep(300)
  867.    MouseClick("LEFT", $StashLocation[0], $StashLocation[1], 1, 10)
  868.    Sleep(500)
  869.    
  870.    For $x = 0 to 5 step + 1
  871.       For $i = -1 To 8 step + 1
  872.          If $x = 0 Then
  873.             If $i = 8 Then
  874.                Sleep(1)
  875.             Else
  876.                MouseClick("RIGHT", 1527 + ($i*47), 610 + ($x*50), 1, 0)
  877.             EndIf
  878.          Else
  879.             MouseClick("RIGHT", 1480 + ($i*47), 610 + ($x*50), 1, 0)
  880.          EndIf
  881.          Sleep(25)
  882.          CheckStashFull()
  883.          If $UseStash = False Then
  884.             ExitLoop (2)
  885.          EndIf
  886.       Next
  887.    Next
  888. EndFunc
  889.  
  890. Func CheckStashFull()
  891.    $array = StringSplit($ImageFiles[5][3],"|")
  892.    $file = $array[1]
  893.    $accuracy = $array[2]
  894.    
  895.    $target = _ImageSearchArea($ImgDir & $file, 1, $FullStashSearchArea[0], $FullStashSearchArea[1], $FullStashSearchArea[2], $FullStashSearchArea[3], $ISx, $ISy, $accuracy)
  896.    If $target = 1 Then
  897.       Switch $StashBag
  898.       Case 1
  899.          Sleep(200)
  900.          MouseClick("LEFT", $StashBag2[0], $StashBag2[1], 1, 5)
  901.          $StashBag = 2
  902.          Sleep(5000)
  903.       Case 2
  904.          Sleep(200)
  905.          MouseClick("LEFT", $StashBag3[0], $StashBag3[1], 1, 5)
  906.          $StashBag = 3
  907.          Sleep(5000)
  908.       Case 3
  909.          $UseStash = False
  910.       EndSwitch
  911.    EndIf
  912. EndFunc
  913.  
  914. Func RepairItems()
  915.    If Not CheckForRepair() Then
  916.       Return
  917.    EndIf
  918.    Move($MoveToMerchant[0] , $MoveToMerchant[1])
  919.    Sleep(2500 + $MoveDelay)
  920.    MouseClick('LEFT', $MerchantLocation[0], $MerchantLocation[1], 1, 10)
  921.    Sleep(2500 + $MoveDelay)
  922.    MouseClick('LEFT', $RepairButton[0], $RepairButton[1], 1, 5)
  923.    Sleep(500)
  924.    MouseClick('LEFT', $AllItemsButton[0], $AllItemsButton[1], 1, 5)
  925.    Sleep(500)
  926.    Call("Logs","repair")
  927.    Sleep(200)
  928.    Send("{ESC}")
  929. EndFunc
  930.  
  931. Func CheckForRepair()
  932.    $RepairNeeded = PixelSearch($RepairSearchArea[0], $RepairSearchArea[1], $RepairSearchArea[2], $RepairSearchArea[3], 0xFFE801,10)
  933.    If Not @error Then
  934.       Return True
  935.    Else
  936.       Return False
  937.    EndIf
  938. EndFunc
  939.  
  940.  
  941. ;Check gamestate, death and disconnect
  942. Func InGameLobby()
  943.     PixelSearch($GameLobbyCode[0], $GameLobbyCode[1], $GameLobbyCode[0]+10, $GameLobbyCode[1]+10, $GameLobbyCode[2], 10)
  944.     If Not @error Then
  945.        Return True
  946.     Else
  947.        Return False
  948.    EndIf
  949. EndFunc
  950.  
  951. Func InGameplayScreen()
  952.     PixelSearch($GameScreenCode[0], $GameScreenCode[1], $GameScreenCode[0]+4, $GameScreenCode[1]+3, $GameScreenCode[2], 10)
  953.     If Not @error Then
  954.        Return True
  955.     Else
  956.        Return False
  957.    EndIf
  958. EndFunc
  959.  
  960. Func CheckForDeath()
  961.    $Death = PixelSearch($DeathSearchArea[0], $DeathSearchArea[1], $DeathSearchArea[2], $DeathSearchArea[3], 0xFFFFFF)
  962.    If Not @error Then
  963.       Call("Logs","dead")
  964.       LeaveGame()
  965.       Sleep(12000 + $Computerlag)
  966.       Return True
  967.    Else
  968.       Return False
  969.    EndIf
  970. EndFunc
  971.  
  972. Func CheckForDisconnectState()
  973.    $target = _ImageSearchArea($ImgDir & "network.png", 1, $DisconnectSearchArea[0], $DisconnectSearchArea[1], $DisconnectSearchArea[2], $DisconnectSearchArea[3], $ISx, $ISy, 10)
  974.    If $target = 1 Then
  975.       $Disconnects+=1
  976.       $DisconnectState = 1
  977.       MouseClick("LEFT", $DisconnectButton[0], $DisconnectButton[1], 1, 5)
  978.       Sleep(3000 + $Computerlag)
  979.    EndIf
  980.    
  981.    $target = _ImageSearchArea($ImgDir & "lost.png", 1, $DisconnectSearchArea[0], $DisconnectSearchArea[1], $DisconnectSearchArea[2], $DisconnectSearchArea[3], $ISx, $ISy, 10)
  982.    If $target = 1 Then
  983.       If $DisconnectState = 0 Then
  984.          $Disconnects+=1
  985.       EndIf
  986.       $DisconnectState = 2
  987.       MouseClick("LEFT", $DisconnectButton[0], $DisconnectButton[1], 1, 5)
  988.       Sleep(3000 + $Computerlag)   
  989.    EndIf
  990. EndFunc
  991.  
  992. Func Relog()
  993.    MouseClick("LEFT", $PasswordField[0], $PasswordField[1], 1, 5)
  994.    Send($Password)
  995.    Sleep(1000 + $Computerlag)
  996.    Send("{ENTER}")
  997.    Sleep(8000 + $Computerlag)
  998.    $DisconnectState = 0
  999. EndFunc
  1000.  
  1001.  
  1002. ;Miscellaneous
  1003. Func Update_Time($time)
  1004.     _TicksToTime(Int(TimerDiff($time)), $runtimeHour, $runtimeMins, $runtimeSecs)
  1005.     $runtime = StringFormat("%02i:%02i:%02i", $runtimeHour, $runtimeMins, $runtimeSecs)
  1006.     Return $runtime
  1007. EndFunc
  1008.  
  1009. Func AttackNearbyMonsters()
  1010.    While 1
  1011.       $MonsterData =  PixelSearch($CharHitBox[0], $CharHitBox[1], $CharHitBox[2], $CharHitBox[3], 0xEE0000, 10)
  1012.       If @error Then
  1013.          ExitLoop
  1014.       EndIf
  1015.       Send("{4}")
  1016.       Sleep(300)
  1017.       For $i = 10 To 0 step -1
  1018.          Attack($MonsterData[0], $MonsterData[1])
  1019.          Sleep(150)
  1020.       Next
  1021.    WEnd
  1022. EndFunc
  1023.  
  1024. Func Attack($x, $y)
  1025.    Send("{SHIFTDOWN}")
  1026.    MouseClick('LEFT', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, 0)
  1027.    Send("{SHIFTUP}")
  1028. EndFunc
  1029.  
  1030. Func Move($x, $y)
  1031.    MouseClick('MIDDLE', $x, $y, 1, 5)
  1032.    Sleep(1250)
  1033. EndFunc  
  1034.  
  1035. Func DrawLootArea()
  1036.    $hFullScreen = WinGetHandle("Program Manager")
  1037.    $hGUI = GUICreate("", $LootingAreaWidth + 2, $LootingAreaHeight + 2, $LootingArea[0], $LootingArea[1], $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TRANSPARENT))
  1038.    GuiSetBkColor(0xABCDEF)
  1039.    _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 0xA0)
  1040.    WinSetOnTop($hGUI, "", 1)
  1041.    GuiSetState()
  1042.    $hDC = _WinAPI_GetWindowDC($hGUI)
  1043.    $hPen = _WinAPI_CreatePen($PS_SOLID, 2, 0x0000FF)
  1044.    $obj_orig = _WinAPI_SelectObject($hDC, $hPen)
  1045.    $user32_dll = DllOpen("user32.dll")
  1046.    _WinAPI_DrawLine($hDC, 0, 1, $LootingAreaWidth, 0)
  1047.    _WinAPI_DrawLine($hDC, 1, 0, 0, $LootingAreaHeight)
  1048.    _WinAPI_DrawLine($hDC, $LootingAreaWidth, $LootingAreaHeight, $LootingAreaWidth, 0)
  1049.    _WinAPI_DrawLine($hDC, $LootingAreaWidth, $LootingAreaHeight, 0, $LootingAreaHeight)
  1050. EndFunc
  1051.  
  1052. Func LeaveGame()
  1053.    $Runs+=1
  1054. ;   $Sek    = Floor(TimerDIff($Timer) / 1000)
  1055. ;   $Min    = Floor($Sek / 60)
  1056. ;   $Hour   = Floor($Min / 60)
  1057. ;   $Runtime = $Hour & "h " & ($Min-$Hour*60) & "m " & ($Sek-$Min*60) & "s"
  1058. ;   If $ShowStatTooltip = True Then
  1059. ;     ToolTip("Start: " & $StartTime & "  |  Runs: " & $Runs & "  |  Closed:  " & $Closed & "  |  Disconnects: " & $Disconnects & "  |  Runtime: " & $Runtime & "  |  Legendaries: " & $Legendaries & "  |  Sets: " & $Sets & "  |  Rares: " & $Rares & "  |  Magics: " & $Magics & "  |  Tomes: " & $Tomes & "  |  Gems: " & $Gems & "  |  Sold: " & $Sold, 530, 0)
  1060. ;   EndIf
  1061.    Send("{ESC}")
  1062.    Sleep(200)
  1063.    MouseClick('LEFT', $LeaveButton[0], $LeaveButton[1], 1, 5)
  1064.    Sleep(1250 + $Computerlag)
  1065. EndFunc
  1066.  
  1067. Func Pause()
  1068.    $Paused = Not $Paused
  1069.    While $Paused
  1070.       Sleep(100)
  1071.       ToolTip('Paused... Press {PAUSE} to continue...', 850, 0)
  1072.    WEnd
  1073.    If $ShowStatTooltip = True Then
  1074.     ;  ToolTip("Start: " & $StartTime & "  |  Runs: " & $Runs & "  |  Closed:  " & $Closed & "  |  Disconnects: " & $Disconnects & "  |  Runtime: " & $Runtime & "  |  Legendaries: " & $Legendaries & "  |  Sets: " & $Sets & "  |  Rares: " & $Rares & "  |  Magics: " & $Magics & "  |  Tomes: " & $Tomes & "  |  Gems: " & $Gems & "  |  Sold: " & $Sold, 530, 0)
  1075.    Else
  1076.       ToolTip("")
  1077.    EndIf
  1078. EndFunc
  1079.  
  1080. Func Terminate()
  1081.    Call("Logs","stoped")
  1082.    Exit 0
  1083. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement