Automation of actions for the game Hero Wars
The coins' ID has changed; it's now 1899000033.
It's possible it's now dynamic and will change with each new event.
I also heard that the trick of getting a chest for every letter no longer works, but I haven't verified this since I've never used it and don't see the point.
Thanks for the reply. I used the new ID in the script for heroes and titans (1899000037), and it worked! Let's hope it's not dynamic as you predict. Also, after the even ended, I tried the trick of getting the chest for every letter, and am glad to report that it still works. As someone who enjoys this "trick" immensely (we all have our weird reasons for why we play this game :-P ), I thank you for making it work again.
As expected, you were right about the coin ID becoming dynamic. Is there any way for me to determine the ID for every event without having to bother you in the comments? :-)
In other words, is there some console command I can use to grab the current Brawls coin ID? Thanks.
You can do it like this:
currentBrawlCoinId = Object.keys(Object.values(lib.data.brawl.list).find(e => {
const current = new Date;
const start = new Date(e.startCondition.ymdDate?.value);
const end = new Date(e.endCondition.ymdDate?.value);
return current > start && current < end;
}).rewards.winReward.coin)[0]
Works great, thanks a lot! For anyone who's interested, the current brawls coin id is 1959000033. I'll update this thread with the new id for every subsequent brawls event.
The current Avalon brawls coin id is 1962000037.
For the Angus brawls coin id is: 2002000037
Yeah that “MongoDB Atlas” line is just unrelated promo text, it’s not part of the script itself, you see that a lot on Greasy Fork pages when ads or injected snippets get mixed in.
As for the script, HeroWarsHelper is basically a UI automation tool for Hero Wars, it just automates clicks/actions in-game, nothing special beyond that. Just be careful though, anything like this can be against game ToS depending on how it’s used.
For the Angus brawls coin id is: 2002000037
Thanks for helping out. Can you or @ZingerY confirm if the same console command will also give the id of the Cosmic Battle coins, or is there a different console command for that? Thanks in advance.
The Cosmic Battle coins id doesn't change for now - it's always ID: 39
and not - this command will not work as it is other kind (name) of event and command refers to brawl when Cosmic Battle is epicBrawl
Upcoming Mort Brawls coins will have ID: 2062000037
Thanks for the info regarding the Cosmic Battle and upcoming Titan Brawls coins. I've modified the code in HWHLettersFilterExt as follows:
return standardCheck && !(
// Cosmic Battle Coins
(reward?.coin ? reward.coin[39] : false)
//Brawl Coins
(reward?.coin ? reward.coin[1959000033] : false) ||
//Titan Brawl Coins
(reward?.coin ? reward.coin[2062000037] : false)
);
Is this correct or do I have to add the double pipe || to the end of the previous line as well (the line with the Cosmic Battle ID)?
Never mind, I managed to figure it out on my own. The double pipe at the end of every line except the last is required, otherwise the collect mail feature doesn't run successfully. Thanks anyway.
Sorry, I didn't looked here for few days, and did not see your previous message. Yes || literally means "or"
Thanks for the explanation about the meaning of the || syntax, makes sense now.
It looks like the mail filter extension HWHLettersFilterExt is no longer working after the latest update v2.432. I had edited the script to exclude Brawls coins and it worked great so far, but yesterday when I went to Actions > Mail > Run, then refreshed the game, it had picked up the Brawls coins reward mails. Could you look into this? Thanks.