Skip to content

Commit

Permalink
2.287
Browse files Browse the repository at this point in the history
  • Loading branch information
Irmagon authored Nov 8, 2024
1 parent 01f9839 commit c94c0cb
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions HeroWarsHelper_phone.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
// @name:en HeroWarsPhone
// @name:ru HeroWarsPhone
// @namespace HeroWarsPhone
// @version 2.296
// @version 2.297
// @description Automation of actions for the game Hero Wars
// @description:en Automation of actions for the game Hero Wars
// @description:ru Автоматизация действий для игры Хроники Хаоса
// @author ZingerY
// @license Copyright ZingerY
// @homepage https://zingery.ru/scripts/HeroWarsHelper.user.js
// @downloadURL https://irmagon.github.io/HeroWarsHelper_phone.user.js
// @updateURL https://irmagon.github.io/HeroWarsHelper_phone.user.js
// @icon https://zingery.ru/scripts/VaultBoyIco16.ico
// @icon64 https://zingery.ru/scripts/VaultBoyIco64.png
// @match https://www.hero-wars.com/*
Expand Down Expand Up @@ -2389,9 +2391,11 @@ async function checkChangeResponse(response) {
description: respond.error.description,
}));
}
if (error.name != 'AccountBan') {
delete respond.error;
respond.results = [];
}
}
let mainReward = null;
const allReward = {};
let countTypeReward = 0;
Expand Down Expand Up @@ -3373,11 +3377,16 @@ const popup = new (function () {
this.buttons = [];
this.checkboxes = [];
this.dialogPromice = null;
this.isInit = false;

this.init = function () {
if (this.isInit) {
return;
}
addStyle();
addBlocks();
addEventListeners();
this.isInit = true;
}

const addEventListeners = () => {
Expand Down Expand Up @@ -3743,6 +3752,9 @@ const popup = new (function () {
}

this.confirm = async (msg, buttOpt, checkBoxes = []) => {
if (!this.isInit) {
this.init();
}
this.clearButtons();
this.clearCheckBox();
return new Promise((complete, failed) => {
Expand Down Expand Up @@ -7301,8 +7313,8 @@ function lettersFilter(letters) {
const lettersIds = [];
for (let l in letters) {
letter = letters[l];
const reward = letter.reward;
if (!reward) {
const reward = letter?.reward;
if (!reward || !Object.keys(reward).length) {
continue;
}
/**
Expand Down Expand Up @@ -11718,5 +11730,6 @@ class executeBrawls {
* Закрытие окошек по Esc +-
* Починить работу скрипта на уровне команды ниже 10 +-
* Написать номальную синхронизацию
* Добавить дополнительные настройки автопокупки в "Тайном богатстве"
* Запрет сбора квестов и отправки экспеиций в промежуток между локальным обновлением и глобальным обновлением дня
* Улучшение боев
*/

0 comments on commit c94c0cb

Please sign in to comment.