Option for mining bot to stop after x unloads

Hi, is there an option to setup bot to stop after x unloads in station? Now I’m using session-length-limit but
this results in the ship being left in outer space.

Thx for the answers:)

How about having the bot return to the station when the time left to the end of the session is less than five minutes?
Would that be an improvement for you?

That would be great!

Michael, can you help me with setup this feature?

Sure. We have this example on how to compute the remaining time in the session: bots/implement/templates/display-session-length-limit at acd972644ce692142f4e87b2d7da21198e65d0a3 · Viir/bots · GitHub

Here is the description you will see for that app:

This app demonstrates how to use the session time limit.
Some bots should consider the remaining time in the current session when choosing the next activity.
This app demonstrates how to get and store the session length limit set in the configuration interface.
It also computes the remaining time as the difference between the present time and the configured limit and displays the result via the status text.

When you run that app:

botengine  run  https://github.com/Viir/bots/tree/acd972644ce692142f4e87b2d7da21198e65d0a3/implement/templates/display-session-length-limit

You will see a status text like this:

The session length was set to 15 minutes and 0 seconds.
Remaining are 14 minutes and 42 seconds.

That reflects the session-length-limit you set last in this session. In case of an offline session, it defaults to 15 minutes.

When you use a framework for EVE Online like app framework 956236b36e, you will find the times in the eventContext:

I see you don’t even need to use those, because there is already the secondsToSessionEnd function in the framework to extract the remaining time in seconds:

Here is how you integrate this in a mining bot to avoid it stranding in a belt:

You can run such a bot from FrontendWeb.Main