Checking a Status of an Object

sanderling

#1

Hi all,

I want to check on the status of a lock on a particular object. Is there a way to do that? And more generically would we be able to check on other states like some of the guys do for ewar etc.?


#2

I suppose you talk about locked containers … I don’t things so, but you can look at the measurement on the windowother with the container/locker/password window open ( I suppose is a window there).
what states are you talking? ewar is a component, in the overview, you have a right positioned icon, under shipui hud you have an icon and message ( text, you are web-ed)

enemy citadels have a red background, players are the same. Flying is a state, warping is a state, orbiting is a state, docked is a state; and yes you have all that.
the weapons have their state. working ( rampage) or not; glowing or not
the lvl of your armor is a state, you speed is a state and yes, with some maths you have all that.
if a player have good/bad standings with you or an ally/corp/fleet is a state.
And yes again, you have all that.
All these states are chained and checked and result in a set of commands. You can see the examples on https://forum.botengine.org/c/bot-catalog
I suggest you start with a sample included in Sanderling at https://github.com/Arcitectus/Sanderling/releases and if you advance fast you can adapt or create your own bot .
Or, from start, you can search on the forum to find other sources on git and modify at your needs. There are plenty of ways to learn, the code is here and there or grouped in some topics


#3

Yes, you can check this with the property MeTargeted on the overview entry from the parsed memory measurement. Here is an example with a full path:

bool IsParticularObject(Parse.IOverviewEntry entryInOverview) => entryInOverview?.MainIconIsRed ?? false;

var isParticularObjectLocked = Sanderling.MemoryMeasurementParsed?.Value?.WindowOverview?.FirstOrDefault()?.ListView?.Entry?.FirstOrDefault(IsParticularObject)?.MeTargeted ?? false;

To check the ewar, use the property EWarType on the same object:

var ewarTypesUsedByParticularObjectLocked = Sanderling.MemoryMeasurementParsed?.Value?.WindowOverview?.FirstOrDefault()?.ListView?.Entry?.FirstOrDefault(IsParticularObject)?.EWarType;

For a list of other properties, see:

And the lower level properties:


#4

Thank Viir, is there a way to check if the drones are attacking the object?


#5

yes, if the drones are attacking, then somewhere on the screen is a text: fighting. in red . If not, there is a text in green , idle…
You can use any of statements


#6

Thx. I didn’t think of that.


#7

that will not tell you if drones are attacking object you want
that tells you only if they are attacking something, and if they are set as aggressive, they will be shooting bigger targets first

what you wanna do is something like

						if (targetIWantLocked == null)
						{
							yield return new LockTarget { target = target };
						}
						else if (targetIWantAttack == null)
						{
							yield return new BotTask { Effects = new[] { targetIWantAttack .FirstOrDefault().MouseClick(MouseButtonIdEnum.Left), } };
						}
						else
						{
							yield return new BotTask { Effects = new[] { VirtualKeyCode.VK_F.KeyboardPress(), } };
						}

what this does is:

  1. check if target i want is locked if not, locking
  2. check if target i want is selected, if not, click it
  3. sent drones no matter what they are attacking now

#8

Thanks pikacuq, the problem I am trying to avoid is issuing an attack command to the drones if they are already attacking the target. This can be an easy way to identify a bot.


#9

all you need is this

					var droneInLocalSpaceIdle = droneInLocalSpaceSetStatus?.Any(droneStatus => droneStatus.RegexMatchSuccessIgnoreCase("idle")) ?? false;

					if (droneInLocalSpaceIdle && NPCtargeted > 0)
						yield return new BotTask { Effects = new[] { VirtualKeyCode.VK_F.KeyboardPress(), } };