Skip to content

Commit

Permalink
Bugfix (#116)
Browse files Browse the repository at this point in the history
* update for bugfix due to SPS UI release

* updated version bugfix ui battle details
  • Loading branch information
alfficcadenti authored Apr 20, 2022
1 parent b29bd2b commit 86cf759
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "splinterlands-bot",
"version": "1.11.0",
"version": "1.13.0",
"description": "",
"main": "main.js",
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions splinterlandsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 86cf759

Please sign in to comment.