There is a way to Mouse Click on Entry without clicking on info button

if I understand your issue correctly, you want to prevent bot to click on the “i” icon on some entries, because as he is randomly selects where to click sometimes he hit little i and therefore entry is not clicked.

is that what are you asking for?

1 Like

Yes! Exactly​:unicorn::unicorn::unicorn::unicorn::unicorn::unicorn::unicorn::unicorn::unicorn::unicorn::unicorn::unicorn::unicorn::unicorn:

For now I dont know how I can use Mouse Click Left or some things like that to select an area to click on a entry.

well, I dont think is easily doable, cos those little “i” are pictures and test if it was on it or not would be painful.
What you can do instead is add whatever window will open from that “i” to your window-closing-method so if opened it will be closed automatically, and since element was not clicked, bot will repeat self and most likely will not hit “i” twice in a row :slight_smile:

I dont realy want to know if there is a info icon. Maby I can just suppose there are alwais here. So that I just click on entry without a region. I thing that if the were a parameter for mouse click to restrain a certain region it will do the job.

Exemple: We know the region of an entry. So we can pass a or some parameter that reduce by x,y,z,t the maximum of where the mouse click on height and length…

Yes, you can supply the API it a smaller region to click on, using the parameter called RegionReplacement.

There is a code example of how to reduce the size of the region on the right side, so this should cover the case of the info icon. You can find the code at

2 Likes

When I use it, nothing appen, that is there is no mouse mouve.

This is how I use it.

I see only an image there but I does not even seem to show the complete script.

What script did you use? When I have the complete script, I can take a look at that.

using BotSharp.ToScript.Extension;
using Parse = Sanderling.Parse;
using Bib3.Geometrik;

Sanderling.Interface.MemoryStruct.WindowRegionalMarket Market => Measurement?.WindowRegionalMarket?.FirstOrDefault();

static MotionParam MouseClickWithRegionSubstituted(IUIElement destination, RectInt region, MouseButtonIdEnum mouseButton,	int repetitionCount = 0) =>
	new MotionParam
	{
		MouseListWaypoint = new[] { new MotionParamMouseRegion { UIElement = destination, RegionReplacement = region, } },
		MouseButton = new[] { mouseButton },
		MouseButtonRepetitionCount = repetitionCount,
	};
	
static MotionParam MouseClickWithRegionReducedByTenOnTheRight(IUIElement destination, MouseButtonIdEnum mouseButton, int repetitionCount = 0) =>
	MouseClickWithRegionSubstituted(destination, RectInt.FromMinPointAndMaxPoint(destination.Region.MinPoint(), new Vektor2DInt(destination.Region.Max0 - 10, destination.Region.Max1)),	mouseButton,repetitionCount);

while(true)
{
	MouseClickWithRegionReducedByTenOnTheRight(Market?.MyOrders?.SellOrderView?.Entry?.ElementAtOrDefault(0), MouseButtonIdEnum.Left, 0);
	Host.Delay(1000);
}

To work properly, it should have an entry in my sell orders on the market.

The IDE shows me two errors in that code, so there is information about what errors there are and where in the code.

Does the IDE not show the descriptions of the errors in your case?
Does it not show the errors locations?

Sanderling.Parse.IMemoryMeasurement	Measurement	=>	Sanderling?.MemoryMeasurementParsed?.Value;

Oui, il manque cette ligne avant la variable Market. Pour une raison que j’ignore un mauvais caractère s’est glissé lors de la copie( après l’égalité), c’est une flèche vers la droite. Et ça marche toujours pas.

il manque ( ou c’est correct de ce maniere)

Sanderling.Parse.IMemoryMeasurement Measurement =>
    Sanderling?.MemoryMeasurementParsed?.Value;
Sanderling.Interface.MemoryStruct.WindowRegionalMarket Market = Measurement?.WindowRegionalMarket?.FirstOrDefault();

ou pour measurer ( evaluer et utiliser directement) var x = Market?.(qqch => qqch?.Text … par example)

Sanderling.Parse.IMemoryMeasurement Measurement =>
    Sanderling?.MemoryMeasurementParsed?.Value;
Sanderling.Interface.MemoryStruct.WindowRegionalMarket Market =>
Measurement?.WindowRegionalMarket?.FirstOrDefault();

The last block code is the right way!

:slight_smile: je sais, mais bon …

1 Like

@Viir is it possible with custom region replacement to replace only source region but not destination region while DragDrop?

I’m testing this:

		static public MotionParam MouseDragAndDropOnCustomRegion(
			this IUIElement elementToDrag,
			IUIElement destination,
			RectInt region,
			MouseButtonIdEnum mouseButton) =>
			new MotionParam
			{
				MouseListWaypoint = new[] { elementToDrag, destination }.Select(uIElement => new MotionParamMouseRegion() { UIElement = uIElement, RegionReplacement = region })?.ToArray(),
				MouseButton = new[] { mouseButton },
			};

but obviously with this call:

var region = RectInt.FromMinPointAndMaxPoint(new Vektor2DInt(20, 20), new Vektor2DInt(100, 40));
return testwindow?.MouseDragAndDropOnCustomRegion(testdesto, region, MouseButtonIdEnum.Left);

it’s correctly changing region on testwindow but as well on testdesto, which is not wanted. I guess
"RegionReplacement " works for both, is there any other option?

Thanks!

Yes: The source region is the first element you pass into the parameter MouseListWaypoint. So you want to only replace the region for this first element in this list, not the other ones.

I have adapted this to replace only the source region:

static public MotionParam MouseDragAndDropFromCustomRegion(
	this IUIElement originElement,
	RectInt originRegion,
	IUIElement destination,
	MouseButtonIdEnum mouseButton) =>
	new MotionParam
	{
		MouseListWaypoint = new[] { new MotionParamMouseRegion() { UIElement = originElement, RegionReplacement = originRegion }, new MotionParamMouseRegion() { UIElement = destination }},
		MouseButton = new[] { mouseButton },
	};

CCP broke their EVE Launcher, so not tested live.

1 Like

works perfectly, thanks!

@viir one more question about regions

How they are defined? eg. are they absolute to eve screen or relative to something?

because when we take example of the InfoPanelCurrentSystem (blue on image), it has got min max 32,71,344,99 (when folded) and it kind of correlate with pixels counted from 0,0 without Neocom panel - so I guess they are relative to left top corner without Neocom?

if I try to substitute it with

var region = RectInt.FromMinPointAndMaxPoint(Header.Region.MinPoint(), new Vektor2DInt(100, 99));
yield return Header?.MouseDragAndDropFromCustomRegion(region, Desto, MouseButtonIdEnum.Left);

I’m kind of expecting to be in same region but shorder by 244 pixels.
But in reality I will end up somewhere else, more like around Route marker.

So then I was thinking to try something simple, like

var region = RectInt.FromMinPointAndMaxPoint(new Vektor2DInt(0,0), new Vektor2DInt(20,20));

But that sent mousecursor roughly to red area on sample picture, which is unexpected as my thoughts was cursor will be at left top corner in square 0,0 20,20

Am I missing something from rect definition?
Thanks

tempsnip

I am looking at the API now and I find multiple types of regions:

MemoryStruct.UIElement.Region

To find the definition, I am looking for assignments to the UIElement.Region property in the memory reading source code.
Here I find the following candidate which looks most promising to me for now:

Following the code in FläceAusGbsAstInfoMitVonParentErbe, I guess it is an aggregation of offsets of all parent nodes. But your post looks you are more interested in RegionReplacement so I will prioritize that now.

Sanderling.Motor.MotionParamMouseRegion.RegionReplacement

To find the definition of RegionReplacement I look in the source code for applying the effects to the EVE Online client, and find this:

Reading this code, it seems like: RegionReplacement is defined relative to the coordinate system used by UIElement.Region, which you seem to have a definition for already:

The difference I see in this code is that the RegionReplacement has another offset. It is centered at the original Region of the UIElement. In other words, when you specify a RegionReplacement centered at (0,0), it should come out having the same center at the UIElement.Region.
Is this model consistent with your observations?

Maybe it would be better if the Region would remain the same when the Region is used as RegionReplacement :thinking:

thanks for comprehensive answer @Viir :wink:

my observation with replacements are different, I did expected two variations would happen
a] replacement region works from left-top corner of EVE screen
b] replacement region work from lett-top of given UI element.

Unfortunately on given example I’m for some very unknown reason able to hit correct area-ish only when my offset looks like this

var region = RectInt.FromMinPointAndMaxPoint(new Vektor2DInt(-110,-20), new Vektor2DInt(-70,0));
yield return Header?.MouseDragAndDropFromCustomRegion(region, desto, MouseButtonIdEnum.Left);


static public MotionParam MouseDragAndDropFromCustomRegion(
	this IUIElement originElement,
	RectInt originRegion,
	IUIElement destination,
	MouseButtonIdEnum mouseButton) =>
	new MotionParam
	{
		MouseListWaypoint = new[] { new MotionParamMouseRegion() { UIElement = originElement, RegionReplacement = originRegion }, new MotionParamMouseRegion() { UIElement = destination }},
		MouseButton = new[] { mouseButton },
	};

That’s why I’m more curious about how this is even possible :slight_smile: eg. regionreplacement seems to be working outside given UIElement region and on top of it with strange offset.
Would be great if you or somebody can verify it on different code or region