Jump to content
Sign in to follow this  
ZerGo0

Troops [Full Auto Laboratory Upgrade]

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

Share this post


Link to post
Share on other sites
2 minutes ago, Randall Forte22 said:

E8B0537F-0B92-4685-97B3-3BFFB53E78E1.thumb.jpeg.16424bad69ebdbb4b78cfda96940d606.jpeg

I have no idea how that happened, it's not an error from my code And I use the same MOD as you so IDK, which troop did you select?

Edited by ZerGo0

Share this post


Link to post
Share on other sites

Just interested in the Laboratory one, seems to work great. I had one village available and it switched to the next available troop.

Thank you very much, appreciate it!

  • Like 1

Share this post


Link to post
Share on other sites
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.

Share this post


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. ;)

Share this post


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

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