I am interested in finding/building a script to scrape a region for the Industry Index in eaxh system (ADM), down to the specific percentage value. I have not found a existing solution and am also lacking a way to start solving this. Maybe someone here can point me in the right direction (tools to use etc.)
In this case, you can start with taking a screenshot which contains the information the information that should be read. We can take a look at that then.
Regarding tools: paint.net is good because it makes anotating screenshots with distinct image layers easy.
Thank you for the welcome @Viir
I assumed people know the ADM Industry Index and where to find it. Best would be to give the script a list with System names (if done via ingame Notepad it is a link that can be clicked) after navigating to the correct window it will look like this.
The important part is that the mouse now needs to hover over the rightmost partially filled in rectangle. Then this pops up.
This is the important information we are after and want to record over time.
on the actual version of Sanderling, we don’t have this kind of information( to move the mouse over this rectangles)
you have 2 options:
to create/extend some regions on same row with the text
to add this measurements ( with white rectangles/gray rectangles) to Sanderling
to use Sprite color and Id of texture old, if you can
For sure there are people around who know more about the the ADM Industry Index than I do.
This looks like the region to move the mouse to is always at a fixed location relative to the lower right corner of a window. In this case you can use the title of the window (seems to be cropped away in the image you posted) to select the correct window.
I think there is a good chance that this popup window is already contained in the memory measurement which is read by the Sanderling memory reading. We can look for it in the API explorer.
One important point regarding tools: To share screenshots and other images, imgur.com works well.
Thank you for the good responses. The Problem might still be, that the important rectangle is not always in the same place. Sometimes it will be the first, sometimes the second,third… Also I never tried working with sanderlings. Can someone point me to a good point/guide to start?
How can we find out where it is? How can you do that based on a screenshot?
In your screenshot, I see that a text Industry Index appears on the row you marked. Can we use that label as a reference for the vertical location of the region to move the mouse to?
maybe it is best to record the readout of every rectangle and stop whenever a “%” is shown. E.g. If a System has Level 3 30% it will read “Level 1” on the first “Level 2” on the second “Level 3 30%” on the third and “Level 4” on the fourth.
I found this script to implement this scraping process:
/*
https://forum.botlab.org/t/industry-index-scrape/2313/8
record the readout of every rectangle and stop whenever a “%” is shown.
E.g. If a System has Level 3 30% it will read “Level 1” on the first “Level 2” on the second “Level 3 30%” on the third and “Level 4” on the fourth.
*/
int rowHeight =20;
int rowCount = 7;
bool skipMouseMove = false;
int nextRowIndex = 0;
while(true)
{
if(skipMouseMove)
{
Host.Log("Skip mouse move.");
goto logTooltip;
}
Host.Delay(3000);
Sanderling.InvalidateMeasurement();
var window = Sanderling?.MemoryMeasurementParsed?.Value?.WindowOther?.FirstOrDefault();
if(window == null)
{
Host.Log("No window found in the WindowOther collection.");
continue;
}
Host.Log("The window has the caption '" + window.Caption + "'");
var windowRegionRight = window.Region.Max0;
var windowRegionBottom = window.Region.Max1;
Host.Log("Window region right=" + windowRegionRight + ", bottom=" + windowRegionBottom);
var nextRowVerticalCenter = windowRegionBottom - rowHeight * (nextRowIndex + 1);
var regionToMoveMouseTo = new RectInt(windowRegionRight - 50, nextRowVerticalCenter - 4, windowRegionRight - 30, nextRowVerticalCenter+ 4);
Host.Log("nextRowIndex is " + nextRowIndex + ", moving the mouse to " + regionToMoveMouseTo);
Sanderling.MotionExecute(MouseMoveWithRegionSubstituted(window, regionToMoveMouseTo));
// Sanderling.MotionExecute(window.WithRegion(regionToMoveMouseTo).MouseMove());
nextRowIndex = (nextRowIndex + 1) % rowCount;
// After moving the mouse, give EVE Online client some time to open the tooltip.
Host.Delay(1111);
logTooltip:
Sanderling.InvalidateMeasurement();
var tooltip = Sanderling?.MemoryMeasurementParsed?.Value?.Tooltip;
var allTooltipUIElements = tooltip?.EnumerateReferencedUIElementTransitive().ToList();
Host.Log("allTooltipUIElements : " + String.Join(",", (IEnumerable<IUIElement>)allTooltipUIElements ?? new IUIElement[0]));
var allTooltipTexts = allTooltipUIElements?.OfType<UIElementText>().Select(textElement => textElement.Text).ToList();
Host.Log("allTooltipTexts : " + String.Join(", ", (IEnumerable<string>)allTooltipTexts ?? new string[0]));
}
// Based on the example from https://forum.botlab.org/t/click-on-specific-smaller-region-maxx-10/194/4
static MotionParam MouseMoveWithRegionSubstituted(
IUIElement destination,
RectInt region) =>
new MotionParam
{
MouseListWaypoint = new[] { new MotionParamMouseRegion { UIElement = destination, RegionReplacementAbsolute = region, } },
};
I just came back to this idea after a “little” break . I spent the last couple of hours diving into Rdwrapper, Sanderling and the botengine and most seems to be working fine.
I’m a little confused with where to start. Should I write this as a Sanderling Script or as a Botengine app. I also could not find new versions of the sanderling.exe, has that been discontinued?
This time I cleared the coming days for this project and am determined to finish this, hopefully with some help from the forum.
I recommend the later. No idea if anyone still uses the older method.
You can still use that if you want to. However, most people developing for EVE Online now use the framework that was introduced last year and does not require a Sanderling.exe.
To inspect the contents of the user interface of the 64-bit game client, we use the tools contained in the alternate UI for EVE Online: