Beispiel #1
0
def sell_capsules():
    session = auth.login(*credentials.steam(), get_steamguard_code=automated_steamguard)
    csgo_inv = inventory.retrieve_profile_inventory(session, data.app_id("csgo"))

    capsules = [item for item in csgo_inv.items if is_capsule(item)]
    for cap in capsules:
        for tag_name, tag_data in cap.tags.items():
            print(tag_name + ": " + tag_data)
        price_data = cap.get_price_data(session)
        desired_price = market.get_desired_price(price_data.low_price.to_cents())
        print("Sell this item at " + str(desired_price) + " [" + str(price_data.low_price) + "] ?")
        response = input("->")
        if response == "y":
            try:
                market.post_item_for_sale(session, cap, desired_price)
            except market.ItemSaleError as sale_error:
                print("Got failure! Quitting...")
                quit()
            print("Posted item for sale!")
Beispiel #2
0
if __name__ == "__main__":
    session = auth.login(*credentials.steam(), get_steamguard_code=automated_steamguard)
    inv = inventory.retrieve_profile_inventory(session, data.app_id("csgo"))

    def only_stattrak(item):
        return item.tag_contains("Quality", "StatTrak")

    non_stattrak = [item for item in inv.items if not only_stattrak(item) and item.can_trade()]

    # get the true value of my inventory
    total = 0
    for item in non_stattrak:
        minimum_price = item.get_price_data(session).low_price
        print(item.market_name() + ": " + str(minimum_price))
        total += market.get_desired_price(minimum_price.to_cents())

    print("Value of non-stattrak CSGO inventory: " + str(Dollars.from_cents(total)))

    response = input("Sell all these items?")
    if response == "y":
        for item in non_stattrak:
            minimum_price = item.get_price_data(session).low_price
            desired_price = market.get_desired_price(minimum_price.to_cents())
            market.post_item_for_sale(session, item, desired_price)
            print("Posted " + item.market_name() + " at " + str(Dollars.from_cents(desired_price)))

    quit()

    def sum_min_value(dollar_value, item):
        return dollar_value + item.get_price_data(session).low_price