HeroWarsHelper

Automation of actions for the game Hero Wars

< Feedback on HeroWarsHelper

Review: Good - script works

§
Posted: 26.05.2025
Edited: 26.05.2025

For the "Mail" button in the "Actions" menu, can you also add an exception for the "Successful Brawls Defense" reward coins that are collected during the Hero \ Titan brawls and also the Cosmic Battle event?

Collecting these rewards one at at a time (and refreshing the game each time) after the event shop has closed provides us with things like skin stone chests at big discounts (eg: 300 coins instead of 600 during the Titan Brawls). However, while the event is active, we have to manually clear the rest of the mail in order to avoid collecting these rewards, which is very tedious and a HUGE hassle.

Adding exceptions for Brawl and Cosmic Battle mails would be a great timesaver!

§
Posted: 15.06.2025

I join the request, maybe there will be some possibility to choose which letters not to collect

§
Posted: 24.06.2025

I repeat the request - is it possible to exclude awards for successful brawl defense from collect mail task?

ZingerYAuthor
§
Posted: 24.06.2025

Anything is possible, but I won't do it in the script.
Better write to the game's technical support so that they make a normal reward.

§
Posted: 24.06.2025

heah.... I'm sure they even don't reply to my message...

this letters are containing coins.... - {coin: {33: 300}}
if I was a bit more technical and better understood your script and how it works I might try to do it myself... but for now I can't

§
Posted: 25.06.2025
Edited: 25.06.2025

Anything is possible, but I won't do it in the script.

Just curious, why did you say you "won't" do it? Is not worth the time to implement, or are you against the idea itself?

BTW, writing to the game's tech support will not help as they will 100% reject the request. The Brawls Defence reward is supposed to be collected so that the coins can be spent in the shop. Saving it until the event ends so that we get more rewards for cheap goes against the intended function of the reward coins and will not be supported by the developers.

ZingerYAuthor
§
Posted: 25.06.2025

The main reason I won’t implement this is that the benefit seems too minor to justify the effort. Adding exceptions would require extra interface work, and if enabled by default, it could confuse users who expect the script to collect all mail. Additionally, reloading the game for each reward puts extra strain on resources, and successful defenses don’t happen often enough to make this a priority.

§
Posted: 26.06.2025

Fair enough, thanks for the explanation. Especially the part about repeated reloading would probably bring a lot of negative attention to the script. Makes sense.

§
Posted: 26.06.2025

Thanks Zingery for the answer.
Thanks to you and your information I was able to make some modifications to the script and I almost achieved what I wanted.
I still have to exclude a few things from automatic collection, but I was able to exclude brawl coins from collection.
I will think about "my own" add-on extending your script - something like completing missions (HWHCampaign) or automatic raids in the campaign (HWHRAIDExt).
Thanks a lot!

§
Posted: 27.06.2025

Can you publish the script as a separate project on this site, or share the code here? I'm interested in the Brawl Coins aspect. I don't care if it collects everything else, as long as it excludes the coins. Thanks.

§
Posted: 29.06.2025

Sure, I'll let you know when I'm done

§
Posted: 29.06.2025

Great! Another event that has these coins is the Cosmic Battle, in which you first select heroes to be banned and then progress through leagues. If you could add an exception for that coin type too, that would be awesome. :-)

§
Posted: 29.06.2025

yeah. yeah - there are brawls and titan brawls with similar mechanics and i nboth cases with different brawl coins as reward. I already identified them both, i know their identifiers... so when I do my addon, there will be both of them excluded from collecting.

ZingerYAuthor
§
Posted: 29.06.2025

Sure, I'll let you know when I'm done

Added the ability to override the filter for letters in version 2.355, here is an example of an extension with an override:
https://zingery.ru/scripts/HWHLettersFilterExt.user.js

§
Posted: 30.06.2025

thx ZingerY

§
Posted: 30.06.2025

I have trouble setting the exclusions correctly in collecting letters.... I am definitely doing something wrong.
I want to exclude coins e.g. 6, 14, 33, 37 and resources 3 and 51

If I do list like this:

// You can add your own conditions here

(reward?.coin ? reward.coin[6] : false);
(reward?.coin ? reward.coin[14] : false);
(reward?.coin ? reward.coin[33] : false);
(reward?.coin ? reward.coin[37] : false);
(reward?.starmoney ? true : false);
(reward?.consumable ? reward.consumable[3] : false);
(reward?.consumable ? reward.consumable[51] : false)

console.log(reward, standardCheck);

the script is collecting them anyway,

What this list of conditions should look like? Could you help?

ZingerYAuthor
§
Posted: 30.06.2025
Edited: 30.06.2025

I guess something like this
class NewLetters extends Letters {
static shouldCollectLetter(reward) {
const standardCheck = Letters.shouldCollectLetter(reward);
console.log(reward, standardCheck);
return standardCheck && !(
(reward?.coin ? reward.coin[6] : false) ||
(reward?.coin ? reward.coin[14] : false) ||
(reward?.coin ? reward.coin[33] : false) ||
(reward?.coin ? reward.coin[37] : false) ||
(reward?.starmoney ? true : false) ||
(reward?.consumable ? reward.consumable[3] : false) ||
(reward?.consumable ? reward.consumable[51] : false)
);
}
}

§
Posted: 30.06.2025

Great! I'll test it tomorrow.

Thanks a lot, I wasn't able to figure it out myself!

§
Posted: 01.07.2025

It works... kind of - every item listek like above is ommited from collecting, so it's great!
But it also prevents from collecting them if false is changed into true.... and in both cases the console log shows true as a result of collecting.
The false shows only with letters excluded in main script (e.q. with buff or stamina).

§
Posted: 01.07.2025

It works... kind of - every item listek like above is ommited from collecting, so it's great!

Which of the lines above refer to Hero Brawls, Titan Brawls, and Cosmic Battle coins? I assume I have to paste this code into the .JS file given previously and then import it using TamperMonkey?

§
Posted: 01.07.2025

coins 33 and 37, but cosmic battle dosn't reward you with successful defense

Yes, install script given above and then insert theese lines after "// You can add...."

//
//Brawl Coin
(reward?.coin ? reward.coin[33] : false) ||
//Titan Brawl Coin
(reward?.coin ? reward.coin[37] : false)
//


To test it, if it works - You can change 33 into 6 (Friendship Coin) and test if it's collect them from postmail or not

§
Posted: 01.07.2025

Thanks for the code snippet. I imported the .JS file into TamperMonkey, edited it, and pasted the line (reward?.coin ? reward.coin[6] : false) after the comment // You can add..... However, that did not work and it still collected the friendship coins.

I noticed that Zinger had posted a slightly different syntax in his code snippet, so here is how I edited the file:

class NewLetters extends Letters {
static shouldCollectLetter(reward) {
const standardCheck = Letters.shouldCollectLetter(reward);
// You can add your own conditions here
console.log(reward, standardCheck);
return standardCheck && !(
//Friendship Coin test
(reward?.coin ? reward.coin[6] : false)
);
}
}


However, this too did not work. Is this code correct? Should I remove the comment //Friendship Coin test as it appears inside the parameters?

§
Posted: 02.07.2025

as far as I can see it should work - probably You are collecting letter via postmail [Collect all] button.

To collect chosen letters you have to do it via HWH script. To do so, click Actions -> Mail (in popup window).

You'll see confirmation at the top of window if "Collected X letters" or "Nothing to collect"

§
Posted: 02.07.2025

You're right, I was indeed using the "Collect All" button, LOL. I used the script's "Mail" function and it didn't collect the Friendship Coins. Thanks for your help, and to Zinger too, for making this possible. This is such a huge "quality of life" improvement in the UI!

Post reply

Sign in to post a reply.

长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

一年攒够 12 元

云驰互联

云驰互联