Exemple #1
0
        /// <summary>
        /// Defines and executes the logic of the bot. Lines in the try statement can be
        /// rearranged to tweak the logic, or commands can be added/removed for significantly
        /// different bot behavior.
        /// </summary>
        public async Task AutoHunt()
        {
            Log.Information($"Starting bot for {_client.Self.Name}...");

            while (_isBotRunning.Value)
            {
                try
                {
                    if (_isBotPaused.Value)
                    {
                        continue;
                    }
                    _client.UpdateGroup(_clients);
                    if (await Return())
                    {
                        continue;
                    }
                    if (await Gate())
                    {
                        continue;
                    }
                    if (await Ring())
                    {
                        continue;
                    }
                    MarkExternalGroupMembersForEsuna();
                    //if (await _client.Commands.Mana.Invoke(20)) continue;
                    //if (await _client.Commands.Heal.RestoreGroupIfEligible()) continue;
                    //if (await _client.Commands.Heal.HealGroupIfBelowVitaPercent(20)) continue;
                    //if (await _client.Commands.Asv.SanctuaryGroup()) continue;
                    //if (await _client.Commands.Debuffs.AtoneGroup()) continue;
                    //if (await _client.Commands.Heal.HealGroupIfBelowVitaPercent(30)) continue;
                    //if (await _client.Commands.Debuffs.RemoveCurseGroup()) continue;
                    //if (await _client.Commands.Debuffs.CureParalysisGroup()) continue;
                    //if (await _client.Commands.Debuffs.PurgeGroup()) continue;
                    //if (await _client.Commands.Asv.HardenArmorGroup()) continue;
                    //if (await _client.Commands.Debuffs.CurseNpcs()) continue;
                    if (await _client.UpdateNpcs(_client.Spells.KeySpells.Heal))
                    {
                        continue;
                    }
                    //if (await _client.Commands.Debuffs.RemoveVeilGroup()) continue;
                    //if (await _client.Commands.Heal.HealGroupIfEligible()) continue;
                    //if (await _client.Commands.Asv.ValorGroup()) continue;
                    //if (await _client.Commands.Heal.HealGroupIfBelowVitaPercent(90)) continue;
                    //if (await _client.Commands.Mana.InspireGroup(75)) continue;
                    //await _client.Commands.HardenBody();
                }

                catch (Exception ex)
                {
                    TkBotFactory.LogException(ex);
                }
            }

            Log.Information($"Shutting down Poet bot for {_client.Self.Name}...");
            TkBotFactory.Terminate(_client);
        }
Exemple #2
0
        public static async Task Main(string[] args)
        {
            try
            {
                var bot = new DemoBot();
                await bot.AutoHunt();
            }

            catch (Exception ex)
            {
                TkBotFactory.Terminate(ex);
            }
        }