How much did you spent/receive to/from drugwars/steemmonsters

in beem •  5 months ago  (edited)

image.png
image source

I wrote two small python scripts for finding out how much did I spent/receive on the drugwars and steemonsters game. Both scripts using account history and filter for all transfer transactions. For drugwars, I filter for transaction from/to "drugwars" and "drugwars-dealer". For steemmonsters, I filter for memo text including sm_market_sale or sm_market_purchase.

You can ask in the comments, when you want to know your balance without running the scripts. I will then posts the results.

Drugwars

#!/usr/bin/python
from beem import Steem
from beem.account import Account
from beem.amount import Amount
from beem.nodelist import NodeList
import six


if __name__ == "__main__":
    nodelist = NodeList()
    nodelist.update_nodes()
    stm = Steem(node=nodelist.get_nodes())
    if six.PY2:
        account = raw_input("Account name:")
    else:
        account = input("Account name:")
    included_accounts = ["drugwars", "drugwars-dealer"]
    steem_spent = 0
    steem_received = 0
    sbd_spent = 0
    sbd_received = 0
    account = Account(account, steem_instance=stm)
    for h in account.history_reverse(only_ops=["transfer"]):
        if h["from"] in included_accounts:
            amount = Amount(h["amount"], steem_instance=stm)
            if amount.symbol == "STEEM":
                steem_received += float(amount)
            elif amount.symbol == "SBD":
                sbd_received += float(amount)
        elif h["to"] in included_accounts:
            amount = Amount(h["amount"], steem_instance=stm)
            if amount.symbol == "STEEM":
                steem_spent += float(amount)
            elif amount.symbol == "SBD":
                sbd_spent += float(amount)
        elif h["to"] in included_accounts and h["from"] == account["name"] and h["memo"][:2] == "P-":
            amount = Amount(h["amount"], steem_instance=stm)
            if amount.symbol == "STEEM":
                steem_spent += float(amount)
            elif amount.symbol == "SBD":
                sbd_spent += float(amount)  
                
    print("STEEM/SBD sent/received from/to %s\n" % (", ".join(included_accounts)))
    print("%.3f STEEM received - %.3f STEEM spent" % (steem_received, steem_spent))
    print("Sum: %.3f STEEM" % (steem_received-steem_spent))
    print("\n")
    print("%.3f SBD received - %.3f SBD spent" % (sbd_received, sbd_spent))
    print("Sum: %.3f SBD" % (sbd_received-sbd_spent))

Store this script as transfer_history_drugwars.py and run it:

python transfer_history_drugwars.py

The script asks for your steem username.

Steemmonsters

#!/usr/bin/python
from beem import Steem
from beem.account import Account
from beem.amount import Amount
from beem.nodelist import NodeList
import six


if __name__ == "__main__":
    nodelist = NodeList()
    nodelist.update_nodes()
    stm = Steem(node=nodelist.get_nodes())
    if six.PY2:
        account = raw_input("Account name:")
    else:
        account = input("Account name:")
    memo_text_received = "sm_market_sale"
    memo_text_spent = "sm_market_purchase"
    steem_spent = 0
    steem_received = 0
    sbd_spent = 0
    sbd_received = 0
    account = Account(account, steem_instance=stm)
    for h in account.history_reverse(only_ops=["transfer"]):
        if memo_text_received in h["memo"] and h["to"] == account["name"]:
            amount = Amount(h["amount"], steem_instance=stm)
            if amount.symbol == "STEEM":
                steem_received += float(amount)
            elif amount.symbol == "SBD":
                sbd_received += float(amount)
        elif memo_text_spent in h["memo"] and h["from"] == account["name"]:
            amount = Amount(h["amount"], steem_instance=stm)
            if amount.symbol == "STEEM":
                steem_spent += float(amount)
            elif amount.symbol == "SBD":
                sbd_spent += float(amount)
                
    print("## Steemmonsters")
    print("%.3f STEEM received - %.3f STEEM spent" % (steem_received, steem_spent))
    print("Sum: %.3f STEEM" % (steem_received-steem_spent))
    print("\n")
    print("%.3f SBD received - %.3f SBD spent" % (sbd_received, sbd_spent))
    print("Sum: %.3f SBD" % (sbd_received-sbd_spent))

Store this script as transfer_history_steemmonsters.py and run it:

python transfer_history_steemmonsters.py

The script asks for your steem username.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

I really don't want to know but what are my steemmonsters stats? 🙈

A script obtaining the value of all owned cards would be nice :) (I know the discord bot).

steemmonsters

193.797 STEEM received - 1067.589 STEEM spent
Sum: -873.792 STEEM

72.070 SBD received - 988.135 SBD spent
Sum: -916.065 SBD

Well it is included in the bot :) btw may I take the scripts and put them in the bot as well ? ;)
Nice work Holger
LG
Jan

I am not familiar with the script and don't know where to run it. Could you please check my drug wars account status? Many thanks.

drugwars

25.332 STEEM received - 30.055 STEEM spent
Sum: -4.723 STEEM

Thanks a lot, @holger80

I tried to run the steemmonsters code, I have beempy installed but I get an error saying beem is not a valid module.

Could you check mine please, for Steem Monsters only? :)

Posted using Partiko Android

steemmonsters

2855.929 STEEM received - 2927.414 STEEM spent
Sum: -71.485 STEEM

984.645 SBD received - 13.699 SBD spent
Sum: 970.946 SBD

Thank you. :)

Posted using Partiko Android

Could you check my Steemmonsters account please?

steemmonsters

3470.312 STEEM received - 4701.399 STEEM spent
Sum: -1231.087 STEEM

734.057 SBD received - 46.019 SBD spent
Sum: 688.038 SBD

interesting. thx. i am on a good way i think.

This post has been just added as new item to timeline of beem on Steem Projects.

If you want to be notified about new updates from this project, register on Steem Projects and add beem to your favorite projects.

  ·  5 months ago (edited)

SM script does not include transactions using peakcredits :P

Aaand could you check SM for me?

Maybe, I will make an additional script for peakcredit :).

steemmonsters

547.713 STEEM received - 629.285 STEEM spent
Sum: -81.572 STEEM

66.797 SBD received - 55.258 SBD spent
Sum: 11.539 SBD

Due to all the 'can you check mine?" requests, I guess there is a little frontend needed ^^

Posted using Partiko Android

  ·  5 months ago (edited)

LOL, I agree! ;)

I think I really don't wanna know what I spent on my monsters ;)

I've seen worse...

can you check my steemmonster account and my drugwars account?

Account name:simi

drugwars

43.847 STEEM received - 176.750 STEEM spent
Sum: -132.903 STEEM

steemmonsters

1583.045 STEEM received - 638.339 STEEM spent
Sum: 944.706 STEEM

141.330 SBD received - 4.775 SBD spent
Sum: 136.555 SBD

Welcome for joining The Cartel.
I want to know my stats about drugwars.

I also have one question regarding with Steemrewarding.com.
Can I add steempress for the user who use steempress in the include app section.

drugwars

39.347 STEEM received - 231.855 STEEM spent
Sum: -192.508 STEEM

Can You check my Steem Monsters account, please?

Posted using Partiko Android

steemmonsters

1125.957 STEEM received - 6.385 STEEM spent
Sum: 1119.572 STEEM

38.226 SBD received - 3.935 SBD spent
Sum: 34.291 SBD

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.349 which ranks you at #62 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 254 contributions, your post is ranked at #2. Congratulations!

Evaluation of your UA score:
  • Your follower network is great!
  • The readers appreciate your great work!
  • Great user engagement! You rock!

Feel free to join our @steem-ua Discord server

Can you check steemmonster for me?

Here are the results for steemmonsters:

50.324 STEEM spent - 721.518 STEEM received
Sum: 671.194 STEEM

0.055 SBD spent - 8.435 SBD received
Sum: 8.380 SBD

Hi, @holger80!

You just got a 2.79% 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.

Thank you so much for participating in the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!

This post has been included in the latest edition of SoS Daily News - a digest of all you need to know about the State of Steem.

is it counting alt markets like peakmonster or only steemmonsters?

Posted using Partiko Android

It counts all markets, but no fiat buy.

Python is too difficult for me. Could you check the statistics for my Steem Monsters account? I would be grateful!

steemmonsters

68.291 STEEM received - 31.576 STEEM spent
Sum: 36.715 STEEM

8.753 SBD received - 0.210 SBD spent
Sum: 8.543 SBD

!bookkeeping drugwars steemmonsters

Hi @holger80!

drugwars

62.415 STEEM received - 79.554 STEEM spent
Sum: -17.139 STEEM

steemmonsters

205.717 STEEM received - 875.326 STEEM spent
Sum: -669.609 STEEM

10.457 SBD received - 572.085 SBD spent
Sum: -561.628 SBD

!bookkeeping drugwars steemmonsters

Hi @lec!

drugwars

Received:

  • 1.031 STEEM from daily
  • 0.000 STEEM from heist
  • 0.422 STEEM from referral

Spent:

  • 12.575 STEEM

Total:

  • -11.122 STEEM

steemmonsters

Received:

  • 930.876 STEEM
  • 95.602 STEEM from Affiliate
  • 0.000 vested STEEM
  • 16.444 SBD
  • 0.000 SBD from Affiliate

Spent:

  • 604.460 STEEM
  • 1.547 SBD

Total:

  • 422.018 STEEM
  • 14.897 SBD

ǝɹǝɥ sɐʍ ɹoʇɐɹnƆ pɐW ǝɥ┴