public void Start() { if (!Win32.IsPoERun()) { throw new Exception("Path of Exile is not running!"); } if (Win32.GetActiveWindowTitle() != "Path of Exile") { Win32.PoE_MainWindow(); } _CurrenciesService = new CurrenciesService(_loggerService); _ItemService = new ItemsService(_CurrenciesService); // Go to hideout Win32.ChatCommand("/hideout"); Thread.Sleep(700); // Detect Stash if (!_StashHelper.OpenStash()) { _loggerService.Log("Stash is not found in the area."); throw new Exception("Stash is not found in the area."); } // Clean inventory _StashHelper.ClearInventory("5"); _StashHelper.ScanTab(); // Listen for trades _LogReaderServices = new ReadLogsServce(_loggerService, _CurrenciesService); _LogReaderServices.TradeRequest += TradeRequest; // Move for not been afk _LogReaderServices.AFK += StopAFK; // Trade accepted event _LogReaderServices.TradeAccepted += TradeAccepted; // Trade canceled event _LogReaderServices.TradeCanceled += TradeCanceled; //Trade customer left event _LogReaderServices.CustomerLeft += CustomerLeft; // Trade customer arrived event _LogReaderServices.CustomerArrived += BeginTrade; }
public void Start() { if (!Win32.IsPoERun()) { throw new Exception("Path of Exile is not running!"); } if (Win32.GetActiveWindowTitle() != "Path of Exile") { Win32.PoE_MainWindow(); } if (!ValidateFarmTabs()) { throw new Exception("Tabs not settup propperly."); } _CurrenciesSerive = new CurrenciesService(_loggerService); _ItemService = new ItemsService(_CurrenciesSerive); _TradeService = new TradeService(_ItemService, _CurrenciesSerive, _loggerService, new Tab()); // Go to hideout // Clean inventory _TradeService.ClearInventory("recycle_tab"); _StashHelper.ScanTab(); // Listen for trades _LogReaderServices = new ReadLogsServce(_loggerService, _CurrenciesSerive); _LogReaderServices.TradeRequest += _TradeService.TradeRequest; // Move for not been afk _LogReaderServices.AFK += _TradeService.StopAFK; // Trade accepted event _LogReaderServices.TradeAccepted += _TradeService.TradeAccepted; // Trade canceled event _LogReaderServices.TradeCanceled += _TradeService.TradeCanceled; //Trade customer left event _LogReaderServices.CustomerLeft += _TradeService.CustomerLeft; // Trade customer arrived event _LogReaderServices.CustomerArrived += _TradeService.BeginTrade; }