Jump to content

Recommended Posts

Hey guys,

 

I recently changed the code of the Laboratory feature and the Wall-Upgrade feature so that they auto upgrade and switch to the next troop/wall-level whenever the troop is maxed, upgrade finished or no wall for that wall-level left.

 

This is just some simple stuff, but it works, I have tested it for more than 2 weeks and everything worked fine (besides the maxed troop detection of Laboratory, but I fixed that as well).

 

 

 

How it works:

Laboratory:

  • Select any troop of your choice
  • The bot will then try to upgrade it and if that troop is maxed it will just change the troop to the next troop
  • If it successfully upgraded a troop and it's done then it will also switch to the next troop
  • Once it upgrades all troop from top to bottom it will then start from the top again

 

Download :

Laboratory:         Laboratory.au3

 

Installation:

Put the files in the folders below.

Laboratory: 

  • .../COCBot/functions/Village

 

You have to either start the bot via the mybot.au3 file or recompile the bot which means you need AutoIt3 x86 installed to make it work.

 

 

 

If you find any bugs or have a suggestion then please tell me I will try my best to make it work in the future or maybe a real dev can pick this up and make it to proper code and add it to the original bot so that everyone can use it in the future. :)

 

Have a nice day and bot on guys ;)

 

Updated: 5.8.2018 16:42

Edited by ZerGo0
  • Like 4
  • Upvote 7
Link to post
Share on other sites
  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hey guys,   I recently changed the code of the Laboratory feature and the Wall-Upgrade feature so that they auto upgrade and switch to the next troop/wall-level whenever the troop is maxed,

Nice work @ZerGo0

you won me by hand

Posted Images

  • 1 month later...
Am 5/19/2018 um 10:09 schrieb ZerGo0:

If you find any bugs or have a suggestion then please tell me I will try my best to make it work in the future or maybe a real dev can pick this up and make it to proper code and add it to the original bot so that everyone can use it in the future. :)

@ZerGo0, i like your effort. But Wallupgrade with automatic switch to next wall level is already part of official bot.

Link to post
Share on other sites
9 minutes ago, TripleM said:

@ZerGo0, i like your effort. But Wallupgrade with automatic switch to next wall level is already part of official bot.

It's actually not, ever since wall upgrading got upgraded to imgloc they didn't add auto upfrades to next level. Check the code if you don't believe me. ;)

Link to post
Share on other sites
vor 23 Minuten schrieb ZerGo0:

It's actually not, ever since wall upgrading got upgraded to imgloc they didn't add auto upfrades to next level. Check the code if you don't believe me. ;)

I know the code, i did the autoswitchpart as part of Mybot 7.4.

Changelog of 7.4:

* **V7.4**
...
* Improve Wall Upgrade, upgrade adjacent walls first, continous upgrade and autoswitch to next level
...

actual code in COCBot\functions\Village\UpgradeWall.au3, Lin 342:

Func SwitchToNextWallLevel() ; switches wall level to upgrade to next level
	If $g_aiWallsCurrentCount[$g_iCmbUpgradeWallsLevel + 4] = 0 And $g_iCmbUpgradeWallsLevel < 7 Then
		EnableGuiControls()
		_GUICtrlComboBox_SetCurSel($g_hCmbWalls, $g_iCmbUpgradeWallsLevel + 1)
		cmbWalls()
		SaveConfig()
		DisableGuiControls()
		Return True
	EndIf
	Return False
EndFunc   ;==>SwitchToNextWallLevel

called at lines 37, 53, 72 and 85.

code in next version will be:

Func SwitchToNextWallLevel() ; switches wall level to upgrade to next level
	If $g_aiWallsCurrentCount[$g_iCmbUpgradeWallsLevel + 4] = 0 And $g_iCmbUpgradeWallsLevel < 8 Then
		EnableGuiControls()
		_GUICtrlComboBox_SetCurSel($g_hCmbWalls, $g_iCmbUpgradeWallsLevel + 1)
		cmbWalls()
		If $g_iCmbUpgradeWallsLevel = 4 Then
			GUICtrlSetState($g_hRdoUseElixirGold, $GUI_CHECKED)
			GUICtrlSetData($g_hTxtWallMinElixir, GUICtrlRead($g_hTxtWallMinGold))
		EndIf
		SaveConfig()
		DisableGuiControls()
		Return True
	EndIf
	Return False
EndFunc   ;==>SwitchToNextWallLevel

 

try upgrading the walls in original bot with all walllevels set to 0, and start at lowest wall. ;)

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