python steemmonsters 0.0.15 - Several improvements and new features

in #utopian-io7 years ago (edited)

Repository

https://github.com/holgern/steemmonsters

steemmonsters is a python command line tool for playing steemmonsters without graphics. The newest version 0.0.15 can be downloaded here.

New API comands

get_purchases_status returns information about a purchased card pack:

from steemmonsters.api import Api
api = Api()
api.get_purchases_status("P-DTQ5OEKIVK")

get_player_quests returns information about the quest:

from steemmonsters.api import Api
api = Api()
api.get_player_quests("holger80")

get_purchases_stats returns how many packs were purchased:

>>> from steemmonsters.api import Api
>>> api = Api()
>>> api.get_purchases_stats()
{'packs': [{'edition': 0, 'qty': '300000'}, {'edition': 1, 'qty': '181059'}]}

api.settings() shows the current games settings.

api.players_leaderboard() shows the leaderboard.

get_player_login returns the encrypted token for login:

from steemmonsters.api import Api
api = Api()
api.get_player_login("holger80")

player_save_team( name, team, player, token, mana_cap) can be used to store a new team, which then also available in the homepage. token is the decrypted token using the posting key from the get_player_login call.

player_delete_team(name, player, token, mana_cap) deletes deck name.

get_player_saved_teams(player, token, mana_cap) returns all saved teams.

get_player_teams_last_used(player, mana_cap) returns the last used team of a player.

get_battle_history(player="%24top") gets the last top battles. When settings player=holger80 the last battles of the player are returned instead.

New Commands

image.png

addteam

addteam  water_test Alric Stormbringer:2, Frost Giant:1, Spineback Turtle:2, Pirate Captain:3, Crustacean King:3

or

addteam  water_test Alric Stormbringer, Frost Giant, Spineback Turtle, Pirate Captain, Crustacean King

adds the water_test team. The stored team can then be used for play:

play water_test

image.png

The team is also stored in the steemmonsters.com homepage:
image.png

The token for modifing teams is decrypted by:

from beembase import memo as BtsMemo
from beemgraphenebase.account import PrivateKey
from steemmonsters.api import Api

api = Api()
response = api.get_player_login("holger80")
wif = "5xxx" # posting key
token = BtsMemo.decode_memo(PrivateKey(wif), response["token"]).replace('\n', '')

deleleteam

deleteteam water_test

removes a stored team.

copyteam

copyteam clove71 test1

copies the last played team from clove71 and stores is as test1

team

team test1

shows a stored team

lastteam

lastteam

or

lastteam clove71

shows the last played team

copytopteam

Is the same command, but instead of a player name, the top100 position is used.

copytopteam 4 test2

stores the last team from the top 4 player as test2

lasttopteam

lasttopteam 4

shows the last played team from top 4 player

savedteams

savedteams

shows all saved teams

startquest

sm> startquest
sm_start_quest broadcasted!
You have to solve the Stir the Volcano quest

can be used to start a new quest. In this example, 10 games using a fire deck will solve the quest.

claimquest

When a quest is solved, this command can b e used to claim the reward.

conflict

Shows the current conflict

play

play can now be used with stored teams from the homepage. At first the json is checked and when there is no such team, the stored teams are checked. When a team with the given name is found, it is used. play random works only with decks stored in the json file.

mana_cap and ruleset must not be defined in the json file, it is now fetched on startup.

Commit history

More commands added

  • commit 913b1577
  • conflict - shows the currect conflict
  • team - shows a stored team
  • player - shows the information about the player
  • lasttopteam - shows the last played team
  • copytopteam <new_deck_name> - copies the last played team

Merged changes from #7 manually

Release 0.0.15

Add api calls and improve stream and play

New api calls added:

  • get_purchases_status

  • get_player_quests

  • quest command added for showing the current player quest

  • stream fixed

  • play improved

GitHub Account

https://github.com/holgern

Sort:  
  • Great post showing the commands that are implemented in this article.
  • Good graphics of the expected shell UI.
  • Lots of work with great commits messages.
  • Could not find one new line of comments! Maybe next time.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you for your review, @helo! Keep up the good work!

What are the :1 :2 :3 modifiers on the addteam command?

It seems very interesting. I think it can be interesting for people to watch how to play without graphics. Maybe you make live stream once in next time?

Posted using Partiko Android

Give that man a medal.

Hi @holger80!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 7.219 which ranks you at #71 across all Steem accounts.
Your rank has improved 1 places in the last three days (old rank 72).

In our last Algorithmic Curation Round, consisting of 275 contributions, your post is ranked at #18.

Evaluation of your UA score:
  • Your follower network is great!
  • The readers appreciate your great work!
  • You have already shown user engagement, try to improve it further.

Feel free to join our @steem-ua Discord server

Wow great, How to use it?

Hi, @holger80!

You just got a 1.41% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hey, @holger80!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Can anybody write simple "hello world" python script to do one battle? Thanks a lot.