From 86cf759a3d8b8bd9fb27015039e1f7556b36731c Mon Sep 17 00:00:00 2001 From: Alfredo Ficcadenti <41797528+alfficcadenti@users.noreply.github.com> Date: Wed, 20 Apr 2022 12:27:55 +0200 Subject: [PATCH] Bugfix (#116) * update for bugfix due to SPS UI release * updated version bugfix ui battle details --- package.json | 2 +- splinterlandsPage.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cde7d8e..418c97a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "splinterlands-bot", - "version": "1.11.0", + "version": "1.13.0", "description": "", "main": "main.js", "engines": { diff --git a/splinterlandsPage.js b/splinterlandsPage.js index bb888ca..bd29fcd 100644 --- a/splinterlandsPage.js +++ b/splinterlandsPage.js @@ -46,18 +46,18 @@ async function checkMana(page) { } async function checkMatchMana(page) { - const mana = await page.$$eval("div.col-md-12 > div.mana-cap__icon", el => el.map(x => x.getAttribute("data-original-title"))); - const manaValue = parseInt(mana[0].split(':')[1], 10); + const mana = await page.$$eval("div.mana-cap__icon", el => el.map(x => x.getAttribute("data-original-title"))); + const manaValue = parseInt(mana[mana.length -1].split(':')[1], 10); return manaValue; } async function checkMatchRules(page) { - const rules = await page.$$eval("div.combat__rules > div.row > div> img", el => el.map(x => x.getAttribute("data-original-title"))); + const rules = await page.$$eval("div.combat__rules > div > div > img", el => el.map(x => x.getAttribute("data-original-title"))); return rules.map(x => x.split(':')[0]).join('|') } async function checkMatchActiveSplinters(page) { - const splinterUrls = await page.$$eval("div.col-sm-4 > img", el => el.map(x => x.getAttribute("src"))); + const splinterUrls = await page.$$eval("div.active_element_list > img", el => el.map(x => x.getAttribute("src"))); return splinterUrls.map(splinter => splinterIsActive(splinter)).filter(x => x); }