Skip to content

Commit

Permalink
Update main with example use
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarHofmann committed Aug 13, 2024
1 parent 35ea2ee commit f5c8966
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
import parameters as params
from libs.authentification import WFMarketAuth
from dotenv import load_dotenv
import os
import libs.augment_mods as augment_mods
from libs.market_items import MarketItem, MarketItems
from libs.sales_strategies import SellAllAtPrice, SellMostProfitable
from libs.sales_agents import ManualSales
from libs.market_items import MarketItems
from libs.sales_strategies import SellMostProfitable
from libs.sales_agents import AutomaticSales, ManualSales


if __name__ == '__main__':
# load_dotenv()

mods = augment_mods.get_augment_mods('Red Veil')
market_items = MarketItems()
market_items.add_items_from_item_names(mods)

market_items.get_item_prices()

# print(SellMostProfitable.propose_mods_to_sell(market_items, sell_below_current_cheapest= True))

items_to_sell = SellMostProfitable.propose_mods_to_sell(market_items, sell_below_current_cheapest= True)

# print most profitable mods with price
ManualSales().sell_items(items_to_sell)

# TODO automate sale
# automatic sell most profitable mods at best price
auth = WFMarketAuth()
load_dotenv()
wfm_mail = os.environ.get('WFM_MAIL')
wfm_password = os.environ.get('WFM_PASSWORD')
if wfm_mail and wfm_password:
auth.login_user(wfm_mail, wfm_password)
else:
print('Please set "WFM_MAIL" and "WFM_PASSWORD" in the .env file.')
exit()

agent = AutomaticSales(auth)
agent.sell_items(items_to_sell)

agent.delete_other_orders(market_items)




0 comments on commit f5c8966

Please sign in to comment.