Help writing checks for mining script

2 things that are continually happening that are affecting the success rate of my sessions are:

  1. Bot changes / loses asteroids in range (usually because it has accidentally clicked / sorted them farthest to closest.

  2. some runs (mining locale <> Station) when the bot begins mining, it will only activate 1 laser.

If anyone is willing to help me write some checks to add to the script to prevent these situation or to rectify them after they happen, it would be greatly appreciated.

How many mining modules where recognized by the script in that case?

I’m not sure how to answer that… What value should I be looking for?

The included mining script writes this into the script log. You can also post the complete status log entry.

How do I pull the complete log?

In the directory log which is in the same directory as the sanderling executable you will find a log file for each script run.

Here are my 2 most recent error logs

Doesn’t look like there’s anything to do w/ the botting actions itself in that data…

Just happened on 1st cycle out in this session. I copied the bot log and added it onto the error log for htis one.

Hope it helps!

Your second problem was discussed on this forum several months ago. There is even code fragments that workaround it.
In short, reading of modules tooltips is not terribly reliable, so additional config variable was proposed with expected number of miners and tooltips are read until needed amount is found.

Have any links? I’ve tried searching the forums for a couple of time w/ what I thought were relative terms, but never found anything.

That file contains the following text:

mining modules (inactive): 1(0)

This means that one mining module was detected. So this brings us closer to why “it will only activate 1 laser” as you wrote.

It’s got to be the OCR/IR when it checks the modules when it’s warping.

My thought is to just circumvent, and just manually target / approach/ activate lasers.

Not sure why it doesn’t do this anyways, but if you ALWAYS make the object <10Km away, you can mine it w/ any laser out there…

so my though is to:

  1. check if there are any asteroids w/in 50Km (not sure how easy this is using the overview mining tab).
  2. check if you have an asteroid targeted, if not, target top one on mining list
  3. check distance to said asteroid
  4. if distance < 10K approach, check
  5. activate bot lasers 1 &2 via Fkeys (on same asteroid) when distance < 10Km.

i don’t see why the OCR/IR check for the laser modules is required…

Hmmm, can’t find it. Maybe it got deleted somehow.
Here’s how it’s in my script:

 // numbers of miners that tooltip scanning should find to not attempt to scan again
int MinMinersCount = 2;
void ModuleMeasureAllTooltip()
{
    int minersFound = Miners?.Length ?? 0;
    if (minersFound >= MinMinersCount) return;
    int modulesCount = Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule?.Count() ?? 0;
    for (int i = 0; i < modulesCount; i++)
    {
        var NextModule = Sanderling.MemoryMeasurementAccu?.Value?
            .ShipUiModule?.ElementAtOrDefault(i);

        //    take multiple measurements of module tooltip to reduce risk to keep bad read tooltip.
        Sanderling.MouseMove(NextModule);
        Host.Delay(1111);
        Sanderling.WaitForMeasurement();
        Sanderling.MouseMove(NextModule);
        var moduleVal = NextModule?.TooltipLast?.Value;
        // Host.Log("measured module: '" + moduleVal +"'; null: " + (moduleVal == null));
    }
}

Don’t remember if I changed the way ModuleMeasureAllTooltip() is called, though.

1 Like