Open ghostprize opened 2 years ago
To fix this you can use:
for (let i = 0; i < PAUSE_TASK; ++i) { let modalErro = document.querySelectorAll(".modal-error.open")[0]; if (modalErro) { await new Promise((res) => setTimeout(res, 10000)); location.reload(); } await new Promise((res) => setTimeout(res, 1000)); }
Instead of:
await new Promise((res) => setTimeout(res, PAUSE_BUTTON));
This will check if the error modal appears while it wait. If any kind of error happens it reloads the page.
For the seccond error i'm rewriting the code to check what you have in the inventory, and if you don't have the food it will buy a certain amount of food for every panda of the same rarity.
For example if you don't have the uncommon food, and you have to buy it, the script will count how many pandas of the same rarity you have and multiply by a number you choose (as if you and to buy 5 foods per panda you will set it to 5) and buy all the food at once to save cpu.
I have 2 things I want you to fix.
Please help fix the problem.