public BotController(ILogger logger, IPPather pather, DataConfig dataConfig, IConfiguration configuration)
        {
            this.logger     = logger;
            this.pather     = pather;
            this.DataConfig = dataConfig;
            this.areaDb     = new AreaDB(logger, dataConfig);

            updatePlayerPostion.Start();
            wowProcess      = new WowProcess();
            WowScreen       = new WowScreen(logger, wowProcess);
            WowProcessInput = new WowProcessInput(logger, wowProcess);

            var frames = DataFrameConfiguration.LoadFrames();

            var scad = new StartupConfigAddonData();

            configuration.GetSection(StartupConfigAddonData.Position).Bind(scad);
            if (scad.Mode == "Network")
            {
                logger.LogInformation("Using NetworkedAddonDataProvider");
                addonDataProvider = new NetworkedAddonDataProvider(logger, scad.myPort, scad.connectTo, scad.connectPort);
            }
            else
            {
                logger.LogInformation("Using AddonDataProvider");
                addonDataProvider = new AddonDataProvider(WowScreen, frames);
            }

            AddonReader = new AddonReader(logger, DataConfig, areaDb, addonDataProvider);

            minimapNodeFinder  = new MinimapNodeFinder(WowScreen, new PixelClassifier());
            MinimapImageFinder = minimapNodeFinder as IImageProvider;

            addonThread = new Thread(AddonRefreshThread);
            addonThread.Start();

            // wait for addon to read the wow state
            var sw = new Stopwatch();

            sw.Start();
            while (AddonReader.PlayerReader.Sequence == 0 || !Enum.GetValues(typeof(PlayerClassEnum)).Cast <PlayerClassEnum>().Contains(AddonReader.PlayerReader.PlayerClass))
            {
                if (sw.ElapsedMilliseconds > 5000)
                {
                    logger.LogWarning("There is a problem with the addon, I have been unable to read the player class. Is it running ?");
                    sw.Restart();
                }
                Thread.Sleep(100);
            }

            logger.LogDebug($"Woohoo, I have read the player class. You are a {AddonReader.PlayerReader.PlayerClass}.");

            npcNameFinder = new NpcNameFinder(logger, WowScreen, WowProcessInput);
            WowScreen.AddDrawAction(npcNameFinder.ShowNames);

            //ActionFactory = new GoalFactory(AddonReader, logger, wowProcess, npcNameFinder);

            screenshotThread = new Thread(ScreenshotRefreshThread);
            screenshotThread.Start();
        }
Пример #2
0
 public ActionBarPopulator(ILogger logger, WowProcess wowProcess, WowProcessInput wowProcessInput, ClassConfiguration config, AddonReader addonReader)
 {
     this.logger          = logger;
     this.wowProcess      = wowProcess;
     this.wowProcessInput = wowProcessInput;
     this.config          = config;
     this.addonReader     = addonReader;
 }
        public Test_MouseClicks(ILogger logger)
        {
            this.logger = logger;

            wowProcess      = new WowProcess();
            wowScreen       = new WowScreen(logger, wowProcess);
            wowProcessInput = new WowProcessInput(logger, wowProcess);
        }
Пример #4
0
        public LootWheel(ILogger logger, WowProcessInput input, WowScreen wowScreen, PlayerReader playerReader)
        {
            this.logger       = logger;
            this.input        = input;
            this.wowScreen    = wowScreen;
            this.playerReader = playerReader;

            wowScreen.GetRectangle(out var rect);

            centre      = new Point(rect.Centre().X, (int)((rect.Bottom / 5) * 3f));
            radiusLarge = rect.Bottom / 6;
            dtheta      = (float)(2 * Math.PI / num_theta);
        }
Пример #5
0
 public StopMoving(WowProcessInput input, PlayerReader playerReader)
 {
     this.input        = input;
     this.playerReader = playerReader;
 }
Пример #6
0
 public ExecGameCommand(ILogger logger, WowProcessInput wowProcessInput)
 {
     this.logger          = logger;
     this.wowProcessInput = wowProcessInput;
 }
Пример #7
0
 public PlayerDirection(ILogger logger, WowProcessInput input, PlayerReader playerReader)
 {
     this.logger       = logger;
     this.input        = input;
     this.playerReader = playerReader;
 }