The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

🖼️ Enhanced bot using memory reads

Started by Greyman · Jan 16, 2015

85 replies1,439,089 views
Jan 17, 2015#11

Greyman add me on Skype 😉

Jan 17, 2015#12

Is this from an enemy base? o_O

Greyman add me on Skype 😉

Hi Envy,

I'd like to, but unfortunately I'm unable to use Skype - at home I have the kids running around constantly (now THERE'S a massive time sink 😛), and at work the corporate firewall gets in the way.

Any other suggestions?

Grey.

Jan 17, 2015#13

We only use the message feature of Skype and have an on going developers group conversation. That is the only way we currently don't use any other methods to communicate.

Jan 17, 2015#14

here's my computation to calculate miners/pumps this should work.

double[] collector_max = { 500, 1000, 1500, 2500, 10000, 20000, 30000, 50000, 75000, 100000, 150000, 200000 };
double[] collector_ph = { 200, 400, 600, 800, 1000, 1300, 1600, 1900, 2200, 2500, 3000, 3500 };

 foreach (var B in _b.buildings)
{
int _lvl = B.lvl; // Collector level.. 
var _collectedtime = B.res_time; 
var _timedif = (collector_max[_lvl] / collector_ph[_lvl] * 3600) - _collectedtime ;
var _collectedres = (_timedif * (collector_ph[_lvl] / 3600));
 if (B.data == 1000002){ // elixir pump 
 Total_elix += (double)(_collectedres);
 }
 if (B.data == 1000004)
    { // Gold Mine
         Total_Gold += (double)(_collectedres);
    }
}

Hi Madalilng,

I've seen code very similar to this in a VMT entry, about 5 or 6 pointer references deep from the elixir collector base struct. It was one of about half a dozen routines I'd bookmarked for further analysis 🙂

Many thanks for the heads up, I'll definitely be trying this out. I'm pretty sure I've seen something similar to res_time relatively close to the VMT entry in question, which makes it the top candidate for analysis when I circle back to collectors.

Interestingly, the res_time when the collector is boosted (if what I've found is equivalent) seems to go constantly backwards, while the in-memory reference to the resource per hour stays the same. It looked like SuperCell dodgy the boost by modifying the time basepoint, rather than boosting the collection rate. Have you noticed anything similar? Bizarre if true, but the same result in the end I guess.

Jan 17, 2015#15

Some basic info to help get people going, who might also be interested in going down this path.

Some of the building types are missing - particularly TH9+, as I don't have anyone in my clan above TH8 (lame I know!). I've only started building up these types in the last few days, so it's on my to-do list to circle back and find a couple of TH9's/TH10's while raiding, to fill in the gaps.

public enum ClashBuildingType
{
	ArmyCamp = 1000000,
	TownHall = 1000001,
	ElixirCollector = 1000002,
	ElixirStorage = 1000003,
	GoldCollector = 1000004,
	GoldStorage = 1000005,
	Barracks = 1000006,
	Laboratory = 1000007,
	Cannon = 1000008,
	ArcherTower = 1000009,
	Wall = 1000010,
	WizardTower = 1000011,
	AirDefense = 1000012,
	Mortar = 1000013,
	ClanCastle = 1000014,
	BuilderHut = 1000015,
	HiddenTesla = 1000019,
	SpellFactory = 1000020,
	BarbarianKing = 1000022,
	DarkElixirDrill = 1000023,
	DarkElixirStorage = 1000024,
	DarkBarracks = 1000026
}

public enum ClashTroopType
{
	Barbarian = 4000000,
	Archer = 4000001,
	Goblin = 4000002,
	Giant = 4000003,
	Wallbreaker = 4000004,
	Balloon = 4000005,
	Wizard = 4000006,
	Healer = 4000007,
	Dragon = 4000008,
	Pekka = 4000009
}
Jan 17, 2015#16

1000021 = xbow.
1000027 = inferno tower.

Jan 17, 2015#17

minion = 4000010
hogs = 4000011
valkyrie = 4000012
Golem= 4000013
Warlock= 4000015

Jan 17, 2015#18

public enum ClashTrapType
{
Bomb = 12000000,
SpringTrap = 12000001,
GiantBomb = 12000002,
AirMine = 12000005,
SeekingAirMine = 12000006,
SkeletonTrap = 12000008
}

Jan 17, 2015#19

@Greyman, Thanks for sharing

Jan 17, 2015#20

@Greyman you say you need access to all clash content obviously to get past TH9 etc. can't you just use this: http://www.ultrapowa.com/ that way you can even boost your TH to level 10 ? or will this not work?

Got something to add?

Log in to post a reply.

Join the conversation