Scoring Battles obtained from API
Using JavaScript to analyze Splinterlands battle data - Scoring teams.
In my previous hive blog, I've discussed how to obtain battle data from player and his 50 previous opponents.
In this post, I've scored the battles obtained.
Analyze Battles
Sorting Battles to teams, summoners, and monsters, and then score their performance by rating 1 if one and -1 if lost. -0.5 to both teams if lost.
const verdictToScore = {w: 1, l: -1, d: -0.5};
verdict being if the team won or lost. Having a helper map separately allows us to assign values to different results without having to edit a lot of code.
Scoring teams one by one follows the below flow. the same for summoners and monsters.
Finally, I get a json which gets sorted by the score and can be used while battle.
| team | summoner | monsters |
|---|---|---|
You can find the script in my git repo at azarmadr/bot-splinters in file score.js
Leave Scoring Battles obtained from API to:
Read more #hive-140217 posts
Best Posts From Shaik Azhar Madar
We have not curated any of azarmadr3's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Shaik Azhar Madar
- My Actifit Report Card: March 1 2026
- My Actifit Report Card: February 20 2026
- My Actifit Report Card: February 20 2026
- PhotoFeed Contest - Macro Photography Round 157 - Closer look at clover flower
- My Actifit Report Card: February 17 2026
- My Actifit Report Card: February 13 2026
- My Actifit Report Card: February 11 2026
- My Actifit Report Card: February 9 2026
- My Actifit Report Card: February 8 2026
- My Actifit Report Card: February 7 2026