Jump to content
Sign in to follow this  
ShaneOss

Ban Wave Rationale / Parameters

Recommended Posts

1 hour ago, ShaneOss said:

 

That's OK. You don't even need to know how the smartfarm calculation is done.

There is a final X and Y coordinate for the dropping of each troop. You'd only need to randomise that X and Y location with 5px variance each way and it would be different with each drop give or take anything within the 10px range.

Just like: Random($iX - 5, $iX + 5, 1), Random($iY - 5, $iY + 5, 1)

 

This is the change I made to DropOnPixel

For $j = 0 To UBound($arrPixel) - 1 Step $offset
				Local $index = Round($j)
				If ($index > UBound($arrPixel) - 1) Then
					$index = UBound($arrPixel) - 1
				EndIf
				Local $currentPixel = $arrPixel[Floor($index)]
			        Local $x = $currentPixel[0] + random(-5,5,1)
				Local $y = $currentPixel[1] + random(-5,5,1)

			    If $j >= Round(UBound($arrPixel) / 2) And $j <= Round((UBound($arrPixel) / 2) + $offset) And $g_bIsHeroesDropped = False Then
					$g_aiDeployHeroesPosition[0] = $x
					$g_aiDeployHeroesPosition[1] = $y
					debugRedArea("Heroes : $slotsPerEdge = else ")
					debugRedArea("$offset: " & $offset)
				EndIf
				If $j >= Round(UBound($arrPixel) / 2) And $j <= Round((UBound($arrPixel) / 2) + $offset) And $g_bIsCCDropped = False Then
					$g_aiDeployCCPosition[0] = $x
					$g_aiDeployCCPosition[1] = $y
					debugRedArea("CC : $slotsPerEdge = else ")
					debugRedArea("$offset: " & $offset)
				 EndIf

				 If(Random(0,7,1)=0 And $skip=True) Then
					SetLog('Skipping drop troop')
				  Else
					 If Number($y) > 555 + $g_iBottomOffsetY Then $y = 555 + $g_iBottomOffsetY
					 AttackClick($x, $y, $nbTroopByPixel, SetSleep(0), 0, "#0098")
					 SetLog('currentPixel(x,y) :' & $currentPixel[0] & ',' & $currentPixel[1])
					 SetLog('Pixel(x,y) :' & $x & ',' & $y)
				  EndIf

			   $nbTroopsLeft -= $nbTroopByPixel
			   Next

I add +/- 5 pixels to the output, and drop 1 in 8 pixels and let the 'drop remaining troop' routine handle the excess troops.

  • Like 1

Share this post


Link to post
Share on other sites
17 hours ago, GrumpyHog said:

 

This is the change I made to DropOnPixel

For $j = 0 To UBound($arrPixel) - 1 Step $offset
				Local $index = Round($j)
				If ($index > UBound($arrPixel) - 1) Then
					$index = UBound($arrPixel) - 1
				EndIf
				Local $currentPixel = $arrPixel[Floor($index)]
			        Local $x = $currentPixel[0] + random(-5,5,1)
				Local $y = $currentPixel[1] + random(-5,5,1)

			    If $j >= Round(UBound($arrPixel) / 2) And $j <= Round((UBound($arrPixel) / 2) + $offset) And $g_bIsHeroesDropped = False Then
					$g_aiDeployHeroesPosition[0] = $x
					$g_aiDeployHeroesPosition[1] = $y
					debugRedArea("Heroes : $slotsPerEdge = else ")
					debugRedArea("$offset: " & $offset)
				EndIf
				If $j >= Round(UBound($arrPixel) / 2) And $j <= Round((UBound($arrPixel) / 2) + $offset) And $g_bIsCCDropped = False Then
					$g_aiDeployCCPosition[0] = $x
					$g_aiDeployCCPosition[1] = $y
					debugRedArea("CC : $slotsPerEdge = else ")
					debugRedArea("$offset: " & $offset)
				 EndIf

				 If(Random(0,7,1)=0 And $skip=True) Then
					SetLog('Skipping drop troop')
				  Else
					 If Number($y) > 555 + $g_iBottomOffsetY Then $y = 555 + $g_iBottomOffsetY
					 AttackClick($x, $y, $nbTroopByPixel, SetSleep(0), 0, "#0098")
					 SetLog('currentPixel(x,y) :' & $currentPixel[0] & ',' & $currentPixel[1])
					 SetLog('Pixel(x,y) :' & $x & ',' & $y)
				  EndIf

			   $nbTroopsLeft -= $nbTroopByPixel
			   Next

I add +/- 5 pixels to the output, and drop 1 in 8 pixels and let the 'drop remaining troop' routine handle the excess troops.

 

Cool. :)

I would have just used...

 

                    $g_aiDeployHeroesPosition[0] = Random($currentPixel[0] - 5, $currentPixel[0] + 5, 1)
                    $g_aiDeployHeroesPosition[1] = Random($currentPixel[1] - 5, $currentPixel[1] + 5, 1)

 

and

                    $g_aiDeployCCPosition[0] = Random($currentPixel[0] - 5, $currentPixel[0] + 5, 1)
                    $g_aiDeployCCPosition[1] = Random($currentPixel[1] - 5, $currentPixel[1] + 5, 1)

Another thing is. With minitouch enabled for click and click & drag. The random wasn't working for me. Guess its using a different method. Disabling as below works fine. :)

 

image.png.87831da38a9c77b7dd771ed3d1965c79.png

  • Like 1

Share this post


Link to post
Share on other sites

@ShaneOss @GrumpyHog

 

So changing these lines in \COCBot\functions\Attack\RedArea\DropOnPixel and recompiling along with the suggested minitouch modifications should work right ? (running a modded version so would just like to update this part).

 

Quote

$g_aiDeployHeroesPosition[0] = Random($currentPixel[0] - 5, $currentPixel[0] + 5, 1)
$g_aiDeployHeroesPosition[1] = Random($currentPixel[1] - 5, $currentPixel[1] + 5, 1)

 

and

$g_aiDeployCCPosition[0] = Random($currentPixel[0] - 5, $currentPixel[0] + 5, 1)
$g_aiDeployCCPosition[1] = Random($currentPixel[1] - 5, $currentPixel[1] + 5, 1)

 

And from what i read this is specifically for the smart farm feature?

 

A brief explanation would be really helpful.

 

Thanks

Share this post


Link to post
Share on other sites
15 hours ago, Approchable said:

@ShaneOss @GrumpyHog

 

So changing these lines in \COCBot\functions\Attack\RedArea\DropOnPixel and recompiling along with the suggested minitouch modifications should work right ? (running a modded version so would just like to update this part).

 

 

And from what i read this is specifically for the smart farm feature?

 

A brief explanation would be really helpful.

 

Thanks

Sorry mate :)

It means that for a pixel or drop point (screen coordinate) is determined for X or Y axis. Instead of being that fixed coordinate e.g. 220. It will make it will be random number between 215-225. So could be say 223 or 217 or 219 but will be different (random) every time.

 

The version I'm using uploaded above has this and other random bits added like for click train etc. You could use WinMerge or another tool to see the difference between current release and my modded release above.

Cheers!

Edited by ShaneOss
  • Upvote 1

Share this post


Link to post
Share on other sites
18 hours ago, ShaneOss said:

Sorry mate :)

It means that for a pixel or drop point (screen coordinate) is determined for X or Y axis. Instead of being that fixed coordinate e.g. 220. It will make it will be random number between 215-225. So could be say 223 or 217 or 219 but will be different (random) every time.

 

The version I'm using uploaded above has this and other random bits added like for click train etc. You could use WinMerge or another tool to see the difference between current release and my modded release above.

Cheers!

 

Thanks mate

 

And why +-5.  Is it the max offset value or is it possible to do +-10. And if possible would a +-10 or higher be better or would it mess with the attacks strats? What are your thoughts?

Thanks would check the difference between the Official version and yours.

 

Cheers

Edited by Approchable
Spelling

Share this post


Link to post
Share on other sites
3 hours ago, Approchable said:

 

Thanks mate

 

And why +-5.  Is it the max offset value or is it possible to do +-10. And if possible would a +-10 or higher be better or would it mess with the attacks strats? What are your thoughts?

Thanks would check the difference between the Official version and yours.

 

Cheers

I just think that a point somewhere random between 10px would be acceptable for a drop point. You could do more if you like but there may be a chance of things going outside boundaries (screen resolution) if too much. -10 and plus 10 would be somewhere random between 20px, which is quite a bit considering the screen to aspect ratio and the emulator screen res 860x732. :)

  • Upvote 1

Share this post


Link to post
Share on other sites
1 hour ago, ShaneOss said:

I just think that a point somewhere random between 10px would be acceptable for a drop point. You could do more if you like but there may be a chance of things going outside boundaries (screen resolution) if too much. -10 and plus 10 would be somewhere random between 20px, which is quite a bit considering the screen to aspect ratio and the emulator screen res 860x732. :)

 

Understood, Thanks for taking the time to reply mate!

 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...