My open-source Splinterlands Bot Project

avatar
Authored by @a1492dc

It seems obvious that the rise of Axie Infinity also brought Splinterlands under the spotlight of the Play to Earn trend. As a consequence, the coding project I’ve created more than one year ago to play this game with my own bot received a lot of attention. In fact, in the last few months I started seeing more and more fork of my repo on github and started receiving questions on how to run the code.

I realized that the initial code I’ve pushed was containing errors that I did fix locally but didn’t push to the repo because I didn’t even imagine that someone was already using my code!

But after so much attention, I needed to go back on track and dedicate some time to fix some of the issues the bot had (like the package.json file corrupted or not being updated with the new battle rules) and also developed something more advanced.

So here the story of my Splinterlands Bot

I’ve been playing Splinterlands since the beginning of 2020 and after many hours played I realized there were some bot accounts already playing the the ranked battles.
Since I’m a Javascript developer and I love automation, my first thought was: “this could be the perfect field for a personal project 😍!”.

I started writing few lines of code to try the Google Puppeteer Library to simulate click on the browser page; initially only to perform the login and open a new battle, but later I wanted to step up and leverage my data analysis knowledge to make the bot playing too.

The initial challenge was to create a bot with a decent winning rate (the benchmark was mine manual playing around 50%) that could compete at the very entry level and being able to make battles with a bit of common sense to reuse all the low level cards that I was receiving with the season rewards (once upon a time when rewards were richer!).

I started gathering data of my own battles to be reused as a collection of possible team to be played, but I realized that the possible combination of mana cap, rules and splinters available to be played was creating enough entropy that required a solution a bit more structured. I think this is also one of the reason why the Splinterlands team doesn't seem fully against bot, because to build a bot that is able to really compete against a human being it is very costly due to how the game works. But I wanted to do it mainly for fun, so I didn't give up.

I needed to create a proper database to store all the information, not only about my battles, but also from other players. Initially from those with a rating similar to mine, but later I implemented a solution to save the battles data from all the possible players.

In this way I learned how to play better even in a manual mode by copying other players' lines up, which is actually what any bot does! 🤖

The initial logic implemented was simply to choose among the winners, the most used line up for a specific battle with a ruleset and a specific mana cap. But later I started to consider the winning rate of each team in order to prioritize the card selection in a more effective way.

I was able to make a working bot and with a decent winning rate (35/40%) but I felt there was still room for improvement at least for battling in lower leagues where the opponents cards and the ruleset (usually only Standard) are not so demanding.
After reaching a satisfying level of 50/55% winning rate, I created multiple accounts and made the bot playing for me, farming Dark Energy Crystals and Reward Cards.

The bot with multiple accounts was running on my computer so with the limited RAM and CPU I was able to run around 10 accounts with no issues.
I have also made the successful experiment to run it on a Raspberry Pi (max 4 accounts) with a very little code adjustment.

But then I started levelling up using a VPS (a server in the cloud) using Vultr to have more bot accounts running and based on my calculation, the rewards were more than enough to pay the rent of the server.

Controversial

To be fair, I completely understand how controversial this bot-farming is and how some players may be frustrated and sick by this increase in bot accounts that are draining DEC from the reward pool (like the post about @fireking here).

On the other hand I see the challenge for the human player to still be better than just a bot and also, how they somehow contribute to the economy of the game or improve the game efficiency.

I nice reading on the topic I saw from @giemo in his post here.

bot vs human

The growth

I’ve been accumulating for a while now, converting the DEC in worthy cards that I can still use to enjoy the game playing manually and I’ve managed also to buy some plot of land via Hive Engine looking forward to see when the feature will come out in the game.

The growing Splinterlands audience had definitely an impact on the value of all the in game assets: Cards, Lands, Dec value and also the recent SPS staking system… everything grew and I cannot be happier to see this fantastic game gaining so much attention every day.

I received so many enquiries directly on github first, that I needed to setup a telegram chat and a discord server to provide assistance but I also received fresh ideas on how to improve it, for example battling with the priority for the daily quest. I’m really thankful for support and the donations I received by the users.

I was really amazed when I’ve also seen a couple of posts talking about my open source project like the first post from @solominer on peakd or the one from
@fitz1567 on splintertalk.

I’ve also seen copies of my bot modified, or youtube videos by people claiming they created it, and sold it sometimes in a sort of legit way, whilst some others with the clear purpose of scamming people to steal their own Hive keys.
So I use this chance to mention that if you want to go through the path of botting or any other service you decide to use related to the game, bear in mind the basic security tips:

  1. do not to share your private keys with anyone ("not your keys, not your crypto").
  2. try to rely on open-source code as much as possible to avoid being scammed.

I keep improving the bot as a challenge but I’m also building few other tools for players like an analytics dashboard (work in progress) to help players understand which cards are better, or to monitor multiple accounts, as well as a script to transfer in game assets (DEC, SPS,...) from other accounts to your main one.

dashboard.png

I will hopefully make other posts to go more in details of this journey and to explain better how everyone can set up his own bot using my open-source code or how much you can actually earn by playing on splinterlands.



0
0
0.000
3 comments
avatar

Such an awesome project, as someone new to programming, projects like this motivate me to learn and be better. Keep up the good work!

0
0
0.000
avatar

Thanks for sharing your work with the community

0
0
0.000