Beispiel #1
0
        public PoetTrainer(PoetConfiguration config)
        {
            TkTrainerFactory.Initialize(TkClient.BasePath.Poet.ToString());

            _clients = new ActiveClients(config.Process);

            _poet = string.IsNullOrWhiteSpace(config.Name)
                ? _clients.GetPoet()
                : _clients.GetPoet(config.Name);

            _poet.Activity.DefaultCommandCooldown = config.CommandDelay;

            Log.Debug($"Key item assignments:\n{_poet.Inventory.KeyItems}\n");
            Log.Debug($"Key spell assignments:\n{_poet.Spells.KeySpells}\n");

            _isRunning        = new AutoHotkeyToggle("^F2", "isRunning", true);
            _isPaused         = new AutoHotkeySuspendToggle("F2", "isPaused", false);
            _shouldHardenBody = new AutoHotkeyToggle("F5", "shouldHardenBody", config.HardenBody.Value);
            _resetCurses      = new AutoHotkeyToggle("F12", "resetCurses", false);
            _shouldEsunaExternalGroupMembers = new AutoHotkeyToggle("^F12", "shouldEsunaExternalGroupMembers", false);

            var toggles = new[]
            {
                _isRunning,
                _isPaused,
                _shouldHardenBody,
                _resetCurses,
                _shouldEsunaExternalGroupMembers
            };

            _ahk = AutoHotkeyEngine.Instance;
            _ahk.LoadToggles(toggles);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes settings and defines hotkeys.
        /// </summary>
        public DemoBot()
        {
            TkBotFactory.Initialize();

            _clients = new ActiveClients(TkBotFactory.ProcessName);
            //Log.Information("Got list of clients");

            _poet = _clients.GetPoet();
            _poet.Activity.DefaultCommandCooldown = TkBotFactory.CommandCooldown;

            _isBotRunning = new AutoHotkeyToggle("^F2", "isBotRunning", true);
            _isBotPaused  = new AutoHotkeyToggle("F2", "isBotPaused", false);
            _shouldEsunaExternalGroupMembers = new AutoHotkeyToggle("F12", "shouldEsunaExternalGroupMembers", false);
            _shouldRing   = new AutoHotkeyToggle("NumpadDiv", "shouldRing", false);
            _shouldGate   = new AutoHotkeyToggle("^NumpadDiv", "shouldGate", false);
            _shouldReturn = new AutoHotkeyToggle("!NumpadDiv", "shouldReturn", false);

            var toggles = new[]
            {
                _isBotRunning,
                _isBotPaused,
                _shouldEsunaExternalGroupMembers,
                _shouldRing,
                _shouldGate,
                _shouldReturn
            };

            var ahk = AutoHotkeyEngine.Instance;

            ahk.LoadToggles(toggles);
            ahk.LoadScript("NumpadAdd::Send {Ctrl down},{Ctrl up}");
        }
Beispiel #3
0
        public void SendKeystrokes(string keystrokes)
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetPoet();

            tkMemory.Send(keystrokes);
            Console.WriteLine($"Sent keystrokes: \"{keystrokes}\"");
        }
        public void ReadActivity()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetPoet();

            Console.WriteLine("----------Activity----------");
#pragma warning disable 612
            Console.WriteLine($"LatestActivity = {tkMemory.Activity.LatestActivity}");
            Console.WriteLine($"StatusLatestChange = {tkMemory.Activity.LatestStatusEffectChanged}");
#pragma warning restore 612
            Console.WriteLine($"StatusActiveEffects =\n{tkMemory.Activity.ActiveStatusEffects}");
        }