02-05-2015, 10:26 PM
(This post was last modified: 02-05-2015, 10:37 PM by SongHyeKyo.)
(02-05-2015, 10:20 PM)dinobot Wrote: Lol... I didn't mentioned anything about atkAlgorithmTH()?
Anyway it is algorithm_AllTroops
Hehehe! maybe misunderstanding because in the link you agree what other forumer said in the code he / she post ..
Code:
Func algorithm_AllTroops() ;Attack Algorithm for all existing troops
$King = -1
$Queen = -1
$CC = -1
$Barb = -1
$Arch = -1
For $i = 0 To 8
If $atkTroops[$i][0] = $eBarbarian Then
$Barb = $i
ElseIf $atkTroops[$i][0] = $eArcher Then
$Arch = $i
ElseIf $atkTroops[$i][0] = $eCastle Then
$CC = $i
ElseIf $atkTroops[$i][0] = $eKing Then
$King = $i
ElseIf $atkTroops[$i][0] = $eQueen Then
$Queen = $i
EndIf
Next
If _Sleep(2000) Then Return
Local $nbSides = 0
Switch $deploySettings
Case 0 ;Single sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetLog("~Attacking in a single side...")
$nbSides = 1
Case 1 ;Two sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetLog("~Attacking in two sides...")
$nbSides = 2
Case 2 ;Three sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetLog("~Attacking in three sides...")
$nbSides = 3
Case 3 ;Two sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetLog("~Attacking in all sides...")
$nbSides = 4
EndSwitch
if ($nbSides = 0) Then Return
If _Sleep(1000) Then Return
; ================================================================================
; ========= Here is coded the main attack strategy ===============================
; ========= Feel free to experiment something else ===============================
; ================================================================================
algorithmTH()
if LauchTroop($eGiant, $nbSides, 1, 1, 1) Then
If _Sleep(1000) Then Return
EndIf
if LauchTroop($eBarbarian, $nbSides, 1, 2) Then
If _Sleep(1) Then Return
EndIf
if LauchTroop($eArcher, $nbSides, 1, 2) Then
If _Sleep(1) Then Return
EndIf
If _Sleep(1) Then Return
If LauchTroop($eBarbarian, $nbSides, 2, 2) Then
If _Sleep(1) Then Return
EndIf
if LauchTroop($eWallbreaker, $nbSides, 1, 1, 1) Then
If _Sleep(500) Then Return
EndIf
If LauchTroop($eGoblin, $nbSides, 1, 2) Then
If _Sleep(500) Then Return
EndIf
If LauchTroop($eArcher, $nbSides, 2, 2) Then
If _Sleep(1) Then Return
EndIf
If LauchTroop($eGoblin, $nbSides, 2, 2) Then
If _Sleep(500) Then Return
EndIf
Upper = Func algorithm_AllTroops
Lower = algorithmTH() = Where you can edit the speed
By the way dinobot any idea how can i speed up the 2nd ware barbarian? there is a little delay in deploying the troops?
update: i got it already
Code:
if LauchTroop($eArcher, $nbSides, 1, 2) Then
If _Sleep(1) Then Return
EndIf
If _Sleep(1) Then Return
Take delight in the LORD, and he will give you the desires of your heart - Psalm 37:4