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!")
def try_to_get_inventory(): session = auth.login(*credentials.steam(), get_steamguard_code=automated_steamguard) return inventory.retrieve_profile_inventory(session, data.app_id("csgo"))
def get_to_session(): session = auth.login(*credentials.steam(), get_steamguard_code=automated_steamguard) return session
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!") 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)))