My code
WindowChatChannel chatLocal =>
Sanderling.MemoryMeasurementParsed?.Value?.WindowChatChannel
?.FirstOrDefault(windowChat => windowChat?.Caption?.RegexMatchSuccessIgnoreCase(“local”) ?? false);
// assuming that own character is always visible in local
bool hostileOrNeutralsInLocal => 1 != chatLocal?.ParticipantView?.Entry?.Count(IsNeutralOrEnemy);
bool IsNeutralOrEnemy(IChatParticipantEntry participantEntry) =>
!(participantEntry?.FlagIcon?.Any(flagIcon =>
new { “good standing”, “excellent standing”, “Pilot is in your (fleet|corporation)”, }
.Any(goodStandingText =>
flagIcon?.HintText?.RegexMatchSuccessIgnoreCase(goodStandingText) ?? false)) ?? false);var Measurement = Sanderling?.MemoryMeasurementParsed?.Value;
var ManeuverType = Measurement?.ShipUi?.Indication?.ManeuverType;
while(true)
{
if(ShipManeuverTypeEnum.Warp == ManeuverType ||
ShipManeuverTypeEnum.Jump == ManeuverType)
goto loop; // do nothing while warping or jumping.
if (hostileOrNeutralsInLocal == true){
var WPAP = Measurement?.WindowPeopleAndPlaces[0]?.LabelText;
string pattern = “base”;
int i = 0;
for (i = 0; i < WPAP.Count(); i++){
Match m = Regex.Match(WPAP.ToArray()[i].Text, pattern, RegexOptions.IgnoreCase);
if (m.Length > 1){
break;
}
}
Host.Log(WPAP.ToArray()[i].Text);
Host.Log(WPAP.ToArray()[i]);
Sanderling.MouseClickRight(WPAP.ToArray()[i]);
Host.Delay(1000);pattern = “Warp Squad to Location Within 0 m”;
i = 0;
Host.Log(Measurement.Menu);
if (Measurement.Menu != null){
var menu = Measurement.Menu.ToArray()[0].Entry;
for (i = 0; i < menu.Count(); i++){
Match m = Regex.Match(menu.ToArray()[i].Text, pattern, RegexOptions.IgnoreCase);
if (m.Length > 1){
break;
}
}
Sanderling.MouseClickRight(menu.ToArray()[i]);
}
}
loop:
// wait for four seconds before repeating.
Host.Delay(3000);
// make sure new measurement will be taken.
Sanderling.InvalidateMeasurement();
}