Advertisement
Guest User

Development

a guest
Dec 21st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 30.04 KB | None | 0 0
  1. #RequireAdmin
  2. #include <StaticConstants.au3>
  3. #include <ButtonConstants.au3>
  4. #include <ComboConstants.au3>
  5. #include <GuiComboBox.au3>
  6. #include <GuiListBox.au3>
  7. #include <GUIConstantsEx.au3>
  8. #include <EditConstants.au3>
  9. #include <WindowsConstants.au3>
  10. #include <TrayConstants.au3>
  11. #include <Misc.au3>
  12. #include "Tesseract-OCR\Tesseract.au3"
  13.  
  14. Opt ("GUIOnEventMode", 1)
  15. Opt ("MouseClickDelay", 10)
  16. Opt ("MouseClickDownDelay", 10)
  17. Opt ("MouseCoordMode", 0)
  18. Opt ('PixelCoordMode', 0)
  19.  
  20. GUIRegisterMsg($WM_COMMAND, "GUIControl")
  21. GUIRegisterMsg($WM_SYSCOMMAND, "GUIControl")
  22.  
  23. Global $Title = "BlueStacks App Player"
  24. Global $HWnD = WinGetHandle (WinGetTitle($Title))
  25. WinActivate ($HWnD)
  26.  
  27. Global $RunState = False
  28. Global $Gold, $Elixir, $MinGold = 30000, $MinElixir = 30000, $SearchMode = 1, $SearchCheck = 0, $SearchCount = 0
  29.  
  30. Global $Attack = 0xF0E5D6, $FindAMatch = 0xF8E0A7
  31. Global $Config = @ScriptDir & "\config.ini"
  32. Global $Left = 50.23, $Top = 67.5, $Right = 613.95, $Bottom = 431.67
  33. Global $BSsize = WinGetClientSize($hWnd)
  34. Global $x_ratio = $BSsize[0]/800, $y_ratio = $BSsize[1]/600
  35.  
  36. Global $Troop[5][2] = [[60*$x_ratio,505*$y_ratio],[130*$x_ratio,505*$y_ratio],[200*$x_ratio,505*$y_ratio],[265*$x_ratio,505*$y_ratio],[372*$x_ratio,505*$y_ratio]]
  37. Global $Barbarian[2] = [0,0], $Archer[2] = [0,0], $Golbin[2] =[0,0], $Giant[2] = [0,0]
  38. Global $B1Pos[2] = [0,0], $B2Pos[2] = [0,0], $B3Pos[2] = [0,0], $B4Pos[2] = [0,0]
  39. Global $B1Troop, $B2Troop, $B3Troop, $B4Troop
  40.  
  41. Global $UpLeft[5][2] = [[350*$x_ratio,51*$y_ratio],[230*$x_ratio,100*$y_ratio],[186*$x_ratio,160*$y_ratio],[144*$x_ratio,187*$y_ratio],[125*$x_ratio,200*$y_ratio]]
  42. Global $UpRight[5][2] = [[460*$x_ratio,62*$y_ratio],[520*$x_ratio,97*$y_ratio],[570*$x_ratio,134*$y_ratio],[647*$x_ratio,186*$y_ratio],[692*$x_ratio,211*$y_ratio]]
  43. Global $LowLeft[5][2] = [[77*$x_ratio, 306*$y_ratio],[130*$x_ratio,353*$y_ratio],[181*$x_ratio,395*$y_ratio],[214*$x_ratio,415*$y_ratio],[250*$x_ratio,442*$y_ratio]]
  44. Global $LowRight[5][2] = [[734*$x_ratio,290*$y_ratio],[685*$x_ratio,318*$y_ratio],[630*$x_ratio,350*$y_ratio],[600*$x_ratio,369*$y_ratio],[535*$x_ratio,425*$y_ratio]]
  45.  
  46.  
  47.  
  48. #Region ##### GUI #####
  49. $BotGUI = GUICreate("Clash of Clans Bot", 300, 500)
  50. GUICtrlSetFont(-1, 10, 800, 0, "Calibri")
  51. GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")
  52. $Button = GUICtrlCreateButton("START", 20, 450, 260, 40)
  53. GUICtrlSetOnEvent(-1, "Start")
  54. $LBButton = GUICtrlCreateButton("Locate Barrack", 20, 380, 85, 30)
  55. GUICtrlSetOnEvent(-1, "LB")
  56. $TrButton = GUICtrlCreateButton("Train", 110, 380, 80, 30)
  57. GUICtrlSetOnEvent(-1, "Tr")
  58. $AtkButton = GUICtrlCreateButton("Attack", 195, 380, 85, 30)
  59. GUICtrlSetOnEvent(-1, "Atk")
  60. $VSButton = GUICtrlCreateButton("VILLAGE SEARCH", 20, 415, 130, 30)
  61. GUICtrlSetOnEvent(-1, "SearchFunction")
  62. $DTButton = GUICtrlCreateButton("DROP TROOPS", 150, 415, 130, 30)
  63. GUICtrlSetOnEvent(-1, "DropFunction")
  64. $MeetAll = GUICtrlCreateCheckbox("Meet all conditions", 30, 30, 140, 17)
  65. GUICtrlSetState(-1, $GUI_CHECKED)
  66. GUICtrlCreateLabel("Min Gold:", 30, 58, 58, 17)
  67. $MinGoldInput = GUICtrlCreateInput("", 80, 54, 55, 21, $ES_NUMBER)
  68. GUICtrlSetLimit(-1, 6)
  69. GUICtrlSetData(-1, $MinGold)
  70. GUICtrlCreateLabel("Min Elixir:", 30, 82, 57, 17)
  71. $MinElixirInput = GUICtrlCreateInput("", 80, 78, 55, 21, $ES_NUMBER)
  72. GUICtrlSetLimit(-1, 6)
  73. GUICtrlSetData(-1, $MinElixir)
  74. $Barrack01 = GUICtrlCreateCombo("Barrack 01", 175, 20, 80, 30, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
  75. GUICtrlSetData(-1, "Barbarian|Archer|Goblin|Giant")
  76. _GUICtrlComboBox_SelectString(-1, "Archer")
  77. $Barrack02 = GUICtrlCreateCombo("Barrack 02", 175, 46, 80, 30, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
  78. GUICtrlSetData(-1, "Barbarian|Archer|Goblin|Giant")
  79. _GUICtrlComboBox_SelectString(-1, "Archer")
  80. $Barrack03 = GUICtrlCreateCombo("Barrack 03", 175, 72, 80, 30, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
  81. GUICtrlSetData(-1, "Barbarian|Archer|Goblin|Giant")
  82. _GUICtrlComboBox_SelectString(-1, "Barbarian")
  83. $Barrack04 = GUICtrlCreateCombo("Barrack 04", 175, 98, 80, 30, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
  84. GUICtrlSetData(-1, "Barbarian|Archer|Goblin|Giant")
  85. _GUICtrlComboBox_SelectString(-1, "Barbarian")
  86. $Results = GUICtrlCreateList("", 20, 140, 260, 225, BitOR($SS_SUNKEN,$ES_READONLY, $SS_LEFT, $WS_VSCROLL))
  87.  
  88. $Timer = GUICtrlCreateEdit("0", 30, 104, 40, 21, BITOR($SS_SUNKEN,$ES_READONLY, $SS_LEFT))
  89.  
  90. GUISetState(@SW_SHOW)
  91. WinSetOnTop($BotGUI,"",1)
  92. #EndRegion ##### GUI #####
  93.  
  94. While 1
  95.    $Msg = GUIGetMsg()
  96. WEnd
  97.  
  98. Func GUIControl($hWind, $iMsg, $wParam, $lParam)
  99.    Local $nNotifyCode = BitShift($wParam, 16)
  100.    Local $nID = BitAND($wParam, 0x0000FFFF)
  101.    Local $hCtrl = $lParam
  102.    #forceref $hWind, $iMsg, $wParam, $lParam
  103.    Switch $iMsg
  104.       Case 273
  105.          Switch $nID
  106.             Case $Button
  107.                $RunState = Not $RunState
  108.                If $RunState = True Then
  109.                   GUICtrlSetData($Button,"STOP")
  110.                   GUICtrlSetData($Results, "Bot Started.." & @CRLF, -1)
  111.                ElseIf $RunState = False Then
  112.                   GUICtrlSetData($Button,"START")
  113.                   GUICtrlSetData($Results, "Bot Stopped" & @CRLF, -1)
  114.                EndIf
  115.             Case $LBButton
  116.                GUICtrlSetData($LBButton,"Locating...")
  117.             Case $TrButton
  118.                GUICtrlSetData($TrButton,"Training...")
  119.             Case $AtkButton
  120.                GUICtrlSetData($AtkButton,"Attacking...")
  121.             Case $VSButton
  122.                GUICtrlSetData($VSButton,"Searching...")
  123.             Case $VSButton
  124.                GUICtrlSetData($DTButton,"Dropping Troops...")
  125.          EndSwitch
  126.       Case 274
  127.          Switch $wParam
  128.             Case 0xf060
  129.                Exit
  130.          EndSwitch
  131.    EndSwitch
  132.    Return $GUI_RUNDEFMSG
  133. EndFunc
  134.  
  135. Func Start()
  136.    Sleep(1000)
  137.    While 1
  138.       If $RunState = False Then
  139.          ExitLoop
  140.       EndIf
  141.       MainScreen()  ;Check if main screen
  142.       If $RunState = False Then
  143.          ExitLoop
  144.       EndIf
  145.       GetInput()    ;Read user's input
  146.       If $RunState = False Then
  147.          ExitLoop
  148.       EndIf
  149.       ZoomOut()
  150.       If $RunState = False Then
  151.          ExitLoop
  152.       EndIf
  153.       LocateBarrack()   ;If barrack not located, ask user to manually click on barrack to locate position
  154.       If $RunState = False Then
  155.          ExitLoop
  156.       EndIf
  157.       If $RunState = False Then
  158.          ExitLoop
  159.       EndIf
  160.       Train()           ;Locate Barrack, Train Barrack
  161.       If $RunState = False Then
  162.          ExitLoop
  163.       EndIf
  164.       ClearBox()
  165.       ;Idle(900)
  166.       If $RunState = False Then
  167.          ExitLoop
  168.       EndIf
  169.       Attack()          ;Prepare Attack, Read Value, Compute Value, Compare Value, Search Village, Drop Troop, Return Home
  170.    WEnd
  171. EndFunc
  172.  
  173. Func GetInput()
  174.    $B1Troop = GUICtrlRead($Barrack01)
  175.    $B2Troop = GUICtrlRead($Barrack02)
  176.    $B3Troop = GUICtrlRead($Barrack03)
  177.    $B4Troop = GUICtrlRead($Barrack04)
  178.    $MinGold = Number(GUICtrlRead($MinGoldInput))
  179.    $MinElixir = Number(GUICtrlRead($MinElixirInput))
  180.    If GUICtrlRead($MeetAll) = $GUI_CHECKED Then
  181.       $SearchMode = 2
  182.    Else
  183.       $SearchMode = 1
  184.    EndIf
  185.    $B1Pos[0] = IniRead($Config, "Barrack 01", "X", "0")
  186.    $B1Pos[1] = IniRead($Config, "Barrack 01", "Y", "0")
  187.    $B2Pos[0] = IniRead($Config, "Barrack 02", "X", "0")
  188.    $B2Pos[1] = IniRead($Config, "Barrack 02", "Y", "0")
  189.    $B3Pos[0] = IniRead($Config, "Barrack 03", "X", "0")
  190.    $B3Pos[1] = IniRead($Config, "Barrack 03", "Y", "0")
  191.    $B4Pos[0] = IniRead($Config, "Barrack 04", "X", "0")
  192.    $B4Pos[1] = IniRead($Config, "Barrack 04", "Y", "0")
  193. EndFunc
  194.  
  195. #Region ##### TRAIN #####
  196. Func LocateBarrack()
  197.    Local $ClickCheck, $LocateCheck = 0
  198.    While 1
  199.       While 1
  200.          If $RunState = False Then
  201.             ExitLoop(2)
  202.          EndIf
  203.          If $B1Pos[0] = 0 Then
  204.             $ClickCheck = MsgBox(6+262144, "Locate first barrack", "Click Continue then click on your first barrack. Cancel if not available. Try again to start over.", 0, $BotGUI)
  205.             If $ClickCheck = 11 Then
  206.                WinActivate ($HWnD)
  207.                FindPos($B1Pos)
  208.                IniWrite ($Config, "Barrack 01", "X", $B1Pos[0])
  209.                IniWrite ($Config, "Barrack 01", "Y", $B1Pos[1])
  210.             ElseIf $ClickCheck = 10 Then
  211.                $B1Pos[0] = 0
  212.                $B2Pos[0] = 0
  213.                $B3Pos[0] = 0
  214.                $B4Pos[0] = 0
  215.                ExitLoop
  216.             EndIf
  217.             Sleep(500)
  218.          EndIf
  219.          If $RunState = False Then
  220.             ExitLoop(2)
  221.          EndIf
  222.          If $B2Pos[0] = 0 Then
  223.             $ClickCheck = MsgBox(6+262144, "Locate second barrack", "Click Continue then click on you second barrack. Cancel if not available. Try again to start over.", 0, $BotGUI)
  224.             If $ClickCheck = 11 Then
  225.                WinActivate ($HWnD)
  226.                FindPos($B2Pos)
  227.                IniWrite ($Config, "Barrack 02", "X", $B2Pos[0])
  228.                IniWrite ($Config, "Barrack 02", "Y", $B2Pos[1])
  229.             ElseIf $ClickCheck = 10 Then
  230.                $B1Pos[0] = 0
  231.                $B2Pos[0] = 0
  232.                $B3Pos[0] = 0
  233.                $B4Pos[0] = 0
  234.                ExitLoop
  235.             EndIf
  236.             Sleep(500)
  237.          EndIf
  238.          If $RunState = False Then
  239.             ExitLoop(2)
  240.          EndIf
  241.          If $B3Pos[0] = 0 Then
  242.             $ClickCheck = MsgBox(6+262144, "Locate third barrack", "Click Continue then click on your third barrack. Cancel if not available. Try again to start over.", 0, $BotGUI)
  243.             If $ClickCheck = 11 Then
  244.                WinActivate ($HWnD)
  245.                FindPos($B3Pos)
  246.                IniWrite ($Config, "Barrack 03", "X", $B3Pos[0])
  247.                IniWrite ($Config, "Barrack 03", "Y", $B3Pos[1])
  248.             ElseIf $ClickCheck = 10 Then
  249.                $B1Pos[0] = 0
  250.                $B2Pos[0] = 0
  251.                $B3Pos[0] = 0
  252.                $B4Pos[0] = 0
  253.                ExitLoop
  254.             EndIf
  255.             Sleep(500)
  256.          EndIf
  257.          If $RunState = False Then
  258.             ExitLoop(2)
  259.          EndIf
  260.          If $B4Pos[0] = 0 Then
  261.             $ClickCheck = MsgBox(6+262144, "Locate fourth barrack", "Click Continue then click on your fourth barrack. Cancel if not available. Try again to start over.", 0, $BotGUI)
  262.             If $ClickCheck = 11 Then
  263.                WinActivate ($HWnD)
  264.                FindPos($B4Pos)
  265.                IniWrite ($Config, "Barrack 04", "X", $B4Pos[0])
  266.                IniWrite ($Config, "Barrack 04", "Y", $B4Pos[1])
  267.             ElseIf $ClickCheck = 10 Then
  268.                $B1Pos[0] = 0
  269.                $B2Pos[0] = 0
  270.                $B3Pos[0] = 0
  271.                $B4Pos[0] = 0
  272.                ExitLoop
  273.             EndIf
  274.             Sleep(500)
  275.          EndIf
  276.          ExitLoop(2)
  277.       WEnd
  278.    WEnd
  279. EndFunc
  280.  
  281. Func TrainBarrack($x, $y, $z)
  282.    While 1
  283.       If $RunState = False Then
  284.          ExitLoop
  285.       EndIf
  286.       ControlClick ($HWnD, "","", "left", "1", $x, $y)
  287.       Sleep(1000)
  288.       ControlClick ($HWnD, "","", "left", "1", 560*$x_ratio, 490*$y_ratio)
  289.       Sleep(1000)
  290.       Select
  291.       Case $z = "Barbarian"
  292.          For $i = 1 To 65 Step 1
  293.             ControlClick ($HWnD, "","", "left", "1", 220*$x_ratio, 270*$y_ratio)
  294.             If $RunState = False Then
  295.                ExitLoop
  296.             EndIf
  297.             Sleep(50)
  298.          Next
  299.       Case $z = "Archer"
  300.          For $i = 1 To 65 Step 1
  301.             ControlClick ($HWnD, "","", "left", "1", 310*$x_ratio, 270*$y_ratio)
  302.             If $RunState = False Then
  303.                ExitLoop
  304.             EndIf
  305.             Sleep(50)
  306.          Next
  307.       Case $z = "Goblin"
  308.          For $i = 1 To 65 Step 1
  309.             ControlClick ($HWnD, "","", "left", "1", 490*$x_ratio, 270*$y_ratio)
  310.             If $RunState = False Then
  311.                ExitLoop
  312.             EndIf
  313.             Sleep(50)
  314.          Next
  315.       Case $z = "Giant"
  316.          For $i = 1 To 15 Step 1
  317.             ControlClick ($HWnD, "","", "left", "1", 400*$x_ratio, 270*$y_ratio)
  318.             If $RunState = False Then
  319.                ExitLoop
  320.             EndIf
  321.             Sleep(50)
  322.          Next
  323.       EndSelect
  324.       If $RunState = False Then
  325.          ExitLoop
  326.       EndIf
  327.       Sleep(1000)
  328.       ControlClick ($HWnD, "","", "left", "1", 656*$x_ratio, 113*$y_ratio)
  329.       Sleep(1000)
  330.       ExitLoop
  331.    WEnd
  332. EndFunc
  333.  
  334. Func Train()
  335.    If $B1Pos[0]*$B2Pos[0]*$B3Pos[0]*$B4Pos[0] <> 0 Then
  336.       GUICtrlSetData($Results, "Barracks' position loaded successfully" & @CRLF, -1)
  337.       GUICtrlSetData($Results, "Barrack 01: " & $B1Pos[0] & ", " & $B1Pos[1] & @CRLF, -1)
  338.       GUICtrlSetData($Results, "Barrack 02: " & $B2Pos[0] & ", " & $B2Pos[1] & @CRLF, -1)
  339.       GUICtrlSetData($Results, "Barrack 03: " & $B3Pos[0] & ", " & $B3Pos[1] & @CRLF, -1)
  340.       GUICtrlSetData($Results, "Barrack 04: " & $B4Pos[0] & ", " & $B4Pos[1] & @CRLF, -1)
  341.    EndIf
  342.    GUICtrlSetData($Results,"Begin training" & @CRLF, -1)
  343.    If $B1Pos[0] <> 0 Then
  344.       TrainBarrack($B1Pos[0],$B1Pos[1],$B1Troop)
  345.    EndIf
  346.    If $B2Pos[0] <> 0 Then
  347.       TrainBarrack($B2Pos[0],$B2Pos[1],$B2Troop)
  348.    EndIf
  349.    If $B3Pos[0] <> 0 Then
  350.       TrainBarrack($B3Pos[0],$B3Pos[1],$B3Troop)
  351.    EndIf
  352.    If $B4Pos[0] <> 0 Then
  353.       TrainBarrack($B4Pos[0],$B4Pos[1],$B4Troop)
  354.    EndIf
  355.    GUICtrlSetData($Results, "Training complete" & @CRLF, -1)
  356. EndFunc
  357. #EndRegion ##### TRAIN #####
  358.  
  359. #Region ##### ATTACK #####
  360. Func Attack()
  361.    While 1
  362.       If $RunState = False Then
  363.          ExitLoop
  364.       EndIf
  365.       AssignTroop()
  366.       If $RunState = False Then
  367.          ExitLoop
  368.       EndIf
  369.       PrepareAttack()
  370.       If $RunState = False Then
  371.          ExitLoop
  372.       EndIf
  373.       GUICtrlSetData($Results, "Attack started. Begin searching.." & @CRLF, -1)
  374.       VillageSearch()
  375.       If $RunState = False Then
  376.          ExitLoop
  377.       EndIf
  378.       Sleep(5000)
  379.       DropTroop()
  380.       If $RunState = False Then
  381.          ExitLoop
  382.       EndIf
  383.       ReturnHome()
  384.       ExitLoop
  385.    WEnd
  386. EndFunc
  387.  
  388. Func PrepareAttack()
  389.    GUICtrlSetData($Results, "Func PrepareAttack" & @CRLF, -1)
  390.    While 1
  391.       If $RunState = False Then
  392.          ExitLoop
  393.       EndIf
  394.       ControlClick ($HWnD, "","", "left", "1", 50*$x_ratio, 500*$y_ratio) ;Click Attack
  395.       If $RunState = False Then
  396.          ExitLoop
  397.       EndIf
  398.       Sleep(2000)
  399.       ControlClick ($HWnD, "","", "left", "1", 190*$x_ratio, 420*$y_ratio) ;Click Find a Match
  400.       If $RunState = False Then
  401.          ExitLoop
  402.       EndIf
  403.       Sleep(2000)
  404.       ControlClick ($HWnD, "","", "left", "1", 470*$x_ratio, 330*$y_ratio) ;Click Break Shield
  405.       ExitLoop
  406.    WEnd
  407. EndFunc
  408.  
  409. Func CheckSearch()
  410.    GUICtrlSetData($Results, "Func CheckSearch" & @CRLF, -1)
  411.    $Pixel = PixelSearch(0,0,900,700,0xC00000,20,1,$HWnD) ;End Battle Button
  412.    While Not IsArray($Pixel)
  413.       $Pixel = PixelSearch(0,0,900,700,0xC00000,20,1,$HWnD) ;End Battle Button
  414.       Sleep(200)
  415.       If $RunState = False Then
  416.          ExitLoop
  417.       EndIf
  418.    WEnd
  419. EndFunc
  420.  
  421. Func VillageSearch()
  422.    GUICtrlSetData($Results, "Func VillageSearch" & @CRLF, -1)
  423.    While 1
  424.       If $RunState = False Then
  425.          ExitLoop
  426.       EndIf
  427.       CheckSearch()
  428.       If $RunState = False Then
  429.       ExitLoop
  430.       EndIf
  431.       ComputeValue()
  432.       If $RunState = False Then
  433.          ExitLoop
  434.       EndIf
  435.       CompareValue()
  436.       If $RunState = False Then
  437.          ExitLoop
  438.       EndIf
  439.       While $SearchCheck = 0
  440.          If $RunState = False Then
  441.             ExitLoop
  442.          EndIf
  443.          ControlClick ($HWnD, "","", "left", "1", 715*$x_ratio, 405*$y_ratio) ;Click Next
  444.          If $RunState = False Then
  445.             ExitLoop
  446.          EndIf
  447.          CheckSearch()
  448.          If $RunState = False Then
  449.             ExitLoop
  450.          EndIf
  451.          ComputeValue()
  452.          If $RunState = False Then
  453.             ExitLoop
  454.          EndIf
  455.          CompareValue()
  456.          If $RunState = False Then
  457.             ExitLoop
  458.          EndIf
  459.       WEnd
  460.       If $RunState = False Then
  461.          ExitLoop
  462.       EndIf
  463.       GUICtrlSetData($Results, "Enemy Found!" & @CRLF, -1)
  464.       TrayTip ("Enemy Found!","Requirement met:  Gold: " & $Gold & ". Elixir: " & $Elixir, 0, $TIP_ICONASTERISK)
  465.       ExitLoop
  466.    WEnd
  467. EndFunc
  468.  
  469. Func CheckTroop($a)
  470.    GUICtrlSetData($Results, "Func CheckTroop" & @CRLF, -1)
  471.    If $B1Troop = $a Or $B2Troop = $a Or $B3Troop = $a Or $B4Troop = $a Then
  472.       Return True
  473.    Else
  474.       Return False
  475.    EndIf
  476. EndFunc
  477.  
  478. Func AssignTroop()
  479.    GUICtrlSetData($Results, "Func AssignTroop" & @CRLF, -1)
  480.    If CheckTroop("Barbarian") Then
  481.       $Barbarian[0] = $Troop[0][0]
  482.       $Barbarian[1] = $Troop[0][1]
  483.       If CheckTroop("Archer") Then
  484.          $Archer[0] = $Troop[1][0]
  485.          $Archer[1] = $Troop[1][1]
  486.          If CheckTroop("Goblin") Then
  487.             $Goblin[0] = $Troop[2][0]
  488.             $Goblin[1] = $Troop[2][1]
  489.             If CheckTroop("Giant") Then
  490.                $Giant[0] = $Troop[3][0]
  491.                $Giant[1] = $Troop[3][1]
  492.                ;MsgBox(0,"","Barbarian, Archer, Goblin, Giant")
  493.             EndIf
  494.          ElseIf CheckTroop("Giant") Then
  495.             $Giant[0] = $Troop[2][0]
  496.             $Giant[1] = $Troop[2][1]
  497.             ;MsgBox(0,"","Barbarian, Archer, Giant")
  498.          EndIf
  499.       ElseIf CheckTroop("Goblin") Then
  500.          $Goblin[0] = $Troop[1][0]
  501.          $Goblin[1] = $Troop[1][1]
  502.          If CheckTroop("Giant") Then
  503.             $Giant[0] = $Troop[2][0]
  504.             $Giant[1] = $Troop[2][1]
  505.             ;MsgBox(0,"","Barbarian, Goblin, Giant")
  506.          EndIf
  507.       ElseIf CheckTroop("Giant") Then
  508.          $Giant[0] = $Troop[1][0]
  509.          $Giant[1] = $Troop[1][1]
  510.          ;MsgBox(0,"","Barbarian, Giant")
  511.       EndIf
  512.    ElseIf CheckTroop("Archer") Then
  513.       $Archer[0] = $Troop[0][0]
  514.       $Archer[1] = $Troop[0][1]
  515.       If CheckTroop("Goblin") Then
  516.          $Goblin[0] = $Troop[1][0]
  517.          $Goblin[1] = $Troop[1][1]
  518.          If CheckTroop("Giant") Then
  519.             $Giant[0] = $Troop[2][0]
  520.             $Giant[1] = $Troop[2][1]
  521.             ;MsgBox(0,"","Archer, Goblin, Giant")
  522.          EndIf
  523.       ElseIf CheckTroop("Giant") Then
  524.          $Giant[0] = $Troop[1][0]
  525.          $Giant[1] = $Troop[1][1]
  526.          ;MsgBox(0,"","Archer, Giant")
  527.       EndIf
  528.    ElseIf CheckTroop("Goblin") Then
  529.       $Goblin[0] = $Troop[0][0]
  530.       $Goblin[1] = $Troop[0][1]
  531.       If CheckTroop("Giant") Then
  532.          $Giant[0] = $Troop[1][0]
  533.          $Giant[1] = $Troop[1][1]
  534.          ;MsgBox(0,"","Goblin, Giant")
  535.       EndIf
  536.    ElseIf CheckTroop("Giant") Then
  537.       $Giant[0] = $Troop[0][0]
  538.       $Giant[1] = $Troop[0][1]
  539.       ;MsgBox(0,"","Giant")
  540.    EndIf
  541. EndFunc
  542.  
  543. Func DropTroop()
  544.    GUICtrlSetData($Results, "Func DropTroop" & @CRLF, -1)
  545.    While 1
  546.       GUICtrlSetData($Results, "Start to drop troops" & @CRLF, -1)
  547.       If $RunState = False Then
  548.          ExitLoop
  549.       EndIf
  550.       DropCombo($UpLeft)
  551.       If $RunState = False Then
  552.          ExitLoop
  553.       EndIf
  554.       DropCombo($UpRight)
  555.       If $RunState = False Then
  556.          ExitLoop
  557.       EndIf
  558.       DropCombo($UpLeft)
  559.       If $RunState = False Then
  560.          ExitLoop
  561.       EndIf
  562.       DropCombo($UpRight)
  563.       If $RunState = False Then
  564.          ExitLoop
  565.       EndIf
  566.       ExitLoop
  567.    WEnd
  568. EndFunc
  569.  
  570. Func DropSingle($T, $W)
  571.    GUICtrlSetData($Results, "Func DropSingle" & @CRLF, -1)
  572.    While 1
  573.       If $RunState = False Then
  574.          ExitLoop
  575.       EndIf
  576.       If CheckTroop($T) Then
  577.          Select
  578.          Case $T = "Giant"
  579.             ControlClick ($HWnD, "","", "left", "1", $Giant[0], $Giant[1])
  580.             Sleep(300)
  581.             For $i = 1 to 5 Step 1
  582.                ControlClick ($HWnD, "","", "left", "1", $W[$i][0], $W[$i][1])
  583.                Sleep(100)
  584.             Next
  585.             Sleep(300)
  586.          If $RunState = False Then
  587.             ExitLoop
  588.          EndIf
  589.          Case $T = "Barbarian"
  590.             ControlClick ($HWnD, "","", "left", "1", $Barbarian[0], $Barbarian[1])
  591.             Sleep(300)
  592.             For $x = 0 to 5 Step 1
  593.                For $i = 0 to 4 Step 1
  594.                   ControlClick ($HWnD, "","", "left", "1", $W[$i][0], $W[$i][1])
  595.                   Sleep(100)
  596.                Next
  597.             Next
  598.             Sleep(300)
  599.          If $RunState = False Then
  600.             ExitLoop
  601.          EndIf
  602.          Case $T = "Archer"
  603.             ControlClick ($HWnD, "","", "left", "1", $Archer[0], $Archer[1])
  604.             Sleep(300)
  605.             For $x = 0 to 5 Step 1
  606.                For $i = 0 to 4 Step 1
  607.                   ControlClick ($HWnD, "","", "left", "1", $W[$i][0], $W[$i][1])
  608.                   Sleep(100)
  609.                Next
  610.             Next
  611.             Sleep(300)
  612.          If $RunState = False Then
  613.             ExitLoop
  614.          EndIf
  615.          Case $T = "Goblin"
  616.             ControlClick ($HWnD, "","", "left", "1", $Goblin[0], $Goblin[1])
  617.             Sleep(300)
  618.             For $x = 0 to 5 Step 1
  619.                For $i = 0 to 4 Step 1
  620.                   ControlClick ($HWnD, "","", "left", "1", $W[$i][0], $W[$i][1])
  621.                   Sleep(100)
  622.                Next
  623.             Next
  624.             Sleep(300)
  625.          EndSelect
  626.       EndIf
  627.       ExitLoop
  628.    WEnd
  629. EndFunc
  630.  
  631. Func DropCombo($W)
  632.    GUICtrlSetData($Results, "Func DropCombo" & @CRLF, -1)
  633.    While 1
  634.       If $RunState = False Then
  635.          ExitLoop
  636.       EndIf
  637.       If CheckTroop("Giant") Then
  638.          ControlClick ($HWnD, "","", "left", "1", $Giant[0], $Giant[1])
  639.          Sleep(500)
  640.          For $i = 1 to 5 Step 1
  641.             ControlClick ($HWnD, "","", "left", "1", $W[$i][0], $W[$i][1])
  642.             Sleep(500)
  643.          Next
  644.          Sleep(2000)
  645.       EndIf
  646.       If $RunState = False Then
  647.          ExitLoop
  648.       EndIf
  649.       If CheckTroop("Barbarian") Then
  650.          ControlClick ($HWnD, "","", "left", "1", $Barbarian[0], $Barbarian[1])
  651.          Sleep(300)
  652.          For $x = 0 to 7 Step 1
  653.             For $i = 0 to 4 Step 1
  654.                ControlClick ($HWnD, "","", "left", "1", $W[$i][0], $W[$i][1])
  655.                Sleep(100)
  656.             Next
  657.          Next
  658.          Sleep(500)
  659.       EndIf
  660.       If $RunState = False Then
  661.          ExitLoop
  662.       EndIf
  663.       If CheckTroop("Archer") Then
  664.          ControlClick ($HWnD, "","", "left", "1", $Archer[0], $Archer[1])
  665.          Sleep(300)
  666.          For $x = 0 to 7 Step 1
  667.             For $i = 0 to 4 Step 1
  668.                ControlClick ($HWnD, "","", "left", "1", $W[$i][0], $W[$i][1])
  669.                Sleep(100)
  670.             Next
  671.          Next
  672.          Sleep(500)
  673.       EndIf
  674.       If $RunState = False Then
  675.          ExitLoop
  676.       EndIf
  677.       If CheckTroop("Goblin") Then
  678.          ControlClick ($HWnD, "","", "left", "1", $Goblin[0], $Goblin[1])
  679.          Sleep(300)
  680.          For $x = 0 to 7 Step 1
  681.             For $i = 0 to 4 Step 1
  682.                ControlClick ($HWnD, "","", "left", "1", $W[$i][0], $W[$i][1])
  683.                Sleep(100)
  684.             Next
  685.          Next
  686.          Sleep(500)
  687.       EndIf
  688.       ExitLoop
  689.    WEnd
  690. EndFunc
  691.  
  692. Func ReadValue(ByRef $x, ByRef $y)
  693.    GUICtrlSetData($Results, "Func ReadValue" & @CRLF, -1)
  694.    While 1
  695.       If $RunState = False Then
  696.          ExitLoop
  697.       EndIf
  698.       $Read = _TesseractWinCapture($HWnD,"",0,"",1,2,$Left*$x_ratio,$Top*$y_ratio,$Right*$x_ratio,$Bottom*$y_ratio,0)   ;Capture screen region with gold and elixir
  699.       $Read = StringRegExpReplace(StringRegExpReplace($Read, "(\v)+", @CRLF), "\A\v|\v\Z", "")  ;Strip whitespaces & blank lines and split into array
  700.       $Read = StringSplit($Read, @CRLF, 1)
  701. ;~    MsgBox(0,"",$Read)
  702. ;~    FileWrite("Read.png", $Read)
  703.       If $RunState = False Then
  704.          ExitLoop
  705.       EndIf
  706.       While UBound($Read) < 5
  707.          If $RunState = False Then
  708.             ExitLoop
  709.          EndIf
  710.          $Read = _TesseractWinCapture($HWnD,"",0,"",1,2,$Left*$x_ratio,$Top*$y_ratio,$Right*$x_ratio,$Bottom*$y_ratio,0)    ;Capture screen region with gold and elixir
  711.          $Read = StringRegExpReplace(StringRegExpReplace($Read, "(\v)+", @CRLF), "\A\v|\v\Z", "")   ;Strip whitespaces & blank lines and split into array
  712.          $Read = StringSplit($Read, @CRLF, 1)
  713.       WEnd
  714.       If $RunState = False Then
  715.          ExitLoop
  716.       EndIf
  717.       $x = Number(StringRegExpReplace($Read[2], "[^[:digit:]]", ""))    ;Convert gold to number
  718.       $y = Number(StringRegExpReplace($Read[3], "[^[:digit:]]", ""))    ;Convert exlir to number
  719.       ExitLoop
  720.    WEnd
  721. EndFunc
  722.  
  723. Func ComputeValue()
  724.    GUICtrlSetData($Results, "Func ComputeValue" & @CRLF, -1)
  725.    While 1
  726.       Local $G[3],$E[3]
  727.       ReadValue($G[0], $E[0])
  728.       ReadValue($G[1], $E[1])
  729.       ReadValue($G[2], $E[2])
  730.       $Gold = _ArrayMin($G)
  731.       $Elixir = _ArrayMin($E)
  732.       If $RunState = False Then
  733.          ExitLoop
  734.       EndIf
  735.       GUICtrlSetData($Results, "(" & $SearchCount+1 & ") Gold: " & $Gold & ". Elixir: " & $Elixir & @CRLF, -1)
  736.       $SearchCount += 1 ; Counter for number of searches
  737.       ExitLoop
  738.    WEnd
  739. EndFunc
  740.  
  741. Func CompareValue()
  742.    GUICtrlSetData($Results, "Func CompareValue" & @CRLF, -1)
  743.    If $Gold >= $MinGold Then
  744.       If $Elixir >= $MinElixir Then
  745.          ;MsgBox(0, "Gold & Elixir Check", "Gold: " & $Gold & @CR & "Elixir: " & $Elixir & @CR & "Requirement met.")
  746.          Select
  747.             Case $SearchMode = 1
  748.                $SearchCheck = 1
  749.             Case $SearchMode = 2
  750.                $SearchCheck = 1
  751.             Case Else
  752.                $SearchCheck = 0
  753.          EndSelect
  754.       Else
  755.          ;MsgBox(0, "Gold & Elixir Check", "Gold: " & $Gold & @CR & "Elixir: " & $Elixir & @CR &  "Not enough " & $MinElixir & " Elixir.")
  756.          Select
  757.             Case $SearchMode = 1
  758.                $SearchCheck = 1
  759.             Case $SearchMode = 2
  760.                $SearchCheck = 0
  761.             Case Else
  762.                $SearchCheck = 0
  763.          EndSelect
  764.       EndIf
  765.    Else
  766.       If $Elixir >= $MinElixir Then
  767.          ;MsgBox(0, "Gold & Elixir Check", "Gold: " & $Gold & @CR & "Elixir: " & $Elixir & @CR & "Not enough " & $MinGold & " Gold.")
  768.          Select
  769.             Case $SearchMode = 1
  770.                $SearchCheck = 1
  771.             Case $SearchMode = 2
  772.                $SearchCheck = 0
  773.             Case Else
  774.                $SearchCheck = 0
  775.          EndSelect
  776.       Else
  777.          ;MsgBox(0, "Gold & Elixir Check", "Gold: " & $Gold & @CR & "Elixir: " & $Elixir & @CR & "Not enough " & $MinGold & " Gold and " & $MinElixir & " Elixir." )
  778.          Select
  779.             Case $SearchMode = 1
  780.                $SearchCheck = 0
  781.             Case $SearchMode = 2
  782.                $SearchCheck = 0
  783.             Case Else
  784.                $SearchCheck = 0
  785.          EndSelect
  786.       EndIf
  787.    EndIf
  788. EndFunc
  789. #EndRegion ##### ATTACK #####
  790.  
  791. #Region ##### MINI FUNCTION #####
  792.  
  793. #cs
  794. Func MainScreen()
  795.    While 1
  796.       If $RunState = False Then
  797.          ExitLoop
  798.       EndIf
  799.       GUICtrlSetData($Results, "Waiting for Clash of Clans to load..." & @CRLF, -1)
  800.       $Pixel = PixelGetColor(630*$x_ratio, 390*$y_ratio, $HWnD)
  801.       If Hex($Pixel,6) = 282828 Or $Pixel = 2962704 Then
  802.          ControlClick ($HWnD, "","", "left", "1", 293*$x_ratio, 329*$y_ratio)
  803.          If $RunState = False Then
  804.             ExitLoop
  805.          EndIf
  806.          Sleep(5000)
  807.       EndIf
  808.       $Pixel = PixelSearch(0,0,900,700,0xF8ED90,0,1,$HWnD)
  809.       If IsArray($Pixel) Then
  810.          ControlClick ($HWnD, "","", "left", "1", 400*$x_ratio, 450*$y_ratio)
  811.          If $RunState = False Then
  812.             ExitLoop
  813.          EndIf
  814.          Sleep(5000)
  815.       EndIf
  816.       $Pixel = PixelSearch(0,0,900,700,$Attack,0,1,$HWnD)
  817.       While Not IsArray($Pixel)
  818.          $Pixel = PixelSearch(0,0,900,700,$Attack,0,1,$HWnD)
  819.          If $RunState = False Then
  820.             ExitLoop
  821.          EndIf
  822.          Sleep(200)
  823.       WEnd
  824.       GUICtrlSetData($Results, "In main screen" & @CRLF, -1)
  825.       ExitLoop
  826.    WEnd
  827. EndFunc
  828. #ce
  829. Func CheckScreenChange()
  830.    GUICtrlSetData($Results, "Func CheckScreenChange" & @CRLF, -1)
  831.    $Pixel = PixelChecksum(0.25*$BSsize[0],0.25*$BSsize[1], 0.75*$BSsize[0], 0.75*$BSsize[1], 2, $hWnD)
  832.    Sleep(500)
  833.    $Pixel1 = PixelChecksum(0.25*$BSsize[0],0.25*$BSsize[1], 0.75*$BSsize[0], 0.75*$BSsize[1], 2, $hWnD)
  834.    If $Pixel = $Pixel1 Then
  835.       Return False
  836.    Else
  837.       Return True
  838.    EndIf
  839. EndFunc
  840.  
  841. Func MainScreen()
  842.    GUICtrlSetData($Results, "Func Mainscreen" & @CRLF, -1)
  843.    If Not CheckScreenChange() Then
  844.       ControlClick ($HWnD, "","", "left", "1", 293*$x_ratio, 329*$y_ratio)
  845.       ControlClick ($HWnD, "","", "left", "1", 400*$x_ratio, 408*$y_ratio)
  846.       GUICtrlSetData($Results, "Waiting for Clash of Clans to load..." & @CRLF, -1)
  847.       Sleep(5000)
  848.    EndIf
  849.    While Not CheckScreenChange()
  850.       Sleep(1000)
  851.    WEnd
  852.    GUICtrlSetData($Results, "In main screen" & @CRLF, -1)
  853. EndFunc
  854.  
  855. Func Idle($s)
  856.    GUICtrlSetData($Results, "Func Idle" & @CRLF, -1)
  857.    For $i = 1 to $s/60 Step 1
  858.       If $RunState = False Then
  859.          ExitLoop
  860.       EndIf
  861.       Train()
  862.       If $RunState = False Then
  863.          ExitLoop
  864.       EndIf
  865.       Sleep(45000)
  866.    Next
  867. EndFunc
  868.  
  869. ;~ Func ReturnHome()
  870. ;~    GUICtrlSetData($Results, "Func ReturnHome" & @CRLF, -1)
  871. ;~    #cs
  872. ;~    While CheckScreenChange(0.25, 0.9, 0.75, 0.95)
  873. ;~    Sleep(1000)
  874. ;~    WEnd
  875. ;~    GUICtrlSetData($Results, "Return Home" & @CRLF, -1)
  876. ;~    ControlClick ($HWnD, "","", "left", "1", 400*$x_ratio, 450*$y_ratio)
  877. ;~    #ce
  878. ;~    $tStart = TimerInit()
  879. ;~    $tStop = TimerDiff($tStart)
  880. ;~    While $tStop < 160
  881. ;~    If $RunState = False Then
  882. ;~       ExitLoop
  883. ;~    EndIf
  884. ;~    Sleep(1000)
  885. ;~    WEnd
  886. ;~    GUICtrlSetData($Results, "Return Home" & @CRLF, -1)
  887. ;~    ControlClick ($HWnD, "","", "left", "1", 400*$x_ratio, 450*$y_ratio)
  888. ;~ EndFunc
  889.  
  890.  
  891. Func ReturnHome()
  892.    GUICtrlSetData($Results, "Func ReturnHome" & @CRLF, -1)
  893.    #cs
  894.    While CheckScreenChange(0.25, 0.9, 0.75, 0.95)
  895.       Sleep(1000)
  896.    WEnd
  897.    GUICtrlSetData($Results, "Return Home" & @CRLF, -1)
  898.    ControlClick ($HWnD, "","", "left", "1", 400*$x_ratio, 450*$y_ratio)
  899.    #ce
  900.    $Countdown = 150
  901.    While $Countdown > 0
  902.       GUICtrlSetData($Timer, $Countdown)
  903.       $Countdown = $Countdown - 1
  904.       sleep(1000)
  905.    WEnd
  906.    GUICtrlSetData($Results, "Return Home" & @CRLF, -1)
  907.    ControlClick ($HWnD, "","", "left", "1", 400*$x_ratio, 450*$y_ratio)
  908. EndFunc
  909.  
  910.  
  911. Func ZoomOut()
  912.    GUICtrlSetData($Results, "Zoom Out" & @CRLF, -1)
  913.    For $i = 1 To 20 Step 1
  914.       ControlSend($HWnD, "", "", "{DOWN}", 0)
  915.       If $RunState = False Then
  916.          ExitLoop
  917.       EndIf
  918.       Sleep(500)
  919.    Next
  920. EndFunc
  921.  
  922. Func Button($hex)
  923.    $Count = 0
  924.    $Pixel = PixelSearch(0,0,900,700,$hex,0,1,$HWnD) ;Attack! button
  925.    While Not IsArray($Pixel) And $Count < 5
  926.       $Pixel = PixelSearch(0,0,900,700,$hex,0,1,$HWnD) ;Attack! button
  927.       Sleep(200)
  928.       $Count += 1
  929.    WEnd
  930.    If $Count < 5 Then
  931.       ControlClick ($HWnD, "","", "left", "1", $Pixel[0], $Pixel[1])
  932.    EndIf
  933.    Sleep(1000)
  934. EndFunc
  935.  
  936. Func Terminate()
  937.    Exit
  938. EndFunc
  939.  
  940. Func FindPos(ByRef $Pos)
  941.    Opt ("MouseCoordMode", 2)
  942.    Local $x = 1
  943.    While $x = 1
  944.       If _IsPressed("01") Then
  945.          $Pos = MouseGetPos()
  946.          $x = 0
  947.       EndIf
  948.    WEnd
  949.    Opt ("MouseCoordMode", 0)
  950. EndFunc
  951.  
  952. Func ClearBox()
  953.    GUICtrlDelete($Results)
  954.    $Results = GUICtrlCreateList("", 20, 140, 260, 225, BitOR($SS_SUNKEN,$ES_READONLY, $SS_LEFT, $WS_VSCROLL))
  955. EndFunc
  956.  
  957. Func LB()
  958.    ClearBox()
  959.    $RunState = True
  960.    GUICtrlSetData($Button,"STOP")
  961.    MainScreen()
  962.    ZoomOut()
  963.    $B1Pos[0] = 0
  964.    $B2Pos[0] = 0
  965.    $B3Pos[0] = 0
  966.    $B4Pos[0] = 0
  967.    LocateBarrack()
  968.    GUICtrlSetData($LBButton,"Locate Barracks")
  969.    GUICtrlSetData($Results, "Barracks located" & @CRLF, -1)
  970.    GUICtrlSetData($Results, "Barrack 01: " & $B1Pos[0] & ", " & $B1Pos[1] & @CRLF, -1)
  971.    GUICtrlSetData($Results, "Barrack 02: " & $B2Pos[0] & ", " & $B2Pos[1] & @CRLF, -1)
  972.    GUICtrlSetData($Results, "Barrack 03: " & $B3Pos[0] & ", " & $B3Pos[1] & @CRLF, -1)
  973.    GUICtrlSetData($Results, "Barrack 04: " & $B4Pos[0] & ", " & $B4Pos[1] & @CRLF, -1)
  974.    $RunState = False
  975.    GUICtrlSetData($Button,"START")
  976. EndFunc
  977.  
  978. Func Tr()
  979.    ClearBox()
  980.    $RunState = True
  981.    GUICtrlSetData($Button,"STOP")
  982.    MainScreen()
  983.    GetInput()
  984.    ZoomOut()
  985.    Train()
  986.    $RunState = False
  987.    GUICtrlSetData($TrButton, "Train")
  988.    GUICtrlSetData($Button,"STOP")
  989. EndFunc
  990.  
  991. Func Atk()
  992.    ClearBox()
  993.    $RunState = True
  994.    GUICtrlSetData($Button,"STOP")
  995.    MainScreen()
  996.    GetInput()
  997.    ZoomOut()
  998.    Attack()
  999.    GUICtrlSetData($AtkButton, "Attack")
  1000.    $RunState = False
  1001.    GUICtrlSetData($Button,"START")
  1002. EndFunc
  1003.  
  1004. Func SearchFunction()
  1005.    ClearBox()
  1006.    $RunState = True
  1007.    GUICtrlSetData($Button,"STOP")
  1008.    GetInput()
  1009.    ControlClick ($HWnD, "","", "left", "1", 715*$x_ratio, 405*$y_ratio) ;Click Next
  1010.    VillageSearch()
  1011.    GUICtrlSetData($VSButton, "VILLAGE SEARCH")
  1012.    $RunState = False
  1013.    GUICtrlSetData($Button,"START")
  1014. EndFunc
  1015.  
  1016. Func DropFunction()
  1017.    ClearBox()
  1018.    $RunState = True
  1019.    GUICtrlSetData($Button,"STOP")
  1020.    GetInput()
  1021.    DropTroop()
  1022.    GUICtrlSetData($VSButton, "DROP TROOPS")
  1023.    $RunState = False
  1024.    GUICtrlSetData($Button,"START")
  1025. EndFunc
  1026.  
  1027. #cs
  1028. Func Pause()
  1029.    $Paused = NOT $Paused
  1030.    While $Paused
  1031.       Sleep(100)
  1032.    TrayTip("Script Paused","SHIFT+1 to Unpause", 0, $TIP_ICONASTERISK)
  1033.    WEnd
  1034. EndFunc
  1035.  
  1036. Func Restart()
  1037.    ControlClick ($HWnD, "","", "left", "1", 125, 575)
  1038.    Sleep(2000)
  1039.    ControlClick ($HWnD, "","", "left", "1", 125, 577)
  1040.    Sleep(2000)
  1041.    ControlClick ($HWnD, "","", "left", "1", 205, 575)
  1042.    Sleep(2000)
  1043.    MouseClickDrag("left", 700, 300, 700, 120)
  1044.    Sleep(2000)
  1045.    ControlClick ($HWnD, "","", "left", "1", 290, 160)
  1046.    Sleep(50000)
  1047. EndFunc
  1048.  
  1049. Func Initiate()
  1050.    ControlClick ($HWnD, "","", "left", "1", 290, 150) ;Click BlueStacks
  1051.    Sleep(60000)
  1052.    ZoomOut()
  1053.    Sleep(10000)
  1054. EndFunc
  1055. #ce
  1056. #EndRegion ##### MINI FUNCTION ######
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement