diff --git a/TBot.Common/Logging/LogSender.cs b/TBot.Common/Logging/LogSender.cs index 5683270f..6462fefd 100644 --- a/TBot.Common/Logging/LogSender.cs +++ b/TBot.Common/Logging/LogSender.cs @@ -20,6 +20,7 @@ public enum LogSender { BuyOfferOfTheDay, LifeformsAutoMine, LifeformsAutoResearch, + AutoFleepJumpGate, //End Brain Features Expeditions, Harvest, diff --git a/TBot.Ogame.Infrastructure/Enums/Feature.cs b/TBot.Ogame.Infrastructure/Enums/Feature.cs index 555fd575..25306b9b 100644 --- a/TBot.Ogame.Infrastructure/Enums/Feature.cs +++ b/TBot.Ogame.Infrastructure/Enums/Feature.cs @@ -22,6 +22,7 @@ public enum Feature { BrainLifeformAutoResearch = 13, AutoDiscovery = 14, BrainAutobuildDefence = 15, + BrainAutoFleepJumpGate = 16, BrainCelestialAutoMine = 101, BrainCelestialLifeformAutoMine = 102, diff --git a/TBot.Ogame.Infrastructure/Enums/Features.cs b/TBot.Ogame.Infrastructure/Enums/Features.cs index 5d7dc956..6e1924d8 100644 --- a/TBot.Ogame.Infrastructure/Enums/Features.cs +++ b/TBot.Ogame.Infrastructure/Enums/Features.cs @@ -16,6 +16,7 @@ public static class Features { Feature.BrainLifeformAutoResearch, Feature.BrainOfferOfTheDay, Feature.BrainAutoResearch, + Feature.BrainAutoFleepJumpGate, Feature.AutoFarm, Feature.Expeditions, Feature.AutoDiscovery, diff --git a/TBot.Ogame.Infrastructure/IOgameService.cs b/TBot.Ogame.Infrastructure/IOgameService.cs index 230e9811..548ed2fc 100644 --- a/TBot.Ogame.Infrastructure/IOgameService.cs +++ b/TBot.Ogame.Infrastructure/IOgameService.cs @@ -84,7 +84,7 @@ void Initialize(Credentials credentials, bool IsPortAvailable(string host, int port = 8080); Task IsUnderAttack(); Task IsVacationMode(); - Task JumpGate(Celestial origin, Celestial destination, Ships ships); + Task JumpGate(Celestial origin, Celestial destination, Ships ships); Task SendDiscovery(Celestial origin, Coordinate coords); void KillOgamedExecutable(CancellationToken ct = default); Task Login(); diff --git a/TBot.Ogame.Infrastructure/Models/JumpGateResult.cs b/TBot.Ogame.Infrastructure/Models/JumpGateResult.cs new file mode 100644 index 00000000..fd6b2e51 --- /dev/null +++ b/TBot.Ogame.Infrastructure/Models/JumpGateResult.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; + +namespace TBot.Ogame.Infrastructure.Models +{ + public class JumpGateResult + { + [JsonProperty("success")] + public bool Success { get; set; } + + [JsonProperty("rechargeCountdown")] + public long RechargeCountdown { get; set; } + + [JsonIgnore] + public string Error { get; set; } + } +} diff --git a/TBot.Ogame.Infrastructure/OgameService.cs b/TBot.Ogame.Infrastructure/OgameService.cs index 744c44f0..fe24f964 100644 --- a/TBot.Ogame.Infrastructure/OgameService.cs +++ b/TBot.Ogame.Infrastructure/OgameService.cs @@ -689,7 +689,7 @@ public async Task GetEspionageReport(int msgId) { return await GetAsync($"/bot/espionage-report/{msgId}"); } - public async Task JumpGate(Celestial origin, Celestial destination, Ships ships) { + public async Task JumpGate(Celestial origin, Celestial destination, Ships ships) { List> parameters = new List>(); parameters.Add(new KeyValuePair("moonDestination", destination.ID.ToString())); @@ -698,12 +698,22 @@ public async Task JumpGate(Celestial origin, Celestial destination, Ships ships) long qty = (long) prop.GetValue(ships, null); if (qty == 0) continue; - if (Enum.TryParse(prop.Name, out Buildables buildable)) { + + if (Enum.TryParse(prop.Name, out Buildables buildable)) { parameters.Add(new KeyValuePair("ships", $"{(int) buildable},{prop.GetValue(ships, null)}")); } } - await PostAsync($"/bot/moons/{origin.ID}/jump-gate", parameters.ToArray()); + try { + var result = await PostAsync($"/bot/moons/{origin.ID}/jump-gate", parameters.ToArray()); + return result; + } catch (HttpRequestException ex) { + return new JumpGateResult { Success = false, RechargeCountdown = 0, Error = ex.Message }; + } catch (OgamedException ex) { + return new JumpGateResult { Success = false, RechargeCountdown = 0, Error = ex.Message }; + } catch (Exception ex) { + return new JumpGateResult { Success = false, RechargeCountdown = 0, Error = ex.Message }; + } } public async Task> Phalanx(Celestial origin, Coordinate coords) { diff --git a/TBot/Services/TBotMain.cs b/TBot/Services/TBotMain.cs index 2f89bc92..854b8302 100644 --- a/TBot/Services/TBotMain.cs +++ b/TBot/Services/TBotMain.cs @@ -90,6 +90,12 @@ public IFleetScheduler FleetScheduler { return _fleetScheduler; } } + public IWorkerFactory WorkerFactory { + get { + return _workerFactory; + } + } + public long SleepDuration { get; set; } public DateTime NextWakeUpTime { get; set; } @@ -264,7 +270,7 @@ public async Task Init(string settingPath, await Task.Delay(RandomizeHelper.CalcRandomInterval(IntervalType.AFewSeconds)); loggedIn = true; - log(LogLevel.Information, LogSender.Tbot, "Logged in!"); + log(LogLevel.Information, LogSender.Tbot, "Logged in!"); await InitUserData(); @@ -551,7 +557,7 @@ private async void OnSettingsChanged() { finally { _settingsReloadSemaphore.Release(); } - + } private void InitializeSleepMode() { @@ -639,7 +645,7 @@ public async Task TelegramBuild(Buildables buildable, decimal num = 0) { return; } - public async Task TelegramGetCurrentAuction() { + public async Task TelegramGetCurrentAuction() { Auction auction; try { auction = await _ogameService.GetCurrentAuction(); @@ -920,10 +926,15 @@ public async Task TelegramJumpGate(Celestial origin, Coordinate destination, str } } try { - await _ogameService.JumpGate(origin, moondest, ships); - await SendTelegramMessage($"JumGate Done!"); + var jg = await _ogameService.JumpGate(origin, moondest, ships); + if (jg.Success) { + await SendTelegramMessage($"JumpGate done. Cooldown: {jg.RechargeCountdown}s"); + } else { + var msg = !string.IsNullOrWhiteSpace(jg.Error) ? jg.Error : $"cooldown {jg.RechargeCountdown}s"; + await SendTelegramMessage($"JumpGate failed: {msg}"); + } } catch (Exception ex) { - await SendTelegramMessage($"JumGate Failed! Error: {ex.Message}"); + await SendTelegramMessage($"JumpGate Failed! Error: {ex.Message}"); } } diff --git a/TBot/Services/TelegramMessenger.cs b/TBot/Services/TelegramMessenger.cs index 1815b268..b28067ce 100644 --- a/TBot/Services/TelegramMessenger.cs +++ b/TBot/Services/TelegramMessenger.cs @@ -20,6 +20,7 @@ using Serilog.Events; using Telegram.Bot.Types.ReplyMarkups; using Tbot.Workers; +using Tbot.Workers.Brain; namespace Tbot.Services { @@ -276,7 +277,8 @@ public async Task HandleUpdateAsync(ITelegramBotClient botClient, Update update, "/stopautofarm", "/startautofarm", "/stopautodiscovery", - "/startautodiscovery" + "/startautodiscovery", + "/fleetjumpgate" }; if (update.Type != UpdateType.Message) { @@ -352,14 +354,14 @@ await SendMessage(botClient, message.Chat, $"Selected index \"{args.ElementAt(1) else { await SendMessage(botClient, message.Chat, "Telegram Logger is disabled."); } - + return; case "/setloglevel": if (args.Length != 2) { await SendMessage(botClient, message.Chat, "Usage is /setloglevel Debug|Information|Warning|Error"); return; } - + if (Enum.TryParse(args[1], true, out LogEventLevel newLevel) == true) { await SendMessage(botClient, message.Chat, $"Enabling Telegram logger with level {newLevel.ToString()}"); _logger.AddTelegramLogger(Api, Channel); @@ -455,7 +457,8 @@ await SendMessage(botClient, message.Chat, "/stopautofarm - stop autofarm\n" + "/startautofarm - start autofarm\n" + "/stopautodiscovery - stop autodiscovery\n" + - "/startautodiscovery - start autodiscovery\n" + "/startautodiscovery - start autodiscovery\n" + + "/fleetjumpgate - run jump gate worker immediately\n" , ParseMode.Html); return; default: @@ -1097,6 +1100,28 @@ await SendMessage(botClient, message.Chat, await SendMessage(botClient, message.Chat, "Autodiscovery started!"); return; + case "/fleetjumpgate": + if (args.Length != 1) { + await SendMessage(botClient, message.Chat, "No arguments accepted with this command!"); + return; + } + + AutoFleetJumpGateWorker worker = (AutoFleetJumpGateWorker) currInstance.WorkerFactory.GetWorker(Feature.BrainAutoFleepJumpGate); + + if (worker == null) { + await SendMessage(botClient, message.Chat, "JumpGate worker not available."); + return; + } + + await SendMessage(botClient, message.Chat, "Running JumpGate worker now..."); + try { + await worker.RunFromTelegramAsync(); + await SendMessage(botClient, message.Chat, "JumpGate worker completed."); + } catch (Exception ex) { + await SendMessage(botClient, message.Chat, $"Error during JumpGate execution: {ex.Message}"); + } + return; + case "/getinfo": args = message.Text.Split(' '); diff --git a/TBot/Workers/Brain/AutoFleetJumpGateWorker.cs b/TBot/Workers/Brain/AutoFleetJumpGateWorker.cs new file mode 100644 index 00000000..88dac292 --- /dev/null +++ b/TBot/Workers/Brain/AutoFleetJumpGateWorker.cs @@ -0,0 +1,307 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using TBot.Common.Logging; +using Tbot.Helpers; +using Tbot.Includes; +using TBot.Model; +using TBot.Ogame.Infrastructure; +using TBot.Ogame.Infrastructure.Enums; +using TBot.Ogame.Infrastructure.Models; +using Tbot.Services; + +namespace Tbot.Workers.Brain { + public class AutoFleetJumpGateWorker : WorkerBase { + private readonly ITBotOgamedBridge _tbotOgameBridge; + private readonly IOgameService _ogameService; + + public AutoFleetJumpGateWorker(ITBotMain parentInstance, + IOgameService ogameService, + ITBotOgamedBridge tbotOgameBridge) : + base(parentInstance) { + _ogameService = ogameService; + _tbotOgameBridge = tbotOgameBridge; + } + + protected override async Task Execute() { + bool jumpGateAttempted = false; + bool jumpGateSucceeded = false; + long highestRechargeCountdown = 0; + + if (!_tbotInstance.UserData.isSleeping) { + DoLog(LogLevel.Information, $"Starting jumpgate"); + await SetDefaultWorkerPeriod(); + try { + // Get target moon coordinates + var targetGalaxy = (int) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate.Target.Galaxy; + var targetSystem = (int) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate.Target.System; + var targetPosition = (int) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate.Target.Position; + + Celestial moondest = _tbotInstance.UserData.celestials.Unique() + .Where(c => c.Coordinate.Galaxy == targetGalaxy) + .Where(c => c.Coordinate.System == targetSystem) + .Where(c => c.Coordinate.Position == targetPosition) + .Where(c => c.Coordinate.Type == Celestials.Moon) + .SingleOrDefault() ?? new() { ID = 0 }; + + if (moondest.ID == 0) { + DoLog(LogLevel.Warning, + $"Target moon not found: {targetGalaxy}:{targetSystem}:{targetPosition}"); + return; + } + + + // Update target moon facilities to check JumpGate + try { + moondest = await _tbotOgameBridge.UpdatePlanet(moondest, UpdateTypes.Facilities) as Moon; + if (moondest == null) { + DoLog(LogLevel.Error, + $"Failed to update target moon facilities - UpdatePlanet returned null"); + return; + } + + if (moondest.Facilities.JumpGate <= 0) { + DoLog(LogLevel.Error, + $"Target moon {moondest.Coordinate} does not have JumpGate facility (Level: {moondest.Facilities.JumpGate})"); + return; + } + } catch (Exception ex) { + DoLog(LogLevel.Error, $"Exception while validating target moon facilities: {ex.Message}"); + return; + } + + + var minPointsToTeleport = (long) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate + .MinimumAmountOfShipPointsToTeleport; + + // Define jumpable ships and map 'leave on moon' config only for jumpable + var jumpable = new HashSet { + Buildables.LightFighter, + Buildables.HeavyFighter, + Buildables.Cruiser, + Buildables.Battleship, + Buildables.Battlecruiser, + Buildables.Bomber, + Buildables.Destroyer, + Buildables.Deathstar, + Buildables.SmallCargo, + Buildables.LargeCargo, + Buildables.Recycler, + Buildables.ColonyShip, + Buildables.EspionageProbe, + Buildables.Reaper, + Buildables.Pathfinder + }; + + var leaveCfg = _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate + .MinimumAmountOfShipsToBeLeftOnMoon; + var shipsToLeave = new Ships( + lightFighter: (long) leaveCfg.LightFighter, + heavyFighter: (long) leaveCfg.HeavyFighter, + cruiser: (long) leaveCfg.Cruiser, + battleship: (long) leaveCfg.Battleship, + battlecruiser: (long) leaveCfg.Battlecruiser, + bomber: (long) leaveCfg.Bomber, + destroyer: (long) leaveCfg.Destroyer, + deathstar: (long) leaveCfg.Deathstar, + smallCargo: (long) leaveCfg.SmallCargo, + largeCargo: (long) leaveCfg.LargeCargo, + colonyShip: (long) leaveCfg.ColonyShip, + recycler: (long) leaveCfg.Recycler, + espionageProbe: (long) leaveCfg.EspionageProbe, + solarSatellite: 0, + crawler: 0, + reaper: (long) leaveCfg.Reaper, + pathfinder: (long) leaveCfg.Pathfinder + ); + + // Get all moons except target, calculate potential teleportable fleet points + var moonsWithTeleportablePoints = new List<(Moon moon, long teleportablePoints)>(); + + foreach (var celestial in _tbotInstance.UserData.celestials.Where(c => + c is Moon && c.ID != moondest.ID)) { + var moon = celestial as Moon; + // Update ships on moon + moon = await _tbotOgameBridge.UpdatePlanet(moon, UpdateTypes.Ships) as Moon; + // Update facilities to check jump gate + moon = await _tbotOgameBridge.UpdatePlanet(moon, UpdateTypes.Facilities) as Moon; + + // Check if moon has jump gate + if (moon.Facilities.JumpGate <= 0) { + continue; + } + + // Calculate ships that would be left (only for jumpable types) + var shipsToLeaveAdjusted = new Ships(); + foreach (var shipType in jumpable) { + var currentAmount = moon.Ships.GetAmount(shipType); + var leftAmount = shipsToLeave.GetAmount(shipType); + var amountToLeave = Math.Min(currentAmount, leftAmount); + shipsToLeaveAdjusted.SetAmount(shipType, amountToLeave); + } + + // Calculate teleportable points (total points - points of ships to leave) + var totalPoints = moon.Ships.GetFleetPoints(); + var leftPoints = shipsToLeaveAdjusted.GetFleetPoints(); + var teleportablePoints = totalPoints - leftPoints; + + // Keep qualified list for actual jump attempts + if (teleportablePoints >= minPointsToTeleport) { + DoLog(LogLevel.Debug, $"Moon {moon.Coordinate} qualifies for JumpGate with teleportablePoints={teleportablePoints}"); + moonsWithTeleportablePoints.Add((moon, teleportablePoints)); + } else { + DoLog(LogLevel.Debug, $"Moon {moon.Coordinate} does not qualify for JumpGate with teleportablePoints={teleportablePoints}, min required={minPointsToTeleport}"); + + } + } + + // Order by teleportable points descending + var orderedMoons = moonsWithTeleportablePoints + .OrderByDescending(x => x.teleportablePoints) + .Select(x => x.moon) + .ToList(); + + if (orderedMoons.Count <= 0) { + DoLog(LogLevel.Debug, $"No moons with ships"); + return; + } + + // Build actions: best -> target, then pairwise i=1 -> i+1 + var teleportsPairs = new List<(Moon origin, Celestial destination)>(); + teleportsPairs.Add((orderedMoons[0], moondest)); + + for (var i = 1; i + 1 < orderedMoons.Count; i += 2) { + teleportsPairs.Add((orderedMoons[i], orderedMoons[i + 1])); + } + + for (var i = 0; i < teleportsPairs.Count; i++) { + var origin = teleportsPairs[i].origin; + var destination = teleportsPairs[i].destination; + jumpGateAttempted = true; + + // Calculate ships to send (only for jumpable types) + var shipsToSend = new Ships(); + foreach (var shipType in jumpable) { + var currentAmount = origin.Ships.GetAmount(shipType); + var leftAmount = shipsToLeave.GetAmount(shipType); + var amountToSend = Math.Max(0, currentAmount - leftAmount); + shipsToSend.SetAmount(shipType, amountToSend); + } + + if (shipsToSend.IsEmpty()) { + continue; // No ships to send + } + + // Perform JumpGate + try { + var result = await _ogameService.JumpGate(origin, destination, shipsToSend); + if (result.Success) { + DoLog(LogLevel.Information, + $"JumpGated {shipsToSend} from {origin.Coordinate} to {destination.Coordinate} (recharge: {result.RechargeCountdown}s)"); + if (result.RechargeCountdown > highestRechargeCountdown) { + highestRechargeCountdown = result.RechargeCountdown; + } + + jumpGateSucceeded = true; + } else { + if (!string.IsNullOrWhiteSpace(result.Error)) { + DoLog(LogLevel.Error, + $"JumpGate failed from {origin.Coordinate}: {result.Error}"); + } else { + DoLog(LogLevel.Information, + $"JumpGate not available from {origin.Coordinate} (cooldown: {result.RechargeCountdown}s)"); + } + } + } catch (Exception ex) { + DoLog(LogLevel.Error, $"JumpGate failed from {origin.Coordinate}: {ex.Message}"); + } + + // Small delay between jumpgates in the same loop if we have any pending jumps. + if (i < teleportsPairs.Count - 1) { + try { + var delayMs = RandomizeHelper.CalcRandomIntervalSecToMs(5, 15); + await Task.Delay(delayMs); + } catch { } + } + } + } catch (Exception ex) { + DoLog(LogLevel.Error, $"Error in JumpGate execution: {ex.Message}"); + } + } + + // Set next interval based on whether JumpGate was attempted/succeeded + if (jumpGateAttempted && jumpGateSucceeded) { + // Compare recharge (ms) vs configured random interval (min -> ms), then add 2-5 min jitter if recharge dominates + int minIntervalMin = (int) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate.CheckIntervalMin; + int maxIntervalMin = (int) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate.CheckIntervalMax; + long cfgRandom = RandomizeHelper.CalcRandomInterval(minIntervalMin, maxIntervalMin); + long rechargeMs = highestRechargeCountdown > 0 ? highestRechargeCountdown * 1000 : 0; + long interval = rechargeMs > cfgRandom + ? rechargeMs + RandomizeHelper.CalcRandomInterval(2, 5) // jitter in minutes + : cfgRandom; + if (interval <= 0) + interval = RandomizeHelper.CalcRandomInterval(IntervalType.SomeSeconds); + var time = await _tbotOgameBridge.GetDateTime(); + var newTime = time.AddMilliseconds(interval); + ChangeWorkerPeriod(interval); + DoLog(LogLevel.Information, $"Next JumpGate check at {newTime.ToString()}"); + } else { + // Set next interval using minutes (helper converts to ms) + var newTime = await SetDefaultWorkerPeriod(); + DoLog(LogLevel.Information, $"Next JumpGate check at {newTime.ToString()}"); + } + } + + private async Task SetDefaultWorkerPeriod() + { + int minIntervalMin = (int) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate.CheckIntervalMin; + int maxIntervalMin = (int) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate.CheckIntervalMax; + long interval = RandomizeHelper.CalcRandomInterval(minIntervalMin, maxIntervalMin); + if (interval <= 0) + interval = RandomizeHelper.CalcRandomInterval(IntervalType.SomeSeconds); + var time = await _tbotOgameBridge.GetDateTime(); + var newTime = time.AddMilliseconds(interval); + ChangeWorkerPeriod(interval); + return newTime; + } + + public override bool IsWorkerEnabledBySettings() { + try { + return ( + (bool) _tbotInstance.InstanceSettings.Brain.Active && + (bool) _tbotInstance.InstanceSettings.Brain.AutoFleepJumpGate.Active + ); + } catch (Exception) { + return false; + } + } + + public override string GetWorkerName() { + return "AutoFleetJumpGate"; + } + + public override Feature GetFeature() { + return Feature.BrainAutoFleepJumpGate; + } + + public override LogSender GetLogSender() { + return LogSender.AutoFleepJumpGate; + } + + public async Task RunFromTelegramAsync() + { + try + { + await Execute(); + } + catch (Exception ex) + { + DoLog(LogLevel.Error, $"Manual /fleetjumpgate execution failed: {ex.Message}"); + throw; + } + } + } +} diff --git a/TBot/Workers/WorkerFactory.cs b/TBot/Workers/WorkerFactory.cs index 36e363a1..c106fc6a 100644 --- a/TBot/Workers/WorkerFactory.cs +++ b/TBot/Workers/WorkerFactory.cs @@ -38,7 +38,7 @@ public ITBotWorker InitializeWorker(Feature feat, ITBotMain tbotMainInstance, IT if (GetWorker(feat) != null) { return GetWorker(feat); } - + ITBotWorker newWorker = feat switch { Feature.Defender => new DefenderWorker(tbotMainInstance, _ogameService, _fleetScheduler, tbotOgameBridge), Feature.BrainAutobuildCargo => new AutoCargoWorker(tbotMainInstance, _ogameService, _fleetScheduler, _calculationService, tbotOgameBridge), @@ -54,6 +54,7 @@ public ITBotWorker InitializeWorker(Feature feat, ITBotMain tbotMainInstance, IT Feature.BrainLifeformAutoMine => new LifeformsAutoMineWorker(tbotMainInstance, _ogameService, _fleetScheduler, _calculationService, tbotOgameBridge, this), Feature.BrainLifeformAutoResearch => new LifeformsAutoResearchWorker(tbotMainInstance, _ogameService, _fleetScheduler, _calculationService, tbotOgameBridge, this), Feature.AutoDiscovery => new AutoDiscoveryWorker(tbotMainInstance, _ogameService, _fleetScheduler, _calculationService, tbotOgameBridge), + Feature.BrainAutoFleepJumpGate => new AutoFleetJumpGateWorker(tbotMainInstance, _ogameService, tbotOgameBridge), _ => null }; @@ -63,7 +64,7 @@ public ITBotWorker InitializeWorker(Feature feat, ITBotMain tbotMainInstance, IT } _workers.TryAdd(feat, newWorker); } - + return newWorker; } @@ -95,7 +96,7 @@ public ITBotWorker GetWorker(Feature feat) { } return null; } - + public ITBotCelestialWorker GetCelestialWorker(ITBotWorker parentWorker, Celestial celestial) { if (parentWorker.celestialWorkers.Any(e => e.Key.ID == celestial.ID)) { return parentWorker.celestialWorkers.First(e => e.Key.ID == celestial.ID).Value; @@ -113,6 +114,7 @@ private bool IsBrain(Feature feat) { case Feature.BrainAutoResearch: case Feature.BrainLifeformAutoMine: case Feature.BrainLifeformAutoResearch: + case Feature.BrainAutoFleepJumpGate: case Feature.BrainCelestialAutoMine: case Feature.BrainCelestialLifeformAutoMine: case Feature.BrainCelestialLifeformAutoResearch: diff --git a/TBot/instance_settings.json b/TBot/instance_settings.json index 6f77812b..4af71626 100644 --- a/TBot/instance_settings.json +++ b/TBot/instance_settings.json @@ -351,10 +351,39 @@ "CheckIntervalMin": 3000, "CheckIntervalMax": 6000 }, - "BuyOfferOfTheDay": { + "BuyOfferOfTheDay": { "Active": false, "CheckIntervalMin": 240, "CheckIntervalMax": 360 + }, + "AutoFleepJumpGate": { + "Active": false, + "CheckIntervalMin": 5, + "CheckIntervalMax": 10, + "Target": { + "Galaxy": 1, + "System": 1, + "Position": 1, + "Type": "Moon" + }, + "MinimumAmountOfShipsToBeLeftOnMoon": { + "LightFighter": 0, + "HeavyFighter": 0, + "Cruiser": 0, + "Battleship": 0, + "Battlecruiser": 0, + "Bomber": 0, + "Destroyer": 0, + "Deathstar": 100000, + "SmallCargo": 0, + "LargeCargo": 0, + "ColonyShip": 0, + "Recycler": 0, + "EspionageProbe": 0, + "Reaper": 0, + "Pathfinder": 0 + }, + "MinimumAmountOfShipPointsToTeleport": 500000 } }, "Expeditions": {