HeroWarsHelper

Automation of actions for the game Hero Wars

< Valutazione su HeroWarsHelper

Recensione: Bene - lo script funziona

§
Pubblicato: 06/01/2024

Hi ZingerY,

Would you mind teaching me how to calculate a mission statistics, if possible?

Start a mission works by:
{
"calls": [
{
"name": "missionStart",
"args": {
"id": 2,
"heroes": [
2,
6,
7,
20
],
"favor": {}
},
"context": {
"actionTs": 1699833
},
"ident": "body"
}
]
}

But missionEnd includes a argument of progress that is based on a random seed, don't know how to replicate the calculation, or if it is possible to do so.

ZingerYAutore
§
Pubblicato: 06/01/2024

Hi!
Yes, sure 🙂
You need to pass the result received from the "missionStart" request to the "Calc" or "BattleCalc" function. The difference between them is that the first one return a Promise, and the second one uses a callback function to get the result.
You can find an example code in the script in the following comment: "Mission auto repeat"

§
Pubblicato: 07/01/2024

Hi ZingerY,

Thank you very much for sharing the knowledge.

Would you mind guiding me which script to look for finding the "mission auto repeat"? Btw, how would you find out the "BattleCalc" or any function call structure? I currently go through the game interactively and find the call from whatever captured by chrome devtool network, but I feel there should be a script or code base to study to understand the structure?

Thank you so much.

§
Pubblicato: 07/01/2024

I searched through game.js, app.js and hero.js from the source, but didn't find a match yet.

ZingerYAutore
§
Pubblicato: 07/01/2024

All the game code is contained in heroes.js, but it is obfuscated and difficult to read and its functions are not available in the global scope. My script uses game functions from heroes.js and gets them in a special way (more details here https://stackoverflow.com/questions/42611719/how-to-intercept-and-modify-a-specific-property-for-any-object) and makes them available as convenient "Calc" or "BattleCalc" functions.

§
Pubblicato: 07/01/2024

Noted. Thank you very much for sharing the insight. I will study your script and do some exploration.

Pubblica risposta

Accedi per pubblicare una risposta.