[스팀몬스터] 일퀘 그리고 일 보상 프로그램 수정 by tradingideas

View this thread on steempeak.com
· @tradingideas ·
$14.95
[스팀몬스터] 일퀘 그리고 일 보상 프로그램 수정
물팀이 일퀘로 나왔습니다. 주말 저녁 일퀘를 하면서 한가함을 채워갑니다.

![](https://cdn.steemitimages.com/DQmUUPpbRLuRAJEB7fcBxN31PyzznHmvED5n7deAXzpcvRB/image.png)

오호 이번에는 ORB 팩이 하나 나왔군요. 그런데 픽몬에서의 카드 가치에서는 Orb가 빠져있습니다. 

그래서 기존에 사용하던 프로그램에 Orb를 추가해보았습니다.

quest로 받은 팩의 내용을 볼 수 있는 API는 아래와 같습니다.

https://api.steemmonsters.io/players/history?username=tradingideas&from_block=-1&limit=250&types=sm_claim_reward,claim_reward

이번에 보상의 종류가 변경되면서 이 API에서 돌려주는 데이터의 구조가 변경이 되었습니다. 아래와 같이 'type'이라는 keyword가 생겼고, type의 값에는 아래와 같이 4가지 값이 가능합니다.
- reward_card
- pack
- dec
- potion

이 변화를 반영한 코드는 아래과 같습니다.

~~~
        for cd in cards :
            card = cd
            if 'type' in card :
                if card['type'] == 'reward_card' :
                    card = cd['card']
                elif card['type'] == 'pack' :
                    val = open_cards[card_len-1]
                    val[0] += 1
                    continue
                elif card['type'] == 'dec' :
                    val = open_cards[0]
                    val[0] += card['quantity']
                    continue
                else :
                    continue

~~~

potion의 가치는 측정이 어려우니 무시하고 DEC와 Orb에 대해서는 적절한 가치를 추가하여 계산을 하는 코드를 추가하였습니다.

이렇게 변경해서 나온 결과입니다.

![](https://cdn.steemitimages.com/DQmQR3A6hS4G5iwi75WHwshqwhPQWw79YMPJ4BP38LhSSkC/image.png)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 101 others
properties (23)
post_id84,651,548
authortradingideas
permlink6nl992
categoryhive-101145
json_metadata{"tags":["hive-101145","sct-kr","sct-freeboard","s","union","mini","spt","zzan","dblog","sct"],"image":["https:\/\/cdn.steemitimages.com\/DQmUUPpbRLuRAJEB7fcBxN31PyzznHmvED5n7deAXzpcvRB\/image.png","https:\/\/cdn.steemitimages.com\/DQmQR3A6hS4G5iwi75WHwshqwhPQWw79YMPJ4BP38LhSSkC\/image.png"],"links":["https:\/\/api.steemmonsters.io\/players\/history?username=tradingideas&from_block=-1&limit=250&types=sm_claim_reward,claim_reward"],"app":"steemcoinpan\/0.1","format":"markdown","canonical_url":"https:\/\/www.steemcoinpan.com\/@tradingideas\/6nl992"}
created2020-02-23 15:03:57
last_update2020-02-23 15:03:57
depth0
children3
net_rshares52,729,160,033,004
last_payout2020-03-01 15:03:57
cashout_time1969-12-31 23:59:59
total_payout_value7.823 SBD
curator_payout_value7.129 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,306
author_reputation3,162,277,660,168,379
root_title"[스팀몬스터] 일퀘 그리고 일 보상 프로그램 수정"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (165)
@jsquare ·
JCAR 2월 구독보팅입니다. 
날마다 좋은 날 되세요. 
properties (22)
post_id84,651,921
authorjsquare
permlinkre-6nl992-20200223t151521z
categoryhive-101145
json_metadata{"app":"rewarding\/0.1.5"}
created2020-02-23 15:15:27
last_update2020-02-23 15:15:27
depth1
children0
net_rshares0
last_payout2020-03-01 15:15:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length35
author_reputation1,180,924,743,239,699
root_title"[스팀몬스터] 일퀘 그리고 일 보상 프로그램 수정"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@feelsogood.spt ·
즐몬하세요 ^^
properties (22)
post_id84,652,018
authorfeelsogood.spt
permlinkre-6nl992-20200223t151919z
categoryhive-101145
json_metadata{"app":"rewarding\/0.1.5"}
created2020-02-23 15:19:21
last_update2020-02-23 15:19:21
depth1
children0
net_rshares0
last_payout2020-03-01 15:19:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length8
author_reputation73,752,675,176
root_title"[스팀몬스터] 일퀘 그리고 일 보상 프로그램 수정"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steemitboard ·
Congratulations @tradingideas! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://steemitimages.com/60x60/http://steemitboard.com/img/notifications/postallweek.png"></td><td>You published a post every day of the week</td></tr>
</table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@tradingideas) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=tradingideas)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
post_id84,671,842
authorsteemitboard
permlinksteemitboard-notify-tradingideas-20200224t082544000z
categoryhive-101145
json_metadata{"image":["https:\/\/steemitboard.com\/img\/notify.png"]}
created2020-02-24 08:25:45
last_update2020-02-24 08:25:45
depth1
children0
net_rshares0
last_payout2020-03-02 08:25:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length870
author_reputation38,705,954,145,809
root_title"[스팀몬스터] 일퀘 그리고 일 보상 프로그램 수정"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000