Manually telling Sanderling what modules you have

Hi I was wondering if there was a way to manually tell Sanderling what modules you have as tool tip reading seems to go wrong quite a lot?

I have tried this but keep getting errors .

// Keep measuring tooltips until moduleMiner = MiningLasers
var MiningLasers = 2;
var moduleMiner = SetModuleMiner?.FirstOrDefault();

if (!(MiningLasers == moduleMiner))
{
ModuleMeasureAllTooltip();
}

Ok I think I got it now.

// Keep measuring tooltips until moduleMiner = MiningLasers
if (!(MiningLasers == SetModuleMiner?.Length))
{
ModuleMeasureAllTooltip();
}

Please let me know if this is wrong but i think its working.

Edit: I have changed the if to while not sure if thats the correct thing to do.

// Keep measuring tooltips until moduleMiner = MiningLasers
while(!(MiningLasers == SetModuleMiner?.Length))
{
ModuleMeasureAllTooltip();
}

Ok changing to while was a bad move the if version was working but I needed to change the measure tooltips function too.I found the extra measure tooltips function in the The Mining Script of Without seems to do what I need Thanks Without. I am still testing as typically the bug is not happening now.
Anyway here’s all the code .

[code]// Keep measuring tooltips until moduleMiner = MiningLasers
var MiningLasers = 2;

if (!(MiningLasers == SetModuleMiner?.Length))
{
ModuleMeasureAllTooltip();
}

void ModuleMeasureAllTooltip()
{
Host.Log(“measure tooltips of all modules.”);

for (int i = 0; i < Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule?.Count(); ++i)
{
    var NextModule = Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule?.ElementAtOrDefault(i);
   
    Host.Log("measure module.");
    // take multiple measurements of module tooltip to reduce risk to keep bad read tooltip.
    Sanderling.MouseMove(NextModule);
    Sanderling.WaitForMeasurement();
    Sanderling.MouseMove(NextModule);
}

}
[/code]
Not bad for someone that can’t code C.

Tested and definitely working when measure tooltips bugs out this code will try again for you till measure tooltips works correctly .

1 Like