Well my friends, before I start this topic I want to thank the help and collaboration of all the members, especially @kaboonus, @pikacuq and @Terpla, who have helped me significantly improve my BOT and add a series of implementations, so that it works the best it can for me.
Currently I’m at the end of my BOT <just fine-tuning the codes and correcting some small errors.
I created this topic in order to gather all the little questions that I have in doubt (since I’m not a good programmer) and who knows, someone with the right knowledge can help me.
My first question is this:
I implemented this code (adapted from @pikacuq) in my document:
It should call the RetreatTaskEmergency function when an ally enters my overview, however this is not happening …
The ally enters the overview and it continues executing the other codes in a normal way.
My other question, which I am trying to implement is that when my ship is destroyed (to be added to the pod), it goes to RetreatTask, some kind of module verification, if it does not have any, it will call this function. POD).
I kept the color of allies to make a test with my friends … I enter the anomaly, I start to execute it and I ask a friend to warp on me, so he appreciates in my overview nothing happens, I continue performing the anomaly of normal way, when in fact I should call the RetreatTaskEmergency function.
about your pod:, if the way used on my bot/script is too complicated, then use this:
var ShipType = WindowInventory?.LabelText?.FirstOrDefault(text => (text.Text?.RegexMatchSuccessIgnoreCase("Capsule") ?? true));
if (null != ShipType)
yield return new RetreatTask { Bot = bot };
all are not in saveship.cs but in combat.cs; Is better to have a saveship shorter , without many things inside, to be executed faster, so he can send the execution to retreat (warping)
var WindowInventory = memoryMeasurement?.WindowInventory?.FirstOrDefault();
var inventoryActiveShip = WindowInventory?.ActiveShipEntry;
var inventoryActiveShipEntry = WindowInventory?.ActiveShipEntry;
if (!(inventoryActiveShip?.IsSelected ?? false))
{
yield return new BotTask { Effects = new[] { inventoryActiveShip.MouseClick(BotEngine.Motor.MouseButtonIdEnum.Left) } };
}
also you have to be all time on inventory active ship and with inventory opened. The order of lines is not the one posted here, you have to put them on good positions ( first define the window, after that open inventory and clik on active ship)
now you have all I have on this subject on my old a-bot and is working; dunno if you have same things/definitions, because you use the weird a-bot