CodeSlinger69 / ClAsHbOt

Clash of Clans Farm Bot
87 stars 48 forks source link

December 10, 2015 Client Update Thread #29

Closed CodeSlinger69 closed 8 years ago

CodeSlinger69 commented 8 years ago

Yup, this looks like a big update. TH11 and a bigger map.

You should all expect serious downtime on the bot, as this is likely going to take me a while to accommodate these changes into the code. I'll keep this thread updated as I make progress.

CodeSlinger69 commented 8 years ago

Changed the title from "October" to "November". Maybe we will get it this month?

CodeSlinger69 commented 8 years ago

Sneak Peek #1 is out, and it has details on changing how shields work. I don't see any impact to the bot with this change. http://supr.cl/Shields1

Sneak Peek #2, villiage guard idea. No impact to bot, in fact the bot has had a village guard since its inception! (It's the "Keep Online" checkbox, hahahahaha). http://supr.cl/Shields2

Sneak Peek #3, loot and cups tweaks. This farm bot is still mostly about grinding loot from collectors, however, it has had an "Auto Snipe" feature for a while. http://supr.cl/LootBonusesTrophies

Sneak Peek #4, larger game area and increased raid timing. Map size increase from 40x40 to 40x44. This is the one I was worried about most, to be honest, in terms of bot impact. https://youtu.be/pTJaeQjmIFc

Sneak Peek #5, donate dark spell, bigger safety area around Next button. There are impacts to the "Donate Troops" feature of the bot, but these should be trivial to fix. https://youtu.be/5_WA1H3_geA

Sneak Peek #6, Wizard Tower level 9, Laboratory level 9, Gold Storage & Elixir Storage level 12. -https://youtu.be/nSmQxTI8J9M

Sneak Peek #7, New defenses at TH 11: Cannon, Archer Tower, Wizard Tower and X-Bow. Freeze Spell level 1 available at TH 9. No link. No impact to bot.

Sneak Peek #8, Minion L7, Boost cost reduction. No impact to bot.

Sneak Peek #9, Witch L3, reduced nexting cost at TH10. No impact to bot.

Sneak Peek #10, new achievements, healer nerf. No impact to bot.

Sneak Peek #11, new hero. "Grand Warden" LOL. https://www.youtube.com/watch?v=DYNyq47dbCo

Sneak Peek #12, Eagle defense at TH11, no bot impact.

May be additional changes not revealed in sneak peeks. Will monitor deployment on 12/10 and note changes here.

Other thoughts/reminders:

rumbla commented 8 years ago

:( RIP snipes

CodeSlinger69 commented 8 years ago

Well, as expected, Sneak Peek #4 is the killer, and is my first course of business.

I've spent most of the day fiddling with BlueStacks and trying to see if I can get the screen zoom level back to the pre-update settings. If I could do this, then I would not need to recapture all images and fonts.

Unfortunately, it looks like just fiddling with the zoom is not going to work. At this point my approach is to 1) move to a "square" layout (1024x800), then 2) recapture all images, adjust all regions, recapture all fonts. The thinking is that since I have to recapture all this stuff anyway, I might as well move to the square layout and remove some of the complexity around screen panning and troop deployment. I've decided that SC just doesn't care about bots, so whether or not our BlueStacks layout looks like a "phone" layout or not is largely irrelevant from a stealth perspective.

This is a daunting task and it could take a month or more to get this done, so be patient and stay tuned to this thread for updates.

rumbla commented 8 years ago

Just a though, but MANY laptop have a max resolution of 1366x768. Would the bot work there? Also, wouldn't be better use a smaller resolution? BlueStacks would probably run faster/better too.

CodeSlinger69 commented 8 years ago

Good point, rumbla. I'm already 4 hours into making changes though, so I'm not keen on going back and changing my target resolution right now. I think it will be OK - the bottom part of the BlueStacks window will be offscreen, but there is nothing relevant in those 30 pixels anyway. I'll test on my laptop (that has that resolution) shortly to be sure, however, and (sigh) make adjustments if needed.

CodeSlinger69 commented 8 years ago

I just checked in my changes from today. This is going much faster than I expected, however it is not usable at this point in time. More work to be done. Commit: https://github.com/CodeSlinger69/ClAsHbOt/commit/deb8e9e70d093ec71edd86a292d5ab88edc3938a

rumbla commented 8 years ago

eheh, for sure the first time was slower. Now, after you already did it...it's just a matter of reapplying it and that is clearly going faster! Kudos.

peter-coc commented 8 years ago

You should take up a paypal collection, i'm betting a couple bucks would help get this running again by this weekend :)

CodeSlinger69 commented 8 years ago

Today's changes: https://github.com/CodeSlinger69/ClAsHbOt/commit/1da5622ad60416ce3c4d8cd6c1b25d5087ac9ed6

The bot works (kind of)! Now to find the right trophy level where I can actually find collector raids :P

You should be able to farm for the most part now. However there will be bugs...a lot of code and a lot of images changed. Please be patient and report any bugs that you find in this thread. That said, I've been farming for a few hours now, and it seems to be ok. I've updated the OP in this thread by striking through the items that I have completed.

Here's what I still have on my todo list:

You can help with image collection if you are so inclined. It would make things go much faster for me. Capture them in the most zoomed out level, and as a .bmp. Zip up the .bmp and attach it to this thread. I need these images:

Resource collectors: Elix L9, Elix L10, Gold L10 Storages: Gold L10 and Elix L10, 0%, 25%, 50%, 75%, 100% full

CodeSlinger69 commented 8 years ago

As to the money idea. I've considered that (on this project and others). The big problem is that as soon as you accept money, people have different expectations of you. I do this for myself and for fun. You guys just happen to be the recipients of goodwill. Enjoy!

chrishubert commented 8 years ago

I can't get the screen resolution to work on my display (display native resolution of : 1366x768)

12/12/2015 10:05:30 AM Stopping BlueStacks process: BstHdAndroidSvc
12/12/2015 10:05:33 AM Killed BlueStacks process: HD-FrontEnd.exe
12/12/2015 10:05:33 AM Killed BlueStacks process: HD-Agent.exe
12/12/2015 10:05:33 AM Killed BlueStacks process: HD-UpdaterService.exe
12/12/2015 10:05:33 AM Wrote registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Width = 1024
12/12/2015 10:05:33 AM Wrote registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Height = 800
12/12/2015 10:05:33 AM Wrote registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\WindowWidth = 1024
12/12/2015 10:05:33 AM Wrote registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\WindowHeight = 800
12/12/2015 10:05:33 AM Wrote registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\GuestWidth = 1024
12/12/2015 10:05:33 AM Wrote registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\GuestHeight = 800
12/12/2015 10:05:33 AM Restarting BlueStacks.
12/12/2015 10:05:46 AM Launched BlueStacks, pid=2508
12/12/2015 10:05:47 AM BlueStacks started successfully.

I checked the values of the registry and they are fine..

By adding in BlueStacks.au3

DebugWrite($clientPos[3]-$clientPos[1]+1)

The script detects a height of: 751 Seems like the clipped part of the window at the bottom is not taken in account :sob:

capture

CodeSlinger69 commented 8 years ago

Confirmed on my laptop too, Chris. Damn. I need to run this bot occasionally on my laptop as well, so this is no good. Let me look into a 800x600 res and see what I need to fix... Should have thought this through more carefully, it seems.

rumbla commented 8 years ago

I think you could go up from, 800x600 to 860x720 and streamline with all the other bots around. Using BS2, you could bring up a decoration-less window using "HD-Frontend.exe Android", instead of starting the launcher "BlueStacks.exe". In that case your the resolution becomes 860x672.

I think 860x672 is the biggest "square" resolution you can achieve with 1366x762 display resolution.

In this case, you could even use "images" from other opensource (fake opensource?) bots.

CodeSlinger69 commented 8 years ago

Thanks, rumbla. I didn't realize that 860x672 was a "standard" botting resolution. :) I'll work on this today folks...since I've already fixed all the logic for this new release, adjusting regions, capturing fonts and images should go pretty quickly.

Madraka commented 8 years ago

capture 1366x762 display resolution

peter-coc commented 8 years ago

i cloned the new repo and ran the clash file but it blows up on window size too, whats the new resolution?

ddddddclash commented 8 years ago

On Sniping I have modified the bot - Just colors - so that it can search and find bases that it can snipe. Right now it only finds TH8 and maybe 10. TH 7 and 9 say the town hall is obscured. I am guessing that I can take a screen shot of these with the modified resolution and be good to go.

It seems to read the numbers and loot fine right now, but the more I use it the more little things I find.

Still I have been making a lot with it because there is now a bunch of loot in the town hall.

Future consideration - or how I will probably modify my bot: I will have it look for exposed town halls with enough loot and focus on the town hall. It still gives one star, trophies, and now it gives even more loot than the old bonus loot scheme. I figure some people have stopped playing and abandoned their bases so it is always worth searching for.

If there is something you want help with let me know.

CodeSlinger69 commented 8 years ago

New commit: https://github.com/CodeSlinger69/ClAsHbOt/commit/a69d77dd6d329ca4104a896f4ac03d1afdf56785

This is with a laptop-friendly, bot-standard, 860x672 resolution. OP is up to date with Todos. Bot will farm and collect loot. Keep online works. Ignore storages works. Still need help with images as in an above post:

Still have not tested other strategies than barch, sill have not tested sniping. Donate does not work and is what I am going to focus on next.

CodeSlinger69 commented 8 years ago

Ack, there are errors when deploying from the bottom on a raid, with the above commit. Please wait until I fix it before you use Auto Raid.

Edit: Corrected in https://github.com/CodeSlinger69/ClAsHbOt/commit/6ed32154252a7183fcc1236c2566668dd38cbe71 Clash on!

ddddddclash commented 8 years ago

I am getting this error.

12/12/2015 7:39:46 PM Stopping BlueStacks process: BstHdAndroidSvc
12/12/2015 7:39:48 PM Killed BlueStacks process: HD-Agent.exe
12/12/2015 7:39:48 PM Error killing BlueStacks process: HD-UpdaterService.exe Code: 0

So I use your Kill all BS Services.bat file and then use my own registry settings.

Also @rumbla what is this 860x672 resolution and how do you get that? I understand the 860x720 is a round number, but then several other bots use 860x729. I am thinking of CGB and it's derivatives.

rumbla commented 8 years ago

@ddddddclash BlueStacks1 registry are set to 860x720 with a 48pixels SoftControlBar. The usable Android resolution becomes 860x672.

When using BlueStacks2 and "HD-Frontend.exe Android" to start the BS VM, you need to set it at 860x672. As of now, I'm not able to bring up that SoftControlBar within BlueStacks2.

EDIT: Seems the last version of BrokenBot (4.0, ClosedSource C#) will use a 860x780 resolution. Aka, 860x732 Android resolution. They probably don't care about the SoftControlBar being hidden, or they devised a way to capture "hidden" content. EDIT2: Alright, seems like BrokenBot isn't the only one changing resosultuon. Even at MyBot seems like they chosed 860x780 within reasons. Well, just one. Avoid every kind of scrolling when completely zoomed out. Seems like my previous suggestion wasn't that good after all. I feel sorry now...

[FEATURE REQUEST]: Any chance to get a "Preserve Shield" feature? I believe that scheduling and multi-accounts is the way to go. 1: swap to "account1" + Bot 3h ... shield --> goto2 2: swap to "account2" + Bot 3h ... shiled --> goto3 3: swap to "account3" + Bot 3h ... shiled --> goto1

CodeSlinger69 commented 8 years ago

S'ok, rumbla. This res is working out fine for me.

As to the account swapping ... I don't even know how to do that manually. I have two different VMs for my two accounts.

rumbla commented 8 years ago

You can do it directly within the game, using GooglePlay. Tap the Settings icon, disconnect from "Google Play Sign-In" and reconnect (like a double tap there). At this point GooglePlay will kick in and from there, choosing different google accounts, you can swap village.

After the account is chosen, GooglePlay is done. At this point the game will pop up a "Load village?" and a "Are you sure?" windows. Just an idea, to preserve some shield...and to avoid some SuperCell Rage.

zuloloxi commented 8 years ago

Hello ! To run Multiple Accounts with BlueStacks, I used a windows .cmd script (or .bat), but it will NOT be able to start multiple BlueStacks instances at the same time, for detail see the link, and for coc, the comments. http://www.thewizardsmanse.com/multiple-app-accounts-using-bluestacks/ All the best !

rumbla commented 8 years ago

@zuloloxi, that's not really needed tbh. GooglePlay let you play multiple accounts just fine.

zuloloxi commented 8 years ago

ok ! But with the script could start automatically ! or to start from autoit ...but sometimes, when there are updates, it's difficult to synchronize all accounts with google play!

CodeSlinger69 commented 8 years ago

I never got Google Play to work correctly to switch accounts. But I have other things to worry about right now.

Donate Troops is now working in this commit: https://github.com/CodeSlinger69/ClAsHbOt/commit/594d813517c47c8f0f7c030a4a0a8edb085d76f9 OP updated.

As usual, please report bugs. I've created a new issue to possibly enhance the Donate Troops function to support dark spell donation: https://github.com/CodeSlinger69/ClAsHbOt/issues/35

Edit: Accidentally left testing/debug code in charge. Fixed here: https://github.com/CodeSlinger69/ClAsHbOt/commit/3f6a0f1c0de7c11a44d3dfdff0f92eae8b61c05d

CodeSlinger69 commented 8 years ago

Things seem to be working well so far with the latest commits. I have a few images and few font characters (of lesser importance) to capture, but no real bugs that I have seen.

The bigger problem is that the bot is working fine on my TH7 account. On my TH10 account, it is failing....there are simply no collector raids available, it seems. All the loot is deep in the base and requires "war" troops to get to...will be interesting to see if this farm bot is even viable at TH10 anymore, after this update.

NotUsed commented 8 years ago

For TH10 seems to be a problem to get enough loot from dead bases, best results are below 600 trophies but its really hard to stay there as 5minutes offline result in 20+ dropping trophies raids on your base. I had bot running in higher leagues and after coming back I went from 2.1mln gold to 1.4mln, just not finding enough collector raids, its about 1 raid every 2 hours making it really difficult to save enough for any upgrades. The only option seems boosting all barracks and going heavy armies for those storages buried deeply in the bases.

cedric35133 commented 8 years ago

hi I am french , excuse me for the google translation. there is a bug in the deployment of giants.

Thank you for all the work done

bug

cedric35133 commented 8 years ago

14/12/2015 20:58:24 Setting Mouse Click Method = MouseClick 14/12/2015 20:58:24 Setting Mouse Deploy Troop Click Delay = 60 14/12/2015 20:58:24 Setting Mouse Donate Troop Click Delay = 250 14/12/2015 20:58:24 Setting AutoRaid End Delay = 0 14/12/2015 20:58:24 Setting AutoSnipe Notify Only = False 14/12/2015 20:58:24 Setting Interval Online Check = 15000 14/12/2015 20:58:24 Setting Interval Collect Loot = 180000 14/12/2015 20:58:24 Setting Interval Troop Training Check = 180000 14/12/2015 20:58:24 Setting Interval Pause Between Nexts = 2500 14/12/2015 20:58:27 Close clicked

CodeSlinger69 commented 8 years ago

Thanks, cedric, for the error report. I have not tested anything other than the barcher strategy yet. I plan on testing GiBarch, Loonian and BAM later tonight.

cedric35133 commented 8 years ago

Thank you again good job

CodeSlinger69 commented 8 years ago

New commit: https://github.com/CodeSlinger69/ClAsHbOt/commit/531b8266d524dcd325e5af374a02f33505275537

Still todo:

Almost there!

SupermansZ24 commented 8 years ago

Can someone tell me please how to change the resolution?. I'm always getting the error "Bluestacks window is the wrong size". Posting a reg file to do it would be great

chrishubert commented 8 years ago

@SupermansZ24, check this pull: https://github.com/CodeSlinger69/ClAsHbOt/pull/37

CodeSlinger69 commented 8 years ago

Is the bot not changing the resolution for you, Supermans?

chris, thanks for the pull, I've merged it in.

chrishubert commented 8 years ago

@CodeSlinger69 you have to run the bot as Administrator in Windows10 for the bot to update the resolution by itself. Running the reg file is easier for Windows10 users :smile:

CodeSlinger69 commented 8 years ago

Ah yes. Good old Win 10. I tried it. Reverted back to Win 7 in one day :P

SupermansZ24 commented 8 years ago

@chrishubert Thanks, that pull worked perfectly! @CodeSlinger69 I'm getting this error when starting the script. Running latest version of Windows 10, Autoit 3.3.14 and Bluestacks 0.9.6.4092 with a fresh copy of the latest master error

cedric35133 commented 8 years ago

Thank you, that worked perfectly Changing func zoomout for azerty keyboard " ^ - " a substitute "{ DOWN }" in Screen.au3

zoomout

cedric35133 commented 8 years ago

bug report : TH8 recognition bot attack of TH9

it seems that the bot has a recognition problem, TH8 and TH9 are visually close

15/12/2015 07:34:01 Likely TH Level 8 conf: 0.9509: th9

rumbla commented 8 years ago

For the resolution, you can alternatively use the following from a cmd.exe prompt:

reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0 /f /v GuestWidth /t REG_DWORD /d 860
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0 /f /v GuestHeight /t REG_DWORD /d 720
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0 /f /v WindowWidth /t REG_DWORD /d 860
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0 /f /v WindowHeight /t REG_DWORD /d 720

You can tweak BlueStacks' memory with: reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android /f /v Memory /t REG_DWORD /d 2048

Other regtweaks I apply:

reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\AppSync /f /v Enabled /t REG_DWORD /d 0
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\Cloud /f /v Host /t REG_SZ /d https://127.0.0.1
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\Cloud /f /v Host2 /t REG_SZ /d https://127.0.0.1
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Agent\Cloud /f /v SyncIntervalSecs /t REG_DWORD /d 172800
reg add HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Updater /f /v ManifestURL /t REG_SZ /d "http://127.0.0.1/updates/manifest_0.10.7.5601"

change the manifest string with your version, although it's not that important...

Stormtrail commented 8 years ago

Superman when I ran into those issues on an old laptop I resolved then by running the CoC script in x86 mode I believe. I think there may be some issue with AutoIT sometimes incorrectly handling 64 vs 32 bit instructions? Anyway Scraper.au3 appears to be the first function to trigger the problem. Right click on the bot script for the options list.

On Dec 14, 2015, at 11:00 PM, SupermansZ24 notifications@github.com wrote:

@chrishubert Thanks, that worked perfectly! @CodeSlinger69 I'm getting this error when starting the script. Running latest version of Windows 10, Autoit 3.3.14 and Bluestacks 0.9.6.4092

— Reply to this email directly or view it on GitHub.

CodeSlinger69 commented 8 years ago

Superman: Yes, what Storm said. Are you using 64 bit or 32 bit AutoIt? You should be using 32 bit, and I suppose I should update the wiki to make that clear.

Cedric: It looks like the TH was obscured in that image, by the King's health bar. If this is your base, try moving the TH slightly away from the heros temporarily and see if the level is correctly identified.

cedric35133 commented 8 years ago

This is the TH of an attack, attack my diaries : 5 TH8, 4 TH 9 and 1 TH 10

peter-coc commented 8 years ago

Is it possible to be able to snipe th's and attack? I'm using another bot for my main account and it seems to do quite a bit better than my 2 accounts here and it's set to snipe and attack...although not sure how much longer sniping will be a thing.

CodeSlinger69 commented 8 years ago

I have not yet adjusted and tested auto-snipe for this update. It is next on my list though. Assuming that the bot can find TH's on the outside, there is no reason that sniping should not work. I'm not seeing many of those opportunities any more though.

CodeSlinger69 commented 8 years ago

Auto Snipe has been adjusted and is working: https://github.com/CodeSlinger69/ClAsHbOt/commit/f6aea35d25322221dd8a576e5c10e9f8428dec92

Whether it will be profitable or not remains to be seen.

OP updated.