Jump to content

bot will work with camps updated?


Recommended Posts

hace 26 minutos, dudufcb dijo:

will not work, or no have limitation? ty

If the ocr works well there should be no problem, there is no limitation in this regard, Ty.

 

Ps: (quick train?)

Func TxtQTEdit_Troop()
	Local $iTroop, $iQty, $iSpace, $iSlot
	For $j = 0 To 6
		If @GUI_CtrlId = $g_ahTxtQTEdit_Troop[$j] Then
			$iTroop = $g_aiQTEdit_TroopType[$j]
			$iQty = GUICtrlRead($g_ahTxtQTEdit_Troop[$j])
			If _ArrayIndexValid($g_aiTroopSpace, $iTroop) Then $iSpace = $iQty * $g_aiTroopSpace[$iTroop]
			$iSlot = $j
			If $iQty = 0 Then _RemoveTroop_QTEdit($iSlot)
			ExitLoop
		EndIf
		If $j = 6 Then Return
	Next
	TotalTroopCount_QTEdit()

	If $g_iQTEdit_TotalTroop > 300 Then
		Local $iSpaceLeft = 300 - ($g_iQTEdit_TotalTroop - $iSpace)
		Local $iMaxQtyLeft = Int($iSpaceLeft / $g_aiTroopSpace[$iTroop])
		ToolTip("Your input of " & $iQty & "x " & $g_asTroopNames[$iTroop] & " makes total troops to exceed possible camp capacity (300)." & @CRLF & "Automatically changing to: " & $iMaxQtyLeft & "x " & $g_asTroopNames[$iTroop])
		Sleep(2000)
		ToolTip('')
		GUICtrlSetData($g_ahTxtQTEdit_Troop[$iSlot], $iMaxQtyLeft)
		TotalTroopCount_QTEdit()
	EndIf
EndFunc   ;==>TxtQTEdit_Troop

I only found this that should be replaced @Nytol.
 

Edited by Boldina
Link to post
Share on other sites
31 minutes ago, dudufcb said:

just wonder if i update my camps will work fine? as we can set the number of troops on our camps, but i don't know if it has any limitation?

 

It should work after the update.  The Bot reads the camp space from the 'Army Tab'.  I have updated camps on a few of my accounts and the Bot works fine.  As @Boldina pointed out there is a problem if you used the Bot to save your QuickTrain army, so avoid that feature for now.

Link to post
Share on other sites

+1 quick train is broken with larger camps.

 

The bot has to deal various army sizes due rate of camp upgrades.  Higher amount will not be wholesale issue.

 

Would expect more issues due users not changing the army size in bot GUI after upgrade, that will then create army content or size issues.

 

This will make TH13 CSV more challenging.   Have to adjust any TH13 CSV attack files to compensate for larger army, or might find left over troops.

 

Long live MBR!

Link to post
Share on other sites
1 hour ago, PriapusCranium dijo:

+1 quick train is broken with larger camps.

 

The bot has to deal various army sizes due rate of camp upgrades.  Higher amount will not be wholesale issue.

 

Would expect more issues due users not changing the army size in bot GUI after upgrade, that will then create army content or size issues.

 

This will make TH13 CSV more challenging.   Have to adjust any TH13 CSV attack files to compensate for larger army, or might find left over troops.

 

Long live MBR!

boldina post a fix i think but you need to recompile it i think.

 

hace 2 horas, Boldina dijo:

If the ocr works well there should be no problem, there is no limitation in this regard, Ty.

 

Ps: (quick train?)

Func TxtQTEdit_Troop()
	Local $iTroop, $iQty, $iSpace, $iSlot
	For $j = 0 To 6
		If @GUI_CtrlId = $g_ahTxtQTEdit_Troop[$j] Then
			$iTroop = $g_aiQTEdit_TroopType[$j]
			$iQty = GUICtrlRead($g_ahTxtQTEdit_Troop[$j])
			If _ArrayIndexValid($g_aiTroopSpace, $iTroop) Then $iSpace = $iQty * $g_aiTroopSpace[$iTroop]
			$iSlot = $j
			If $iQty = 0 Then _RemoveTroop_QTEdit($iSlot)
			ExitLoop
		EndIf
		If $j = 6 Then Return
	Next
	TotalTroopCount_QTEdit()

	If $g_iQTEdit_TotalTroop > 300 Then
		Local $iSpaceLeft = 300 - ($g_iQTEdit_TotalTroop - $iSpace)
		Local $iMaxQtyLeft = Int($iSpaceLeft / $g_aiTroopSpace[$iTroop])
		ToolTip("Your input of " & $iQty & "x " & $g_asTroopNames[$iTroop] & " makes total troops to exceed possible camp capacity (300)." & @CRLF & "Automatically changing to: " & $iMaxQtyLeft & "x " & $g_asTroopNames[$iTroop])
		Sleep(2000)
		ToolTip('')
		GUICtrlSetData($g_ahTxtQTEdit_Troop[$iSlot], $iMaxQtyLeft)
		TotalTroopCount_QTEdit()
	EndIf
EndFunc   ;==>TxtQTEdit_Troop

I only found this that should be replaced @Nytol.
 

ty buddy

Link to post
Share on other sites

I have not tried quick train but looking at the code theoretically it does not work completely. (a couple mybot versions ago)

 

Specifically in the "CreateQuickTrainPreset" part, it should look something like this:

Func CreateQuickTrainPreset($i)
	SetLog("Creating troops/spells preset for Army " & $i + 1)

	Local $aRemoveButton[4] = [535, 300, 0xff8f94, 20] ; red
	Local $iArmyPage = 0

	If _ColorCheck(_GetPixelColor($aRemoveButton[0], $aRemoveButton[1], True), Hex($aRemoveButton[2], 6), $aRemoveButton[2]) Then
		ClickP($aRemoveButton) ; click remove
		If _Sleep(750) Then Return

		DragIfNeeded("Barb")
		For $j = 0 To 6
			Local $iIndex = $g_aiQuickTroopType[$i][$j]
			If _ArrayIndexValid($g_aiArmyQuickTroops, $iIndex) Then
				If $iIndex >= $eMini And $iArmyPage = 0 Then
					If _Sleep(250) Then Return
					ClickDrag(620, 445 + $g_iMidOffsetY, 620 - 373, 445 + $g_iMidOffsetY, 2000)
					If _Sleep(1500) Then Return
					$iArmyPage = 1
				EndIf
				Local $sFilter = String($g_asTroopShortNames[$iIndex]) & "*"
				Local $asImageToUse = _FileListToArray($g_sImgTrainTroops, $sFilter, $FLTA_FILES, True)
				If Not @error Then
					Local $aTrainPos = GetVariable($asImageToUse, $iIndex)
					If IsArray($aTrainPos) And $aTrainPos[0] <> -1 Then
						SetLog("Adding " & $g_aiQuickTroopQty[$i][$j] & "x " & $g_asTroopNames[$iIndex], $COLOR_SUCCESS)
						ClickP($aTrainPos, $g_aiQuickTroopQty[$i][$j], $g_iTrainClickDelay, "QTrain")
					EndIf
				EndIf
			EndIf
		Next
		For $j = 0 To 6
			Local $iIndex = $g_aiQuickSpellType[$i][$j]
			If _ArrayIndexValid($g_aiArmyQuickSpells, $iIndex) Then
				If $iArmyPage < 2 Then
					If Not DragIfNeeded("Hunt") Then Return
					If _Sleep(1500) Then Return
					$iArmyPage = 2
				EndIf
				Local $sFilter = String($g_asSpellShortNames[$iIndex]) & "*"
				Local $asImageToUse = _FileListToArray($g_sImgTrainSpells, $sFilter, $FLTA_FILES, True)
				If Not @error Then
					Local $aTrainPos = GetVariable($asImageToUse, $iIndex + $eLSpell)
					If IsArray($aTrainPos) And $aTrainPos[0] <> -1 Then
						SetLog("Adding " & $g_aiQuickSpellQty[$i][$j] & "x " & $g_asSpellNames[$iIndex], $COLOR_SUCCESS)
						ClickP($aTrainPos, $g_aiQuickSpellQty[$i][$j], $g_iTrainClickDelay, "QTrain")
					EndIf
				EndIf
			EndIf
		Next
		If _Sleep(1000) Then Return
	EndIf
EndFunc   ;==>CreateQuickTrainPreset

 

Edited by Boldina
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.

×
×
  • Create New...