Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dropping troops
#9
This is actually quite simple to do. I modified attack function to resemble what you say (if you want to look more naturally random factor can be added to coord as well)
sample code:
    AUTOIT Programming
  1. Local $numBarbPerWave = Ceiling($atkTroops[$Barb][1] / 2)
  2. Local $numArchPerWave = Ceiling($atkTroops[$Arch][1] / 2)
  3.  
  4. Switch $deploySettings
  5. Case 0 ;Two sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. SetLog("~Attacking in two sides...")
  7. If _Sleep(1000) Or $RunState = False Then ExitLoop
  8. ;Local $numBarbPerSpot = Ceiling((($atkTroops[$Barb][1] / 2) / 5) / 2)
  9. ;Local $numArchPerSpot = Ceiling((($atkTroops[$Arch][1] / 2) / 5) / 2)
  10.  
  11.  
  12.  
  13. SetLog("Dropping first wave of Barbarians")
  14. ;Drop first round of Barbarians
  15. Click(68 + (72 * $Barb), 595) ;Select Troop
  16. If _Sleep(100) Or $RunState = False Then ExitLoop (2)
  17.  
  18. $i = 0
  19. For $a = 0 To 4
  20. If $i = $numBarbPerWave Or Not $RunState Then ExitLoop(2)
  21. Click($TopLeft[$a][0], $TopLeft[$a][1])
  22. Sleep(Random(150, 200))
  23. $i += 1
  24. For $a = 0 To 4
  25. If $i = $numBarbPerWave Or Not $RunState Then ExitLoop(2)
  26. Click($TopRight[$a][0], $TopRight[$a][1])
  27. Sleep(Random(150, 200))
  28. $i += 1
  29. For $a = 3 To 0 Step -1
  30. If $i = $numBarbPerWave Or Not $RunState Then ExitLoop(2)
  31. Click($TopRight[$a][0], $TopRight[$a][1])
  32. Sleep(Random(150, 200))
  33. $i += 1
  34. For $a = 4 To 1 Step -1
  35. If $i = $numBarbPerWave Or Not $RunState Then ExitLoop(2)
  36. Click($TopLeft[$a][0], $TopLeft[$a][1])
  37. Sleep(Random(150, 200))
  38. $i += 1



Attached Files
.au3   COC Bot v5.4.0 (natural attack).au3 (Size: 98.27 KB / Downloads: 6)
Reply
 


Messages In This Thread
Dropping troops - by Coldpaw - 01-06-2015, 01:51 AM
RE: Dropping troops - by kojometa - 01-06-2015, 03:26 AM
RE: Dropping troops - by Coldpaw - 01-06-2015, 06:04 AM
RE: Dropping troops - by Envyus - 01-06-2015, 06:07 AM
RE: Dropping troops - by cryzies - 01-06-2015, 07:45 AM
RE: Dropping troops - by Coldpaw - 01-06-2015, 08:17 AM
RE: Dropping troops - by keedier - 01-06-2015, 10:18 AM
RE: Dropping troops - by GkevinOD - 01-06-2015, 09:49 AM
RE: Dropping troops - by Antidote - 01-06-2015, 11:04 AM
RE: Dropping troops - by Coldpaw - 01-07-2015, 09:55 AM
RE: Dropping troops - by Coldpaw - 01-07-2015, 10:02 AM
RE: Dropping troops - by Coldpaw - 01-07-2015, 10:08 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)

About The Bytecode Club

We're a community forum focused on Reverse Engineering, we try to target Java/Android but we also include other langauges/platforms. We pride ourselves in supporting and free and open sourced applications.

Website