Giter VIP home page Giter VIP logo

splinterlands-bot's Introduction

splinterlands-bot

This is my personal project of a BOT to play the game Splinterlands. It requires NodeJs installed to run.

How to start the BOT:

REQUIREMENT: You need to install NodeJS from https://nodejs.org/en/download/ (at least the last stable version 14.18.0)

Once NodeJS is installed and you downloaded the bot in a specific folder, you need to set your configuration in the .env file:

you need to create the .env file and include the username and posting key (file with no name, only starting dot to create a hidden file) in the bot folder,

Example:

  • ACCOUNT=youraccountname
  • PASSWORD=yourpostingkey

You can also use the file .env-example as a template, but remember to remove -example from the filename.

IMPORTANT: the bot needs the username and posting key in order to login. Don't use the email and password. If you don't have the posting key, you need to 'Request Keys' from the top right menu in Splinterlands. You will receive a link to follow where you will get your Hive private keys. Store them safely and don't share them with anyone!

Once the file is created, open cmd (for windows) or terminal (for Mac and Linux) and run:

npm install

and then

npm start

There is also a youtube video made by a user that can help windows users with the setup here

If you face issue related to the browser when you run the bot for the first time, be sure you have installed chromium browser. For Linux:

install chromium

sudo apt-get install chromium-browser

run this if running chromium still fails

sudo apt-get install libpangocairo-1.0-0 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 libnss3 libcups2 libxss1 libxrandr2 libgconf2-4 libasound2 libatk1.0-0 libgtk-3-0 libgbm-dev

Optional variables:

The BOT will make a battle every 30 minutes by default, you can change the custom value specifying in the .env the variable MINUTES_BATTLES_INTERVAL. The BOT will also try to select team to complete the daily quest by default. If you want to remove this option to increase the winning rate, you can set the variable QUEST_PRIORITY as false. By default, the BOT doesn't check for season rewards but it can automatically click on the seasons reward claim button if available and the CLAIM_SEASON_REWARD is set to true. The default option is false. By default, the BOT checks automatically for daily quest rewards but the claim option can be deactivated with the option CLAIM_DAILY_QUEST_REWARD is set to false. The default option is true. By default, the BOT will run as headless. Set HEADLESS to false to see your browser. The default option is true By default, the BOT will run no matter the ECR level. Set ECR_STOP_LIMIT to a specific value you want the bot to rest and recover the ECR. The bot will recover until the ECR_RECOVER_TO is reached or until 100% ECR. If you want the bot to play only one color (when it's possible), use the variable FAVOURITE_DECK and specify the splinter by choosing only one among: fire, life, earth, water, death, dragon. If you want the bot to try to skip specific quest types you can include multiple quest in the variable SKIP_QUEST separated by the comma (SKIP_QUEST=life,snipe,neutral). whenever it's possible, the bot will click to ask for a new one. Remember you can only ask for a new one once based on the game rules. If you want the bot to prioritize teams that uses delegated cards, set the variable DELEGATED_CARDS_PRIORITY equal to true. To avoid to sue the API solution and rely only on your local history json file created as per instructions below (Local History backup), you can set the variable FORCE_LOCAL_HISTORY=true.

Example:

  • QUEST_PRIORITY=false

  • MINUTES_BATTLES_INTERVAL=30

  • CLAIM_SEASON_REWARD=true

  • CLAIM_DAILY_QUEST_REWARD=false

  • HEADLESS=false

  • ECR_STOP_LIMIT=50

  • ECR_RECOVER_TO=99

  • FAVOURITE_DECK=dragon

  • SKIP_QUEST=life,snipe,neutral

  • DELEGATED_CARDS_PRIORITY=true

  • FORCE_LOCAL_HISTORY=true

Running bot with multiaccount setting

in order to run multple accounts launching the script only once, you can simply add the list of usernames and posting keys in the .env file and set the variable MULTI_ACCOUNT as true:

  • MULTI_ACCOUNT=true
  • ACCOUNT=user1,user2,user,...
  • PASSWORD=postingkey1,postingkey2,postingkey3,...

Running bot as a daemon with PM2

To run your bot as a daemon (background process) you can use NPM package PM2. PM2 is daemon process manager, that works on Linux, MacOS, and Windows. To install PM2 globally, you need to run:

npm install pm2 -g

To start a bot, do all the preparation steps from the above, but instead of npm start, run this:

pm2 start main.js

You can now run pm2 list command to see your bot up and running. It will automatically start on system startup now. You can control the bot with these commands:

pm2 start <id>

pm2 stop <id>

pm2 restart <id>

pm2 delete <id>

You can find more information on PM2 usage options at their official webiste.

Running the bot in a docker container

docker instructions:

  1. first, you need to install docker https://docs.docker.com/get-docker/
  2. open your terminal/command line
  3. cd into your bot directory
  4. build the image -> docker build -t your_image_name -f Dockerfile .
  5. then run a container based on the image -> docker run -it your_image_name bash
  6. the 5th step will get you inside your container, use nano or vim to edit your .env file and make sure to uncomment CHROME_EXEC
  7. finally, run -> npm start

Local History backup (battlesGetData.js)

The BOT leverages an API on a free server but in case the traffic is heavy or it doesn't work, it is possible to have locally an history as a backup solution that the bot will read automatically. To generate the file 'history.json' with a unique array with the history of the battles of an array of users specified in the file.

[ OPTIONAL ] run this command from the terminal:

node battlesGetData.js

Once the script is done, it will create a file 'history.json' in the data folder. To makes the bot using it, you have to rename it in: 'newHistory.json'

How to get history data from users of my choice?

  1. Open battlesGetData.js in notepad and change the usersToGrab on line 69 to aa list of users of your choice like: let usersToGrab = ['player1','player2']
  2. Run node battlesGetData.js in the bot folder
  3. File history.json is created, rename it to newHistory.json to replace the existing history data OR extend the newHistory.json file with combine.js (see below)

How to extend the newHistory.json without deleting existing data?

  1. Backup newHistory.json in case something goes wrong
  2. Run node combine.js to add the new data from history.json to the newHistory.json file that will be used by the bot

FAQ

Q: Can I make the bot running a battle every 2 minutes? A: Technically yes, but playing too often will decrease the Capture Rate making the rewards very low and insignificant. Try to play a battle every 20 minutes MAX to maintain high level of rewards. Trust me, you keep the ROI higher. Don't be greedy.

Q: Does it play for the daily quest? A: At the moment the bot consider only the splinters quests (death, dragon, earth, fire, life, water) but not the special one (snipe, sneak, neutral,...). Therefore yes, the bot prioritize the splinter for the quest. Nonetheless if the bot consider more probable to win a battle with another splinter (because for example there are not many possible team for the splinter of the quest), you may see a different card selection sometimes

Q: Can I play multiple accounts? A: Technically yes, but don't be greedy.

Q: I got the error "cannot read property split of undefined" A: check that the credentials file doesn't contain any but ".env" in the name. (no .txt or anything else) and check that there is nothing but ACCOUNT=yourusername and PASSWORD=yourpass in 2 lines with no spaces. Also you must use the username with the posting key, and not the email address.

Q: Why the bot doesn't use my best card I paid 1000$? A: Because the bot select cards based on the statistics of the previous battles choosing the most winning team for your cards. it's a bot, not a thinking human being!

Q: Why the bot doesn't use the Furious Chicken? A: same as above

Donations

I've created using my personal free time so if you like it or you benefit from it and would like to be grateful and offer me a beer 🍺 I'll appreciate:

  • DEC into the game to the player splinterlava
  • Bitcoin bc1qpluvvtty822dsvfza4en9d3q3sl5yhj2qa2dtn
  • Ethereum 0x8FA3414DC2a2F886e303421D07bda5Ef45C84A3b
  • Tron TRNjqiovkkfxVSSpHSfGPQoGby1FgvcSaY
  • BUSD(ERC20) 0xE4B06BE863fD9bcE1dA30433151662Ea0ecA4a7e

Cheers!

where you can find some support from other people using it:

Discord

Telegram chat

splinterlands-bot's People

Contributors

alfficcadenti avatar coreynorthcutt avatar daccess1 avatar dependabot[bot] avatar era120 avatar hinetion avatar jaxjixmix avatar kromo-s avatar lfepp avatar quycmf8 avatar ssayass89 avatar wallawast avatar weeris avatar ziegurd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

splinterlands-bot's Issues

Error: TimeoutError

Error: TimeoutError: waiting for selector .btn--create-team : timeout 50000ms exceeded on index.js file. What is the possible error here? I tried to twitch the code and check if I can fix it but there's nothing I can do.

Bug in the quest system

I try change to the new api, but the quest aways return me the same error.
I believe it's something simple to fix, but as i'm new to nodejs i really don't know how to fix it.

new api : https:/api2.splinterlands.com/players/quests?username=
[ERROR QUEST] are you using username or email? please use username TypeError: Only absolute URLs are supported at getNodeRequestOptions (C:\Users\user\Desktop\splinterlands-bot\node_modules\node-fetch\lib\index.js:1305:9) at C:\Users\user\Desktop\splinterlands-bot\node_modules\node-fetch\lib\index.js:1410:19 at new Promise (<anonymous>) at fetch (C:\Users\user\Desktop\splinterlands-bot\node_modules\node-fetch\lib\index.js:1407:9) at Object.getPlayerQuest (C:\Users\user\Desktop\splinterlands-bot\quests.js:23:39) at getQuest (C:\Users\user\Desktop\splinterlands-bot\index.js:34:19) at C:\Users\user\Desktop\splinterlands-bot\index.js:225:33 at processTicksAndRejections (internal/process/task_queues.js:93:5)

Running on Raspberry Pi

Hello.

I'm trying to run the bot on a raspberry pi.
After some problems with puppeteer I managed to get it running up to the point where it attempts to login.
It just gives me a Login Error. I've used account name and not e-mail and also the posting key.
Maybe this has something to do with the raspberry running a bit slow?
On windows with the same exact .env file it runs just fine

I run it on raspbian lite (no GUI).

Error: No node found for selector: .btn--create-team

I recive this error: In home page i see battle win but the report is empty as if I had won by abandonment

Play this for the quest: [
'156',
[
156, 152, 191,
36, 62, 35,
34, 'life', '',
''
]
]

/home/xxxx/bot-splinter/splinterlands-bot-1.1.0/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:26
throw new Error(message);
^

Error: No node found for selector: .btn--create-team
at Object.assert (/home/xxxx/bot-splinter/splinterlands-bot-1.1.0/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:26:15)
at DOMWorld.click (/home/xxxx/bot-splinter/splinterlands-bot-1.1.0/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:277:21)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Node.js v17.1.0

Problem when npm start

Hi
i have this message when i start the bot

[email protected] start
node main.js

isMultiAccountMode: false
Running mode: single
C:\Users\rig\Desktop\splinterlands-bot-master\main.js:73
let account = process.env.ACCOUNT.split('@')[0]; // split @ to prevent email use
^

TypeError: Cannot read properties of undefined (reading 'split')
at startSingle (C:\Users\rig\Desktop\splinterlands-bot-master\main.js:73:39)
at C:\Users\rig\Desktop\splinterlands-bot-master\main.js:93:15
at Object. (C:\Users\rig\Desktop\splinterlands-bot-master\main.js:95:3)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47

Can you help?

Thank you

Error: Node is either not visible or not an HTMLElement

Every day this error ocurrs and stop the bot.

Dont play for the quest, and play this: [
  '224',
  [
    224, 162,
    158, 161,
    160, '',
    '',  'dragon',
    '',  ''
  ]
]
btn--create-team clicked
Click cards iter-[1]
224 clicked
Dragon play TEAMCOLOR Fire
filter element clicked
/home/luiscaverodeveloper/Documents/splinterlands-bot/node_modules/puppeteer/lib/cjs/puppeteer/common/JSHandle.js:330
            throw new Error('Node is either not visible or not an HTMLElement');
                  ^

Error: Node is either not visible or not an HTMLElement
    at ElementHandle.clickablePoint (/home/luiscaverodeveloper/Documents/splinterlands-bot/node_modules/puppeteer/lib/cjs/puppeteer/common/JSHandle.js:330:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ElementHandle.click (/home/luiscaverodeveloper/Documents/splinterlands-bot/node_modules/puppeteer/lib/cjs/puppeteer/common/JSHandle.js:391:26)

Thanks

Bot always using fire element

The bot won't switch decks. It is always using the Fire deck even though the favourite deck attribute is commented.

Login error -- I used lowercase username and correct posting key

See code below. I downloaded and re-installed the bot, created the .env file with my lowercase username and password, and ran npm install. Bot is having errors logging in:

START username\ 10/26/2021, 4:55:59 PM
Dont pay scammers!
If you need support for the bot, join the telegram group https://t.me/splinterlandsbot and discord https://discord.gg/bR6cZDsFSX
If you interested in a higher winning rate with the private API, contact the owner via discord or telegram
10/26/2021, 4:56:00 PM opening browser...
Login attempt...
didnt login
Error: Check that you used correctly username and posting key. (dont use email and password)
at Object.login (/Users/username/Jts/splinterlands-bot-master/splinterlandsPage.js:33:15)
at async startBotPlayMatch (/Users/username/Jts/splinterlands-bot-master/index.js:67:9)
at async /Users/username/Jts/splinterlands-bot-master/index.js:355:13
Error: Login Error
at /Users/username/Jts/splinterlands-bot-master/index.js:69:19
at async startBotPlayMatch (/Users/username/Jts/splinterlands-bot-master/index.js:67:9)
at async /Users/username/Jts/splinterlands-bot-master/index.js:355:13
username\ waiting for the next battle in NaN minutes at Invalid Date

can get it to even start plz help

have done everything mentioned just get this... it opens splinterlands goes to the sign in then doesnt type or anything reloads 5 times and closes what am i doing wrong...ty

Your environment has been set up for using Node.js 14.17.5 (ia32) and npm.

C:\Users\Owner>npm i

up to date, audited 69 packages in 577ms

1 package is looking for funding
run npm fund for details

found 0 vulnerabilities

C:\Users\Owner>node index.js
login error TypeError: text is not iterable
at Keyboard.type (C:\Users\Owner\node_modules\puppeteer\lib\Input.js:160:24)
at Keyboard. (C:\Users\Owner\node_modules\puppeteer\lib\helper.js:112:23)
at ElementHandle.type (C:\Users\Owner\node_modules\puppeteer\lib\JSHandle.js:363:31)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async DOMWorld.type (C:\Users\Owner\node_modules\puppeteer\lib\DOMWorld.js:422:5)
at async Object.login (C:\Users\Owner\splinterlandsPage.js:4:9)
at async startBotPlayMatch (C:\Users\Owner\index.js:24:5)
at async Task.execution (C:\Users\Owner\index.js:143:9)
-- ASYNC --
at ElementHandle. (C:\Users\Owner\node_modules\puppeteer\lib\helper.js:111:15)
at DOMWorld.type (C:\Users\Owner\node_modules\puppeteer\lib\DOMWorld.js:422:18)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Object.login (C:\Users\Owner\splinterlandsPage.js:4:9)
at async startBotPlayMatch (C:\Users\Owner\index.js:24:5)
at async Task.execution (C:\Users\Owner\index.js:143:9)
-- ASYNC --
at Frame. (C:\Users\Owner\node_modules\puppeteer\lib\helper.js:111:15)
at Page.type (C:\Users\Owner\node_modules\puppeteer\lib\Page.js:1103:29)
at C:\Users\Owner\splinterlandsPage.js:7:30
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Object.login (C:\Users\Owner\splinterlandsPage.js:4:9)
at async startBotPlayMatch (C:\Users\Owner\index.js:24:5)
at async Task.execution (C:\Users\Owner\index.js:143:9)
END Error: TypeError: Cannot read property 'split' of undefined
at startBotPlayMatch (C:\Users\Owner\index.js:36:67)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Task.execution (C:\Users\Owner\index.js:143:9)

no quest reward freeze

anyone know why itll get to scanning the quest say no quest reward to be claimed then never rollover to the next part... just freezes there.. like this
Login
Quest: { name: 'Stealth Mission', splinter: 'sneak', total: 5, completed: 5 }
no quest reward to be claimed
[Error while waiting for battle]
Refreshing the page and retrying to retrieve a battle
[Battle cannot start]: TimeoutError: Navigation timeout of 30000 ms exceeded

Bot should complete the Daily Quest if available.

The bot should complete the Daily quest if it's available, the bot will need to win 5 times with some types of cards or abilities in order to complete the daily quest, here is some information that could be useful for this:

Possible Daily Quests:

Earth Quest - Win 5 ranked battles with the Earth Splinter.
Water Quest - Win 5 ranked battles with the Water Splinter.
Fire Quest - Win 5 ranked battles with the Fire Splinter.
Death Quest - Win 5 ranked battles with the Death Splinter.
Life Quest - Win 5 ranked battles with the Life Splinter.
Dragon Quest - Win 5 ranked battles with the Dragon Splinter.
No Neutral Quest - Win 5 ranked battles without any Neutral cards.
Sneak Quest - Win 5 ranked battles using at least 1 card with the Sneak ability.
Snipe Quest - Win 5 ranked battles using at least 1 card with the Snipe ability.

How to use delegated cards

Hello, I'm trying to use multi-account on BOT, I already rented cards to increase the win rate, but the BOT doesn't use my rented cards. What should I do?

bot stops

bot stops after entering battle. doesnt click rumble button and after some time crashes

new code

any way to fix this evr since i download newest code i get this now and lose every battle for no team selected

no quest reward to be claimed waiting for the battle...
waiting for battle button...
Battle button clicked
waiting for an opponent...
start the match
17
check battles based on mana: 17
INPUT: 17 Standard [ 'fire', 'water', 'earth', 'life', 'death', 'dragon' ] 101
undefined
API call: https://splinterlands-data-service.herokuapp.com/battlesruleset?ruleset=Standard&mana=17&player=simpledecks&summoners=[5,16,27,38,49,167,178,189,145,156,145,189,224]

Bot not selecting a team when starting a battle and auto losing

Hi, thanks for making this bot. I don't know if this question has been answered already. I managed to get the bot up and running for one game & now when it starts a game it comes up with the message in the code saying Error handling browser not opened, internet connection issues, or battle cannot start: Error: NO TEAMS available to be played. Do you know how to get around this issue? This is my main account so not got any cards delegated from my personal accounts. I am just using long-term rentals and my own cards.

Any help would be greatly appreciated

Suggestion to save default deck

Awesome,
If you accept suggestions I would tell you that it would be very good if I can save decks of cards with which I always want to play.

[WTB] I'm looking to buy empty accounts!

Hello there, I'm looking to buy empty accounts in bulk 100s or 1000s if possible.
They just need to come with the spellbook.
If someone is interested, feel free to hit me up on discord.

Error while click on card. Not every game

btn--create-team clicked
Click cards iter-[1]
145clicked
play: 162
162 clicked
play: 403
157 clicked
play: 163
160 clicked
play: 161
161 clicked
play: 158
158 clicked
F:\splinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\JSHandle.js:342
throw new Error('Node is either not clickable or not an HTMLElement');
^

Error: Node is either not clickable or not an HTMLElement
at ElementHandle.clickablePoint (F:\splinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\JSHandle.js:342:19)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ElementHandle.click (F:\splinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\JSHandle.js:415:26)

I try to restart or re-install but I still got this error many time after game maintenance. (sep.14) In headless mode. Bot clicked on the card, but the card is not selected.

Didn't login well because of username/password

Dear,

I just want to make sure where to find username and password to enter to .env file with this

ACCOUNT=
PASSWORD=

My account have to login via email and password. After that I enter my username for account. Can I use new username for my account for bot? And using account login password too

Thanks

Always selects Death Cards

Hi, first of all, I'd like to thank you for sharing this bot script. May I know if there's a way to change the teams the bot will select? I've noticed that it's been always choosing Death although I've already tried using battlesGetDat.js since the API always fails.

Thanks,

image

headless not working properly

when running the bot with {headless: true} the script reach the "make team" page but then surrender. to investigate

Battle count is not correct for won battles

Hi,
at first thank you for the work, i started to get into the bot and i like it :)

I recognized that the won-counter is not correct and i could not create a Pull-Request.

The index to get the name from the account should be 1 to get the name after the '@':

diff --git a/index.js b/index.js
index e760b0b..8f3abc2 100644
--- a/index.js
+++ b/index.js
@@ -266,7 +266,7 @@ async function startBotPlayMatch(page) {
         await page.waitForTimeout(5000);
         try {
 			const winner = await getElementText(page, 'section.player.winner .bio__name__display', 15000);
-			if (winner.trim() == process.env.ACCOUNT.split('@')[0]) {
+			if (winner.trim() == process.env.ACCOUNT.split('@')[1]) {
 				const decWon = await getElementText(page, '.player.winner span.dec-reward span', 1000);
 				console.log(chalk.green('You won! Reward: ' + decWon + ' DEC'));
                 totalDec += parseFloat(decWon);

Thanks!

Error after Battle button clicked

Hi,
I got the following error when running the bot. Could anyone help me out?
Thank you so much!

Battle button clicked
waiting for an opponent...
[Error while waiting for battle]
Refreshing the page and retrying to retrieve a battle
Battle button clicked
second attempt failed reloading from homepage...
[ERROR] waiting for Battle button second time
third attempt failed
[Battle cannot start]: Error: TimeoutError: waiting for selector .btn--create-team failed: timeout 50000ms exceeded
at D:\splinterlands-bot-master\splinterlands-bot-master\index.js:131:35
at async D:\splinterlands-bot-master\splinterlands-bot-master\index.js:127:21
at async D:\splinterlands-bot-master\splinterlands-bot-master\index.js:117:13
at async startBotPlayMatch (D:\splinterlands-bot-master\splinterlands-bot-master\index.js:106:9)
at async D:\splinterlands-bot-master\splinterlands-bot-master\index.js:248:13
Error: The Battle cannot start
at startBotPlayMatch (D:\splinterlands-bot-master\splinterlands-bot-master\index.js:136:15)
at async D:\splinterlands-bot-master\splinterlands-bot-master\index.js:248:13

Bot not running anymore?

Before the last update a week or so ago, the bot was running smoothly without issue.

However, with the latest updates, I haven't been able to run it. When I run "node index.js", I don't get any errors and it just goes right back to the command prompt.

I'm on Windows, and running the latest version of Node.js. I've run "npm install" to install all of the dependency modules, including the latest puppeteer module.

Any ideas?

Thanks!

Bot stopped many times by error

I have to restart the bot many times by this error in attachment images. Previous card id make the bot stop is 381 and in attachment images is 372
Screen Shot 2022-01-10 at 7 40 06 PM

Thanks
Phuc

Error while waiting for battle

I get this error after running the bot.

[Error while waiting for battle] TimeoutError: waiting for selector .btn--create-team failed: timeout 240000ms exceeded
at new WaitTask (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:509:34)
at DOMWorld.waitForSelectorInPage (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:420:26)
at Object.internalHandler.waitFor (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\QueryHandler.js:31:77)
at DOMWorld.waitForSelector (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:313:29)
at Frame.waitForSelector (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:841:51)
at Page.waitForSelector (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:2238:33)
at startBotPlayMatch (xxxxsplinterlands-bot-master\index.js:76:16)
at async xxxxsplinterlands-bot-master\index.js:162:13
Error: TimeoutError: waiting for selector .btn--create-team failed: timeout 90000ms exceeded
at new WaitTask (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:509:34)
at DOMWorld.waitForSelectorInPage (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:420:26)
at Object.internalHandler.waitFor (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\QueryHandler.js:31:77)
at DOMWorld.waitForSelector (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:313:29)
at Frame.waitForSelector (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:841:51)
at Page.waitForSelector (xxxxsplinterlands-bot-master\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:2238:33)
at xxxxsplinterlands-bot-master\index.js:85:24
at async startBotPlayMatch (xxxxsplinterlands-bot-master\index.js:76:5)
at async xxxxsplinterlands-bot-master\index.js:162:13

the bot cant get the json form site.

the site is not returning a valid json, i think it is offline or have a new api parameter. can you help me?

API call: https://splinterlands-data-service.herokuapp.com/battlesruleset?ruleset=Standard&mana=19&player=userbot fetch FetchError: invalid json response body at https://splinterlands-data-service.herokuapp.com/battlesruleset?ruleset=Standard&mana=19&player=userbot reason: Unexpected token < in JSON at position 0 at C:\Users\user\Desktop\splinterlands-bot\node_modules\node-fetch\lib\index.js:272:32 at processTicksAndRejections (internal/process/task_queues.js:93:5) at async battlesFilterByManacap (C:\Users\user\Desktop\splinterlands-bot\possibleTeams.js:75:21) at async Object.possibleTeams (C:\Users\user\Desktop\splinterlands-bot\possibleTeams.js:130:25) at async startBotPlayMatch (C:\Users\user\Desktop\splinterlands-bot\index.js:134:27) at async C:\Users\user\Desktop\splinterlands-bot\index.js:226:13 { type: 'invalid-json' }

Question about functionality

Hi, i'm trying to recreate a version of the bot in python and since i'm not very familiar with JS i wondered if you could explain in short what logic are you using for the card selection, Best regards. Great project btw.

Need directions on how to run this bot via mac

I am getting read errors related to the .env file and further i am unable to name a file .env because mac presents a "this is reserved for the system"
Steps i have taken:

  1. download bot
  2. create text file and fill in login info. Change name to untitled.env
  3. npm install via terminal
  4. i get the following error:

npm WARN saveError EISDIR: illegal operation on a directory, read
npm WARN saveError EISDIR: illegal operation on a directory, read
npm WARN EISDIR: illegal operation on a directory, read
npm WARN No description
npm WARN No repository field.
npm WARN No README data
npm WARN No license field.

"totalSps" is not defined (should be "totalSPS")

Hey alfficcadenti,

It looks like lines 257 and 272 of index.js need to be fixed, as they have "totalSps" written instead of "totalSPS" which causes an error at the end of battles. Great work btw on the bot!

why is that???? : fetch FetchError: invalid json response body at http://95.179.236.23/V1/battlesruleset?ruleset=Silenced%20Summoners%7CTaking%20Sides&mana=26&player=GANG-JIAN-WANG&token=undefined&summoners=[167,440,178,437,156,224,441] reason: Unexpected token < in JSON at position 0

API call: http://95.179.236.23/V1/battlesruleset?ruleset=Silenced%20Summoners%7CTaking%20Sides&mana=26&player=GANG-JIAN-WANG&token=undefined&summoners=[167,440,178,437,156,224,441]
fetch FetchError: invalid json response body at http://95.179.236.23/V1/battlesruleset?ruleset=Silenced%20Summoners%7CTaking%20Sides&mana=26&player=GANG-JIAN-WANG&token=undefined&summoners=[167,440,178,437,156,224,441] reason: Unexpected token < in JSON at position 0
at /Users/wangxiaobo/order/splinterlands/splinterlands-bot-master/node_modules/_node-fetch@2.6.7@node-fetch/lib/index.js:273:32
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async battlesFilterByManacap (/Users/wangxiaobo/order/splinterlands/splinterlands-bot-master/possibleTeams.js:99:21)
at async Object.possibleTeams (/Users/wangxiaobo/order/splinterlands/splinterlands-bot-master/possibleTeams.js:174:25)
at async startBotPlayMatch (/Users/wangxiaobo/order/splinterlands/splinterlands-bot-master/index.js:455:31)
at async run (/Users/wangxiaobo/order/splinterlands/splinterlands-bot-master/index.js:607:9)
at async startSingle (/Users/wangxiaobo/order/splinterlands/splinterlands-bot-master/main.js:83:5)
at async /Users/wangxiaobo/order/splinterlands/splinterlands-bot-master/main.js:93:9 {
type: 'invalid-json'
}

Metamask login

what should I write in the login-password field if I enter using metamask

update error

Good Morning!

With the new update;cão the bot does not enter any game because it gives an error regarding the quest, I already put everything as false and keeps jumping.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.