Pikacuq is tweaking A-Bot :)

only glow mentioned in my code i’ve found is in combat :wink:

var filteredArmorRepairers = armorRepairers?.Where(x => !x.RampActive && x.GlowVisible == true);

and my isActive looks like that:

		static public bool? IsActive(
			this IShipUiModule module,
			Bot bot)
		{
			if (bot?.MouseClickLastAgeStepCountFromUIElement(module) <= 1)
				return null;

			if (bot?.ToggleLastAgeStepCountFromModule(module) <= 1)
				return null;

			return module?.RampActive;
		}

I dont really see any point in current code which should wait for glow on anything else then armorrep. But who knows, maybe there is somewhere something :wink:

thats why i use isActive, because is using rampactive. :slight_smile: even at armor repairer i deleted glowing.

var filteredArmorRepairers = armorRepairers?.Where(x => !x.RampActive == true);

and thats why i use 2 definitions, because deactivate module take the tooltip module and rampactive
glowing is in +, i deleted, in conclusion and is working better. Also you know, some code lignes are present before viir or developers improve sanderling, maybe using glowing had some sense at some point, or even now for some ships/moduls

actually I don’t think it’s even possible to do it quicker than wait. As I’m investigating in sanderling framework, rampactive is changing exactly at point when it stops glowing // eg. is really off. Till that, rampactive is still true.

sadly

edit: there is another value “BusyVisible” which is set to True when it starts glowing, so i’ll try to use that instead.

edit2:
so finally it’s not waiting for anything. Now it starts align, recall drones and disable propmod at one shot, then check if drones are back and if yes warp. It’s not nicest approach and am pretty sure that it can be done differently… but, it works :wink:

				var isAligning = memoryMeasurement?.ShipUi?.Indication?.LabelText?.Any(
					text => text?.Text?.RegexMatchSuccess("aligning", System.Text.RegularExpressions.RegexOptions.IgnoreCase) ?? false) ?? false;

				//start align
				if (!isAligning)
				{
					yield return new MenuPathTask
					{
						RootUIElement = memoryMeasurement?.InfoPanelCurrentSystem?.ListSurroundingsButton,
						Bot = Bot,
						ListMenuListPriorityEntryRegexPattern = new[] { new[] { retreatBookmark }, new[] { @"align", ParseStatic.MenuEntryWarpToAtLeafRegexPattern } },
					};
				}
				// disable propmod and recall drones
				if (ab.IsActive(Bot) ?? true)
				{
					yield return new PropAndDrones();
				}
				// be sure we have drones
				if (0 < droneInLocalSpaceCount)
				{
					yield return droneGroupInLocalSpace.ClickMenuEntryByRegexPattern(Bot, @"return.*bay");
				}
				// warp to safe
				else
				{
					yield return new MenuPathTask
					{
						RootUIElement = memoryMeasurement?.InfoPanelCurrentSystem?.ListSurroundingsButton,
						Bot = Bot,
						ListMenuListPriorityEntryRegexPattern = new[] { new[] { retreatBookmark }, new[] { @"dock", ParseStatic.MenuEntryWarpToAtLeafRegexPattern } },
					};
				}
			}
		}

		public IEnumerable<MotionParam> Effects => null;

		public class PropAndDrones : IBotTask
		{
			public IEnumerable<IBotTask> Component => null;

			public IEnumerable<MotionParam> Effects
			{
				get
				{
					yield return VirtualKeyCode.VK_1.KeyboardPress(); // to deactivate propmod
					yield return VirtualKeyCode.VK_R.KeyboardPress(); // to recall drones
				}
			}
		}
3 Likes

if is work, it doesn’t matter how you tweak and what memory readings you use. If is work better and you are happy good job; :slight_smile:

So yesterday night I’ve got an idea.
Because of currently buggy local in EVE (see reddit, and it happened to me several times as well) I have decided that RetreatTask is not quick enough in case of emergency

Situation: there is no neut in local and bot is doing what it should do. All of sudden on grid is landing neut/enemy → in default A-Bot, nothing really happens, in my code at least retreat task is triggered.
But because it’s recalling drones, it is not quick enough.
If you ask how this can happen, well it can → because local now is not really working and sometimes neuts are not shown!!

So, I’ve introduced myself another class called “EmergencyRetreakTask” which basically is triggered when

						var listOverviewEntryEnemies =
								memoryMeasurement?.WindowOverview?.FirstOrDefault()?.ListView?.Entry
								?.Where(entry => entry?.ListBackgroundColor?.Any(BackgroundColors.IsEnemy) ?? false)
								?.ToArray();
						if(listOverviewEntryEnemies.Length > 0)
						{
							yield return new EmergencyRetreatTask { Bot = bot };
						}

and Emergency basically just try two things:
1.check if propmod is alive and disable it together with recalling drones by shortcut
2.warp to safe

it is not waiting for dronesInSpace == 0, so if they are slow or far, they will be left behind. Acceptable collateral damage :slight_smile:
Neut landing on grid is basically around 6-7 seconds before he can actually lock you + lock time to scram. So EmergencyRetreat should be fairly quick enough to save your ship in case local chat is buggy.

This procedure is as well usefull in case there is inty fleet starbursting all over anomallies randomly, so probably your normal retreat will not be quick enough to escape → then there is called emergency one.

Dunno, this looks pretty neat to me as far I can tell :stuck_out_tongue:

:slight_smile: not a bad idea, about enemys on site . put this condition with dread check like here: Avoiding to struggle - a guide for beginers - #5 by kaboonus

but isnt better to have one retreat task + aboff and the stuffs with drones, align etc etc to be in saveship. Basicaly if an red is on grid, you forget about drones, turnoff ab and warp instantly :))
I didnt know about this bug in local, but i implemented this from the begining :wink:

i think it’s cleaner to have different class instead of putting stuff all over the place :wink: but it’s everyone habit how they are treating their code.

I have dreadcheck differently, as it will not target you in couple of seconds, so there is plenty of time to get drones back, no need of emergencyretreat… but u know, this bot still didnt loose single ship - so i cant really prove it yet :smiley:

update on “bug” am experiencing with loop when bot is on safespot(eg.citadel) … it keeps clicking InfoPanelWindow and hovering not around anomalies as I said earlier but around Asteroids on that very menu… pressing ESC helps bot to resume his normal behaviour.
So I have to look why it keeps opening infopanelwindow even when he is already at safespot → probably there is no detection if he is safe already or not?
And if so, stop RetreatTask from happening. Or smthing like that, dunno. It is very hard to simulate eg. have it somehow in debug mode.

if he is blabbering around asteroids maybe is a problem with the menu or measurements, since you use a test variant of abot, you never know whats inside and what is done some errors. I started with “official” abot and put some lines in him - improved him.
I didnt find any dread to test, and i hope never face one :))

The separated class are a little trickie to use, you have to put them in bot.cs and even if you make a chain you wake up with them activated for nothing ar in unwanted circumstances.
losing a ship isnt hard: someone poop in system and it happens you have to pass between all rats :)) You cant predict all situations. Or you are webbed /neut-ed etc and the red come on you

new class is inside retreat.cs so nothing really messy around.

webbing scramming is a thing, so my next goal is to make sure bot is shooting targets if they are webbing/scrams me. Just need to find proper measurements or reading of given icons on overview - if they are read already.

btw, I’ve started with sanderling 2018-04-04, not with Fuzzy’s older version. Unfortunately that version was quite buggy, but I gave me a lot of ideas how to achieve stuff for my needs :slight_smile:
And to be honest I’m not really able to figure out how to make debug version as VS is keep saying something about some embeded exe or what the hell… So I can’t really say what it is measuring wrongly when it happens :frowning:

use that,GitHub - botengine-de/A-Bot: EVE Online anomaly ratting bot based on the Sanderling framework, put your files, make some modifications and voilà :slight_smile:

one question: how you defined MenuEntryAlignToRegexPattern for warp?

(later) you can post the message from VS also, maybe you receive some help

probably found out why it is looping.
simply because my safe bookmark is on top of citadel not citadel itself as i did not wanted bot to dock up.

update :wink:

06:18:58 Combat 3415 from Sansha’s Dreadnought - Hits

Retreat when Dreadnought works… but probably next time will leave drones behind, cos he was able to lock me and shoot twice + neut before warp … close call :slight_smile:

in SaveShip.cs are those two constants

		const int AllowRoamSessionDurationMin = 60 * 7;

		const int AllowAnomalyEnterSessionDurationMin = AllowRoamSessionDurationMin + 60 * 7;

does it meant to be like 7mins of waiting time after neuts in system?, then it will dock up and then? it’s get reseted or?

i think is allow 7 sessions of 60 min. but Im not sur

yeah, not really sure what this bit of code doing cos in sanderling development tool i can see sessionduration always 1 000 000
whatever it means :confused:

btw I’ve tweaked Dread retreat → there was a need to introduce another retreat task, which works like:

  1. turn off ab/drones
  2. ignore anomaly with dread
  3. move to another anomaly

because simple retreat as in A-Bot code cause looping between docking and warping to site where dread already is :slight_smile:

So in the meantime trying to figure out how to deal with external config as variables, I’ve made fully working officer (can be customized by Variables.FactionSpawn) looting task. In Bot.cs you need to add setCommanderWreck and CommanderWreck indeed as well

This is only task which sits outside of anything, it’s called from combat.cs when fight is over . Remember we do not want to go to loot it if there is any rats on grid!
I’m using bot.CommaderWreck true/false to determine in combat.cs if we are staying on finished anomaly or we are moving to new one. So do your tweaks to that task as you need.

here you go:

namespace Sanderling.ABot.Bot.Task
{
	public class LootWreck : IBotTask
	{
		public Bot bot;

		public IEnumerable<IBotTask> Component
		{
			get
			{
				var memoryMeasurementAtTime = bot?.MemoryMeasurementAtTime;
				var memoryMeasurementAccu = bot?.MemoryMeasurementAccu;
				var memoryMeasurement = memoryMeasurementAtTime?.Value;

				var OverviewTabActive = memoryMeasurement?.WindowOverview?.FirstOrDefault()?.PresetTab?.OrderByDescending(tab => tab?.LabelColorOpacityMilli ?? 1500)?.FirstOrDefault();
				var OverviewTabLoot = memoryMeasurement?.WindowOverview?.FirstOrDefault()?.PresetTab?.Where(tab => tab?.Label.Text.RegexMatchSuccess(Variables.OverviewTabLoot) ?? false).FirstOrDefault();

				var propmod = memoryMeasurementAccu?.ShipUiModule?.Where(module => module?.TooltipLast?.Value?.IsAfterburner ?? false);

				// switch tabs for wrecks
				if (OverviewTabLoot != OverviewTabActive)
					yield return new BotTask { Effects = new[] { OverviewTabLoot?.MouseClick(MouseButtonIdEnum.Left), } };

				var listOverviewCommanderWreck = memoryMeasurement?.WindowOverview?.FirstOrDefault()?.ListView?.Entry?.Where(entry => entry?.Name?.RegexMatchSuccessIgnoreCase(Variables.FactionSpawn) ?? true).ToList().FirstOrDefault();

				// if there is a officer wreck -> loot it
				if (listOverviewCommanderWreck != null)
				{
					bot?.SetCommanderWreck(true);

					var isApproaching = memoryMeasurement?.ShipUi?.Indication?.LabelText?.Any(text => text?.Text?.RegexMatchSuccess("approaching", System.Text.RegularExpressions.RegexOptions.IgnoreCase) ?? false) ?? false;
					var WindowInventory = memoryMeasurement?.WindowInventory?.FirstOrDefault(w => (w?.Caption.RegexMatchSuccessIgnoreCase("inventory") ?? false));
					var LootButton = memoryMeasurement?.WindowInventory?[0]?.ButtonText?.FirstOrDefault(text => text.Text.RegexMatchSuccessIgnoreCase("Loot All"));
					var ApproachDistance = listOverviewCommanderWreck.DistanceMin;

					if ((isApproaching == false) && (ApproachDistance > 2000))
						yield return listOverviewCommanderWreck.ClickMenuEntryByRegexPattern(bot, "open cargo");

					if ((isApproaching == true) && (ApproachDistance < 12000))
						yield return bot?.DeactivateModule(propmod);

					if (LootButton != null)
					{
						yield return bot?.DeactivateModule(propmod);
						yield return new BotTask { Effects = new[] { LootButton?.MouseClick(MouseButtonIdEnum.Left), } };
					}
				}
				else
				{
					bot?.SetCommanderWreck(false);
				}
			}
		}

		public IEnumerable<MotionParam> Effects => null;

	}
}

enjoy

note: on your wreck tab you have to configure visibility of empty wrecks to none, otherwise bot will loop endlessly trying to loot empty wreck :slight_smile:

1 Like

was anybody looking into the

		static public int AttackPriorityIndexForOverviewEntryEWar(IEnumerable<EWarTypeEnum> setEWar)

and code around it?

From my understanding of the current code, it will take into consideration ewars and based on code in combat.cs

				var listOverviewEntryToAttack =
					  memoryMeasurement?.WindowOverview?.FirstOrDefault()?.ListView?.Entry?.Where(entry => entry?.MainIcon?.Color?.IsRed() ?? false)
					  ?.OrderBy(entry => bot.AttackPriorityIndex(entry))
					  ?.OrderBy(entry => entry?.Name?.RegexMatchSuccessIgnoreCase(@"coreli|centi|alvi|pithi|corpii|gistii"))				//Frigate
					  ?.OrderBy(entry => entry?.Name?.RegexMatchSuccessIgnoreCase(@"corelior|centior|alvior|pithior|corpior|gistior"))		//Destroyer
					  ?.OrderBy(entry => entry?.Name?.RegexMatchSuccessIgnoreCase(@"corelum|centum|alvum|pithum|corpum|gistum"))			//Cruiser
					  ?.OrderBy(entry => entry?.Name?.RegexMatchSuccessIgnoreCase(@"corelatis|centatis|alvatis|pithatis|copatis|gistatis")) //Battlecruiser
					  ?.OrderBy(entry => entry?.Name?.RegexMatchSuccessIgnoreCase(@"core\s|centus|alvus|pith\s|corpus|gist\s"))				//Battleship
					  ?.ThenBy(entry => entry?.DistanceMax ?? int.MaxValue)
					  ?.ToArray();

it will properly order targets, but when locking time on frigats/battleships etc. differs some of the targets are targeted BEFORE ewartargets.
And from the code I don’t see any fuction which will force bot to switch targets to priority ones once there is already targeting queue.

I don’t want to reinvent wheel here, so if anybody was solving it → can you share your bits here? appreciated.

Otherwise I’ll do it later on :slight_smile:

ok, nwm I’ve done it like that:
1.select proper target
2.force drones to switch

					if (targetSelected != listOverviewEntryToAttack.FirstOrDefault())
					{
						yield return new LockTarget { target = overviewEntryLockTarget };
						yield return new BotTask { Effects = new[] { VirtualKeyCode.VK_F.KeyboardPress(), } };
					}

works as needed, so bot is switching targets regarding prioritylist no matter what :wink:

the thing with ewar is a little tricky…
Normally you ( like a humain) do that:
take the frigs,but if these are too far, you take whatever is closer
If you have one lost potential ewar ship, you unlock ( if you are full) and lock the ewar ship.
Again, the distance could play a role…

i worked a little over these things, but is alot of code.
also, the distance fuck up the things.

The only way around all this , in my opinion is;
if you do forsaken, then you put your drones on passive and erase the line with distance. :slight_smile: . Also, you move the line with prioriyindex to last position. It seems illogical, but actually in the stock pile of datas, the last ones is on the surface ( i cannot explain better) so, ewar it take priority.
The second thing is you will take first the frigates, or actually the ewar ship ( because of waves) and the distance will not interfere. So, everything will rest in the timing for locking the rats. You can increase your signature analysys but also you can change another line; the one with number of maximum targets.
You modify that accordingly with your time for locking targets. I modify that at 2 and the bot stops exactly after i have 4 targets ( the number of frigates /ewar)

If you do haven or other anomaly, put your drones in agressive mode. it will fuck up a litle your cycles, but if you take a dampering sensors from 4 ships, your distance for targeting will decrease at 15-20 km,

The other work around is to make a new … something ( dunno what) with the ewar icons in overview and put a condition like:
if shipui is jammed compare the target selected with the overview rows with ewar right icon . If the target selected has right icon, then shoot, else unlock ( i tried like that but actually didnt work so i found the trick with distance)