The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

Dropping troops

Started by Coldpaw Β· Jan 5, 2015

11 replies151,123 views
Jan 5, 2015#1

Any chance it could do like lazypressing with dropping troops like going up and down instead of one place?πŸ™‚. hope you know what i mean

Jan 5, 2015#2

i got no idea what you mean but basically everything is possible πŸ˜‰

Jan 5, 2015#3

hmm not sure how to explain itπŸ˜›

Jan 5, 2015#5

This is doable, but a little too much work for a feature that doesn't add functionality. Probably will be worked on once every kink is worked out.

Cryzies

Jan 5, 2015#6

ah okieπŸ˜‰

Jan 5, 2015#7

@Coldpaw That is actually very easy to implement, it's not really dragging the mouse though. It is just clicking one at a time with a certain speed in that area and can easily be achieved. I will later improve the attack algorithm to make it easier to make one and actually make custom ones by yourself even if you do not know how to code.

Jan 6, 2015#8

πŸ˜‰

This is essentially useful to avoid possible detection. an experienced player drops troops using 2 fingers swiping motion (for barchers). just my 2 cents πŸ™‚

Jan 6, 2015#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:

		Local $numBarbPerWave = Ceiling($atkTroops[$Barb][1] / 2)
		Local $numArchPerWave = Ceiling($atkTroops[$Arch][1] / 2)

		Switch $deploySettings
			Case 0 ;Two sides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
				SetLog("~Attacking in two sides...")
				If _Sleep(1000) Or $RunState = False Then ExitLoop
				;Local $numBarbPerSpot = Ceiling((($atkTroops[$Barb][1] / 2) / 5) / 2)
				;Local $numArchPerSpot = Ceiling((($atkTroops[$Arch][1] / 2) / 5) / 2)



				SetLog("Dropping first wave of Barbarians")
				;Drop first round of Barbarians
				Click(68 + (72 * $Barb), 595) ;Select Troop
				If _Sleep(100) Or $RunState = False Then ExitLoop (2)

				$i = 0
				While 1
					For $a = 0 To 4
						If $i = $numBarbPerWave Or Not $RunState Then ExitLoop(2)
						Click($TopLeft[$a][0], $TopLeft[$a][1])
						Sleep(Random(150, 200))
						$i += 1
					Next
					For $a = 0 To 4
						If $i = $numBarbPerWave Or Not $RunState Then ExitLoop(2)
						Click($TopRight[$a][0], $TopRight[$a][1])
						Sleep(Random(150, 200))
						$i += 1
					Next
					For $a = 3 To 0 Step -1
						If $i = $numBarbPerWave Or Not $RunState Then ExitLoop(2)
						Click($TopRight[$a][0], $TopRight[$a][1])
						Sleep(Random(150, 200))
						$i += 1
					Next
					For $a = 4 To 1 Step -1
						If $i = $numBarbPerWave Or Not $RunState Then ExitLoop(2)
						Click($TopLeft[$a][0], $TopLeft[$a][1])
						Sleep(Random(150, 200))
						$i += 1
					Next
Jan 6, 2015#10

Antidote wrote:

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:

Thx, but did not work got error when it found base matching my settings will post the error code here in some mins

Got something to add?

Log in to post a reply.

Join the conversation