And again Dripstat
I got it out of the drafts to share with friends, the post is quite old, you can ignore
this post is inspired by this post: tyts .
I read it and thought, could browser processes be automated in this way?
Clicker is somehow too straightforward, and similar automation is not suitable for programmers.
In my opinion, this is too much, forcing the browser to process clicks one at a time when we have in our hands the full source code of the application.

So, let's begin to understand:
Really? We look carefully at the code and see, indeed, the objects are encrypted with some kind of XORCipher ...
But do we really need this? We look at the method of sending the event to the server,
- the event object comes into it,
- is encrypted,
- is sent to the server. We
analyze the event object before encryption, this is simple json: The events themselves contain information - about the accumulated amount of memory - about elapsed time (this is generally brilliant) - about purchases By slightly modifying this method, we can achieve that - the server will think that a lot of time has passed since the last save (it was experimentally found that this value cannot be more than two minutes)
- change the error handling (so as not to reload the page if something happens)
So, let's proceed to writing the miner.
Plan
- Launch, configuration
- Periodic saving. Here I preferred the "sliding" mode of setTimeout, because with setInterval inevitable blockage with network lags
- Rollback to the last valid state in case of validation error (too greedy :))
Constructor:
Next, we need to build the event:
Done.
We tie the start / stop:
Launch!
Here it is worth noting that the validation of the bytes accumulated by you depends on your "ability to generate", i.e. the number of units purchased. Therefore, at the start, I acquire, 1 piece of all devices, and pieces of 50-60 clusters, gradually increasing / playing with the speed of production ...
Result: in half an hour of writing and 4-5 hours of script operation I brought two arth / Arth accounts to the top 1-2 :) The

full text of the script
PS: Thanks for the invite :)
this post is inspired by this post: tyts .
I read it and thought, could browser processes be automated in this way?
Clicker is somehow too straightforward, and similar automation is not suitable for programmers.
In my opinion, this is too much, forcing the browser to process clicks one at a time when we have in our hands the full source code of the application.

So, let's begin to understand:
1. A superficial analysis of the messaging protocol between the server and the client showed that the message substitution would not work - the server has internal verification mechanisms.
Really? We look carefully at the code and see, indeed, the objects are encrypted with some kind of XORCipher ...
But do we really need this? We look at the method of sending the event to the server,
- the event object comes into it,
- is encrypted,
- is sent to the server. We
analyze the event object before encryption, this is simple json: The events themselves contain information - about the accumulated amount of memory - about elapsed time (this is generally brilliant) - about purchases By slightly modifying this method, we can achieve that - the server will think that a lot of time has passed since the last save (it was experimentally found that this value cannot be more than two minutes)
{
userid: "userid",
events: [ массив событий ]
}
- change the error handling (so as not to reload the page if something happens)
So, let's proceed to writing the miner.
Plan
- Launch, configuration
- Periodic saving. Here I preferred the "sliding" mode of setTimeout, because with setInterval inevitable blockage with network lags
- Rollback to the last valid state in case of validation error (too greedy :))
Constructor:
function Miner(incr, dripK, delay) {
var that = this;
this.incr = incr || localStats.bps*1e3; // сколько памяти добываем за одну итерацию
this.dripK = dripK || 0.5; // коэффициент сливания памяти
this.delay = delay || 100; // задержка между итерациями
document.hasFocus = function () {return true;};
NO_PINGY=1; // На проекте включен сбор статистики движений мышем, отключаем
// Redefine postEvent
RestEventManager.prototype.postEventData = function(e,t,next) // Тут добавили параметр next, для замыкания цикла
{
var r=XORCipher.encode(DataSaver.key,JSON.stringify(e)); // Вот оно, шифрование!
// Собственно запрос:
return $.ajax({type:"POST",async:!0,url:GAME_URL+(loggedIn?"events":"eventsanon"),data:r,contentType:"text/plain",
success: function() {
var self = this;
that.lastCorrect = localStats.byteCount; // Сохраняемся
t.apply(self, arguments); // Родной callback
setTimeout(function(){
if(localStats.byteCount > localStats.memoryCapacity * that.dripK) $('#btn-addGlobalMem').trigger('click'); // Сливаем память
}, 0);
if(typeof next == 'function')next();
},
error: function(e) {
localStats.byteCount = that.lastCorrect; // Откат
console.error(e.responseText); // show error text
if(typeof next == 'function') next(); // собственно, следующая итерация
}})
}
}
Next, we need to build the event:
Miner.prototype.postEvent = function(mem, time, next) {
var d = {
userid: networkUser.userId,
events: [{
generatedMem: mem,
power: null,
timeElapsed: time,
type: 1
}]
}
RestEventManager.prototype.postEventData(d, function(){}, next);
};
Done.
We tie the start / stop:
Miner.prototype.start = function() {
var that = this;
this.stopped = false;
this.lastCorrect = localStats.byteCount; // save before the action
function post(){
localStats.byteCount+=that.incr; // mine some bytes
that.postEvent(localStats.byteCount, 120000, function(){ // tell to server that 2minutes passed
if(!that.stopped)
that.sI = setTimeout(post, that.delay); // next iteration on response
})
}
if(this.sI) clearTimeout(this.sI);
if(!this.stopped)
this.sI = setTimeout(post, this.delay); // first call
};
Miner.prototype.stop = function() {
this.stopped = true;
};
Launch!
var miner = new Miner();
miner.start();
Here it is worth noting that the validation of the bytes accumulated by you depends on your "ability to generate", i.e. the number of units purchased. Therefore, at the start, I acquire, 1 piece of all devices, and pieces of 50-60 clusters, gradually increasing / playing with the speed of production ...
Result: in half an hour of writing and 4-5 hours of script operation I brought two arth / Arth accounts to the top 1-2 :) The

full text of the script
PS: Thanks for the invite :)