Jump to content
Sign in to follow this  
chalicucu

CSV DROP option to drop remain troops

Recommended Posts

Hi all,

If you are using CSV script and want to tell the bot to drop left over troops, then this is how to modify bot to handle this case:

1. Modify BOT:

   Open file "COCBot\functions\Attack\AttackCSV\ParseAttackCSV.au3" and change the line with content:         

DropTroopFromINI($value1, $index1, $index2, $indexArray, $qty1, $qty2, $value4, $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)

TO:

         

If $value4 = "REMAIN" Then 		;drop remain troops
	SetLog("dropRemain:  Dropping left over troops", $COLOR_BLUE)
	IF PrepareAttack($iMatchMode, True) > 0 Then
		For $ii = $eLava To $eBarb Step -1; lauch all remaining troops from last to first
			LauchTroop($ii, 1, 0, 1)
		Next
	EndIf
Else
	DropTroopFromINI($value1, $index1, $index2, $indexArray, $qty1, $qty2, $value4, $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
EndIf

2. Modify CSV file:

   Using DROP command and set troop name as "Remain" to tell the bot to drop remain/unused troops. Usually, I do this at the end of script

   Example:

DROP  |A           |1-10       |1          |Remain     |0          |0          |100-500    |           |Drop Remain Troops 

 

Try it if you are interested with this option!

  • Upvote 3

Share this post


Link to post
Share on other sites

Interesting idea?  Thanks for sharing.

 

CSV scripts were designed to be carefully engineered attack with precise army and carefully planned drop locations like a human would make. CSV script allow users to create troop funnel to better guide troops into code and win more stars.  There is already a method in the CSV to identify remaining troops "RECALC", and you always have the option to add fail safe drop vectors for rare occasion that extra troops remain due the red line issue #3 below.  I added these the TH9 GoWiPe CSV released in V6 bot to help show that CSV need error proofing for those 1 in 100 redline problems.

 

But IMHO - Adding this option is like putting a band aid on arm or leg after it was cut off with a chain saw by a zombie?  Why?

 

Properly designed CSV should not have left over troops.  If there are left over troops, then there is BUG or attack design problem that needs to be fixed?

 

#1: If left over troops are related to MOD's enabling fast android click feature that is known to have bugs, was disabled in developer release for not being ready for general use, then why use fast click settings that do not drop all troops?  This is a MOD design or user setting BUG.

 

#2:  If left over troops are due a bug in CSV were it is the drop point is off the map when red line is already past the grass edge, then there is script BUG that needs to be solved?

 

#3:  If the left over troops are due a known bug with red line on bases where there are obstacles (flags mostly) on the red line at the edge, then the red line may not return points properly inside a vector slice.  When this happens, adding a CSV REMAIN command that tries to drop on same bad vector, will not drop any remaining troops?  Only way to ensure all troops are dropped, is by adding several remain commands each using different vector with goal to ensure you miss the bad slice?

 

This might be a great work around to allow users to drop troops like a crazy bot using fastest possible drop times on 4F/8F scripts.  But MBR was designed to be conservative farming bot, which tries to reduce risk of ban avoiding bot like behavior.  Adding "REMAIN" makes it look more like a bot.   Since I prefer to stop the zombie attack to not get my leg cut off, and avoid needing a bandage on top after it is too late;  I vote for fixing/avoiding the problem up front!

 

Bot On!

Share this post


Link to post
Share on other sites

Yes. Thank you for explaining. Your list of reason is right.

But in my case, I'm using official bot with no fast click.

It almost parsing correct, but sometimes it's not, I don't know why. Only half of troops deployed, example.

That why I need this option and of course, I do it on my risk. ;p

Fortunately, I see the left over troops' dropping look like human in almost case :perfect: , especially if we have good setup of vector and index.

Thanks!

 

Edited by chalicucu

Share this post


Link to post
Share on other sites

@chalicucu 

Suggest you turn on CSV debug which enables you full post analysis of CSV scripts.  It even generates a location drop map of base being attacked, plus saves a clean copy for "testing".  Look for $debugAttackCSV = 0 &  $makeIMGCSV = 0 in global variables file, set them equal to "1" and it will provide all data needed to understand why troops are not being dropped.

Like I said above, much prefer to find/fix bugs than create work around.   Honestly, CSV scripts are relatively new to bot.  There have not been many bug reports on unmodified developer release.  Even though I have run several different scripts for more than 3 months on each one, would not be surprised to find new bugs in code. :) 

:D

  • Upvote 2

Share this post


Link to post
Share on other sites

Today I changed the DROP remain to use DropTroopFromINI for drop remain troops. So it is the same as CSV/human like now!

And also we can using DROP REMAIN as normal drop: can choose side, position, delay time... to deploy troops.

 

						If $value4 = "REMAIN" Then 		;chalicucu drop remain troops
							SetLog("dropRemain:  Dropping left over troops", $COLOR_BLUE)
							IF PrepareAttack($iMatchMode, True) > 0 Then
								For $ii = 0 To UBound($TroopGroup) - 1; lauch all remaining troops
									DropTroopFromINI($value1, $index1, $index2, $indexArray, 200, 200, $TroopGroup[$ii][0], $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
									If _Sleep(200) Then Return
								Next
								For $ii = 0 To UBound($TroopGroupDark) - 1; lauch all remaining dark troops
									DropTroopFromINI($value1, $index1, $index2, $indexArray, 200, 200, $TroopGroupDark[$ii][0], $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
									If _Sleep(200) Then Return
								Next
							EndIf
						Else
							DropTroopFromINI($value1, $index1, $index2, $indexArray, $qty1, $qty2, $value4, $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
						EndIf

 

Another reason to using DROP Remain is when we change from one profile to other profile. The army of older profile is different with the new one, so some troops remained before is not included in new CSV attack, then those troops should be drop on first new profile attack.

Edited by chalicucu
  • Upvote 2

Share this post


Link to post
Share on other sites

Having a drop remaining seems like a simple and necessary function.

 

I didn't know about your solution, I simply added all the troops and spells possible after my attack let them drop. (Ugly solution but works)

 

Saying the bot is perfect and will never have a single troop left over or wrong is disingenuous, anyone running bots and especially multiple bots under high load knows this is a problem.

 

Even as simple as changing profiles or a troop even messing up troop comps being able to let the bot clear camps after 1-2 cycles is 1000* easier then having to manually empty camps on hundreds of accounts.

 

Add it to the code, put it in a neat little check box near all the hero's and spells and forget about it.

  • Upvote 1

Share this post


Link to post
Share on other sites
On 7/29/2016 at 4:43 PM, chalicucu said:

Today I changed the DROP remain to use DropTroopFromINI for drop remain troops. So it is the same as CSV/human like now!

And also we can using DROP REMAIN as normal drop: can choose side, position, delay time... to deploy troops.

 

						If $value4 = "REMAIN" Then 		;chalicucu drop remain troops
							SetLog("dropRemain:  Dropping left over troops", $COLOR_BLUE)
							IF PrepareAttack($iMatchMode, True) > 0 Then
								For $ii = 0 To UBound($TroopGroup) - 1; lauch all remaining troops
									DropTroopFromINI($value1, $index1, $index2, $indexArray, 200, 200, $TroopGroup[$ii][0], $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
									If _Sleep(200) Then Return
								Next
								For $ii = 0 To UBound($TroopGroupDark) - 1; lauch all remaining dark troops
									DropTroopFromINI($value1, $index1, $index2, $indexArray, 200, 200, $TroopGroupDark[$ii][0], $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
									If _Sleep(200) Then Return
								Next
							EndIf
						Else
							DropTroopFromINI($value1, $index1, $index2, $indexArray, $qty1, $qty2, $value4, $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
						EndIf

 

Another reason to using DROP Remain is when we change from one profile to other profile. The army of older profile is different with the new one, so some troops remained before is not included in new CSV attack, then those troops should be drop on first new profile attack.

 

I favourite mod is no longer supported so I was doing some "modding" myself.

 

I can see this code no longer works because variable names have changed.

I noticed $iMatchMode should be $g_iMatchMode

And $TroopGroup doesn't seem to be correct.

 

Can somebody give me some advice what this should be now.

(I've spent the best part of an afternoon looking over the code :( )

 

Thanks in advance

Share this post


Link to post
Share on other sites
On 1/30/2019 at 6:11 AM, notMe said:

 

I favourite mod is no longer supported so I was doing some "modding" myself.

 

I can see this code no longer works because variable names have changed.

I noticed $iMatchMode should be $g_iMatchMode

And $TroopGroup doesn't seem to be correct.

 

Can somebody give me some advice what this should be now.

(I've spent the best part of an afternoon looking over the code :( )

 

Thanks in advance

Hi dear donator. I was searching for somthing and I saw your post here. if you still want to have it, after download last version, (now is MBRv7.7)

Open file "COCBot\functions\Attack\AttackCSV\ParseAttackCSV.au3" and change the Line 293 with content:

DropTroopFromINI($value1, $index1, $index2, $indexArray, $qty1, $qty2, $value4, $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)

To:

                            ; REMAIN Command
                            If $value4 = "REMAIN" Then
                                SetLog("Drop|Remain:  Dropping left over troops", $COLOR_INFO)
                                ; Let's get the troops again and quantities
                                If PrepareAttack($g_iMatchMode, True) > 0 Then
                                    ; a Loop from all troops
                                    For $ii = $eBarb To $eIceG ; lauch all remaining troops
                                        ; Loop on all detected troops
                                        For $x = 0 To UBound($g_avAttackTroops) - 1
                                            ; If the Name exist and haves more than zero is deploy it
                                            If $g_avAttackTroops[$x][0] = $ii and $g_avAttackTroops[$x][1] > 0 Then
                                                Local $plural = 0
                                                If $g_avAttackTroops[$x][1] > 1 Then $plural = 1
                                                Setlog("Qty: " & $g_avAttackTroops[$x][1], $COLOR_DEBUG)
												DropTroopFromINI($value1, $index1, $index2, $indexArray, $g_avAttackTroops[$x][1], $g_avAttackTroops[$x][1], $g_asTroopShortNames[$ii], $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
                                                CheckHeroesHealth()
                                                If _Sleep($DELAYALGORITHM_ALLTROOPS5) Then Return
                                            EndIf
                                        Next
                                    Next
                                EndIf
                            Else
								DropTroopFromINI($value1, $index1, $index2, $indexArray, $qty1, $qty2, $value4, $delaypoints1, $delaypoints2, $delaydrop1, $delaydrop2, $sleepdrop1, $sleepdrop2, $debug)
							EndIf

 

  • 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...