Today I back for you with a new question
I try to explain what Im doing, to “finish” all functions for my A-Bot for Capitals and Mothership I have to made a function can refill the fighters into squadron if they die
So atm in-game it’s possible do it ONLY from the fighter bay, the fighter bay widow is splitted in 2 section, fighter bay inventory and launch tubes (look the screenshot)
I made already the code to drag the fighters from fighter bay inventory to launch tube part, BUT the IUElement I take in consideration like destination is the “Ready” Text
So this is the movement my function do (look the screenshot)
Here the problem… the “Ready” pixels are not considerate part of “Tube’s Button” this mean my code drag the fighters from the inventory to “Ready” text and when he release them the tube not load them
So my solution was load the real “Ready” text region in a variable, modify them for position this region a little bit more down so the bot will not drag them on the string pixels (look the screenshot)
Here the test code I made:
var squad1_tube = _memoryMeasurement?.WindowInventory.FirstOrDefault().LabelText?.ElementAt(10);
var Squad1 = _memoryMeasurement.ShipUi.SquadronsUI.SetSquadron.FirstOrDefault().Squadron.Health;
squad1_tube = squad1_tube.WithRegion(new Bib3.Geometrik.RectInt(squad1_tube.Region.Min0 - 400, squad1_tube.Region.Min1 - 400, squad1_tube.Region.Max0 - 400, squad1_tube.Region.Max1 - 400));
if (Squad1.SquadronSizeCurrent < Squad1.SquadronSizeMax)
{
var fighterToDrag = _memoryMeasurement?.WindowInventory.FirstOrDefault().SelectedRightInventory?.ListView?.Entry.FirstOrDefault()?.SetSprite?.ElementAt(1);
yield return fighterToDrag.MouseDragAndDropOn(squad1_tube, MouseButtonIdEnum.Left);
}
Not look the fact I go to decrease “400” from every point, this was just a test…
Now I show you all this in execution:
Original Region Loaded from Memory:
Region Changed by My code and applied to the squad1_tube:
So… to here everything ok… buw then I go to execute:
yield return fighterToDrag.MouseDragAndDropOn(squad1_tube, MouseButtonIdEnum.Left);
the code go to release always on the original region…
Can you help me please?