Pikacuq is tweaking A-Bot :)

If I’m not mistaken, I also mentioned the need to expand this ShipManeuverTypeEnum. Then the problem was solved as suggested by the kaboonus: by the caption.

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

if (!isAligning)
{
	yield return new MenuPathTask
	{
		RootUIElement = memoryMeasurement?.InfoPanelCurrentSystem?.ListSurroundingsButton,
		Bot = Bot,
		ListMenuListPriorityEntryRegexPattern = new[] { new[] { retreatBookmark }, new[] { @"align", ParseStatic.MenuEntryWarpToAtLeafRegexPattern } },
	};
}

Offtop: guys, read this thread.

1 Like

Yes , you mentioned in one post , but for personal use, i don’t “stick” nothing to align state .

My problem for now is to wait in haven anomaly to populate… you have any idea?

donne with highlight the code. Thank you

yep kaboonus, i do have very similar code as test one… but it’s very long process as it is always waits for the end. So what i’m trying to tweak, is more parallel approach eg.

click on prop, align, retreat drones, check if all stuff was done.

:wink:


another thing. I’m not sure how and when exactly, but it seems like sometimes bot after retreat is not able to continue when local is clear. He keeps clicking on infopanelwindow, hovering usually around anomalies submenu. When I physically push escape (to get rid of that menu) bot continue just fine then.
Any idea why it might happen?

hmmmmmm the normal behavior is:
check for local ( save ship and he take the standigs from parse extention)
… ( here you can insert some tasks: align, turnoff ab; call drones)
retreat task: warp - dock to home ( btw, what code you use for warping, i know you changed-him)

-so if you changed the code and you warp directly from saveship? i use that, but to another safespot and after that i call retreat.cs to dock.

if you use warp to 0 ( any method)and after that retreat near station ( warpmenu enumerated) is normal, because the menu is changed ( first is aproach and second is dock, but is an ordinaire menu). So, he try to find warpmenu.
or maybe somewhere you have a loop or condition ( IF…) because if the local become clean, normally, he must enter in anomalytask so he must try to click right on anomaly and warp at 50.
Hovering around anomalies means you:
1 he try to ignore anomaly ( but he cant so he push … save. this is a bug from anomaly, you cant avoid him ( actually yes, you can but… normally is too rare) . ALso he can try to find the one with km :slight_smile: maybe… because near you you have a blue/green and thats because maybe you are in combat mode ( so that means you have some rats and you are near stargate)

So, a good home is: far from any stargate, use a home unused by others ( because he sees them like an ocupied place)
In my opinion, because i strugled with sames troubles:
revise your code; put some conditions to enter in combat mode :

				var Anchor = memoryMeasurement?.WindowOverview?.FirstOrDefault()?.ListView?.Entry
				?.Where(entry => entry?.Name?.RegexMatchSuccessIgnoreCase("broken|pirate gate") ?? false)
				?.OrderBy(entry => entry?.DistanceMax ?? int.MaxValue)
				?.ToList();
 if ((listOverviewEntryToAttack.Count() > 0)  && (Anchor.Count > 0))
start fight

look if you can enter in skipanomaly even if you are not in anomaly ( i have condition: blue, greens, AND anchor to enter in skip anomaly ) So if Im near station, the anchor is not there :d => he enter in normal anomaly enter
Also you can change broken/pirate gate with chemical factory to avoid haven gas :wink: and take out the rats from stargates in overview.
The is another possibility for all this behavior, because he call saveship and after that retreat.cs from inside the combat file ( I think). and that means he doesn’t get out from loop. Again, rats/blues are the reason for that. And again, my anchor var could resolve your trouble, because you enter in combat file only if the anchor is present

ah, so bot thinks SAFE is occupied when there is somebody else? than it kind of make sense he is in loop. Strange, was not really expecting something like that in the code. Have to have a look.

Nope am not warping from saveship, am warping from retreat as i should.
Thing is tho, that bot waits till module stops blinking red, bot waits till drones are in bay etc. to proceed to another task… but in real life, you pres SHIFT+R, disable AB and Align in basically same time. So this is something I want to achieve, but currently without much luck, but am trying :slight_smile:

My idea is to push shortcuts for module where AB sits and for drones in one step. But I’m kind of strugling with fact, that bot keeps pushing that key more than once eg. stopping and starting AB continously. In terms of drones it does not matter, but module is a problem. Kind of can’t figure out how in C# can I run code just once properly. :slight_smile:

That anchor var is pretty clever. Would you be so kind and shared with me your combat and retreat? :wink:

my retreat is the usual one ( except off abot, to be sure, i work all on shipsave.
:slight_smile:
my combat is on development all time, is more green from too many /* */ and // :slight_smile: but i will share parts of him with explanations in Avoiding to struggle - a guide for beginers - #2 by kaboonus
Im more interested how you tweaked the warp line, from the beginning of our discussion.

you cant push all of them in same time that’s work for me Pikacuq is tweaking A-Bot :) - #11 by kaboonus but after that i put them all together … because I fly ships without drones. Also i warp from saveship to an safespot, just because some of reds just passing ( and is enough for me to be in warp before they get out from system and in the end i call retreat task

well you can push as many of buttons you want at same time, that’s not an issue.
Issue is (which am currently struggling with) that code is executing this class over and over again. What I need is to execute it only once and then continue to warpin.

I know that it is solvable with some conditions, issue is, that those conditions - like “check if drones are back” or “check if module is not active” takes quite a long time eg. I dont want to wait to my drones to proceed to another task, they can be returing whils bot is doing another tasks.

which part you are interested in? this is my work-in-progress code around aligning/warping/saving drones.
only “issue” now is that disabling propmod is in my opinion slowest part, because it is simply waiting for module to stop glowing red. Better option will be just push shortcut key, but have no yet idea how to push it just once :slight_smile:

				// step 1 align + first call of drones
				if (ShipManeuverStatus == ShipManeuverTypeEnum.Orbit)
				{
					yield return new BotTask //return to bay drone
					{
						Effects = new[] { MotionParamExtension.KeyboardPressCombined(new[] { VirtualKeyCode.VK_R }) }
					};

					yield return new MenuPathTask
					{
						RootUIElement = memoryMeasurement?.InfoPanelCurrentSystem?.ListSurroundingsButton,
						Bot = Bot,
						ListMenuListPriorityEntryRegexPattern = new[] { new[] { retreatBookmark }, new[] { @"align", ParseStatic.MenuEntryAlignToRegexPattern } },
					};
				}
				// step 2 check if propmod is on and deactivate it
				yield return Bot?.DeactivateModule(setPropmod); //DEACTIVATE AF/MWD

				// step 3 recall drones if they are still in space
				if (0 < droneInLocalSpaceCount)
				{
					yield return droneGroupInLocalSpace.ClickMenuEntryByRegexPattern(Bot, @"return.*bay");
				}

				// step 4 warp to safe
				yield return new MenuPathTask
				{
					RootUIElement = memoryMeasurement?.InfoPanelCurrentSystem?.ListSurroundingsButton,
					Bot = Bot,
					ListMenuListPriorityEntryRegexPattern = new[] { new[] { retreatBookmark }, new[] { @"dock", ParseStatic.MenuEntryWarpToAtLeafRegexPattern } },
				};

this ones are good, but before them you can put:

if (ab.IsActive(Bot) ?? true)
{
{
yield return Bot.DeactivateModule(aboff);
//yield return Bot.EnsureIsActive(armorRepairers);
};
yield return new BotTask //return to bay drone
{
Effects = new[] { MotionParamExtension.KeyboardPressCombined(new[] {
VirtualKeyCode.SHIFT, VirtualKeyCode.VK_R
}) }

};
yield return new MenuPathTask
{
RootUIElement = memoryMeasurement?.InfoPanelCurrentSystem?.ListSurroundingsButton,
Bot = Bot,
ListMenuListPriorityEntryRegexPattern = new[] { new[] { retreatBookmark }, new[] { @"align", ParseStatic.MenuEntryWarpToAtLeafRegexPattern } },
};
}

my trick is using 2 definitions for ab :d one for interogate the modul if is active ( not with glowing because he will wait, like you said) and one for deactivate. And I come with that simply because you cant have both in same definition of ab

         var ab = Bot?.MemoryMeasurementAccu?.ShipUiModule?.Where(m => m?.IsAfterburner(Bot) ?? false).FirstOrDefault();
                var aboff = Bot?.MemoryMeasurementAccu?.ShipUiModule?.Where(m => m?.TooltipLast?.Value?.IsAfterburner ?? false);

and also i deactivated the click left from tooltip module ( so he use only f1/f2/f3). You can try to use only the tooltip module variant and you will see you cant use If is active :)) so i made 2 definitions

interesting, where you have defined m?.IsAfterburner(Bot) ? this code of yours gives me an error there

m= module, you can replace. I have more definitions of module :slight_smile: ( maybe because of that i have errors sometime

well, still error. As I understand this code means you have somewhere defined what “IsAfterburner(Bot)” is because other var is referencing to ShipUI TooltipLast.Value which is defined just fine.

But first one is referencing to ShipUIModule.IsAfterburner which I dont have aparently :slight_smile:

in botextension.cs you have

		static public bool IsAfterburner(this Accumulation.IShipUiModule module, Bot bot) =>
				module?.TooltipLast?.Value?.TitleElementText()?.Text?.RegexMatchSuccessIgnoreCase("Afterburner") ?? false;

gotcha, thanks… anyway it is doing the same as my code …

literally clicks on AB and waits till it is fully off and then continue to retrieve of dones… crapy crap, something is wrong :slight_smile:

hmmmmmm mine is passing really fast to align, the AB is still glowing , i think… because i just see im aligning and ab is already off ( i fact i realize just im aligned and my drones return already) … maybe you have definition of Is active who include the glowing? I remember i deleted someting like that. I see in module I use only rampactive ( in sanderling this is false or true and is changing in instant) what is means is much faster than glowing and etc etc

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: