Arcitectus / Sanderling

APIs and libraries to read information directly from the EVE Online game client.
https://forum.botlab.org
Apache License 2.0
259 stars 117 forks source link

Bot went docking without having the drones in drone bay #29

Closed tetreum closed 7 years ago

tetreum commented 7 years ago

¡Thank you for making this awesome framework!

I'm using the included mining script and after mining, the bot went to dock station without having the drones inside drone bay. This is my screen, is there anything wrongly set? (drones are in the bay because i manually went back to recover them) http://i.imgur.com/g8GcUDL.jpg

I checked your code, and it has and runs the "DroneEnsureInBay()" method :s Script config:

//  This script mines ore from asteroids.
//  before running this script, make sure to prepare as follows:
//  +enter bookmark for mining site and bookmark for station in the configuration section below.
//  +in the Overview create a preset which includes asteroids and rats and enter the name of that preset in the configuration section below at 'OverviewPreset'. The bot will make sure this preset is loaded when it needs to use the overview.
//  +set Overview to sort by distance with the nearest entry at the top.
//  +in the Inventory select the 'List' view.
//  +set the UI language to english.
//  +use a ship with an ore hold.
//  +put some light drones into your ships' drone bay. The bot will make use of them to attack rats when HP are too low (configurable) or it gets jammed.
//  +enable the info panel 'System info'. The bot will use the button in there to access bookmarks and asteroid belts.
//  +arrange windows to not occlude modules or info panels.
//  +in the ship UI, disable "Display Passive Modules" and disable "Display Empty Slots" and enable "Display Module Tooltips". The bot uses the module tooltips to automatically identify the properties of the modules.
//
//  for optional features (such as warp to safe on hostile in local) see the configuration section below.

using BotSharp.ToScript.Extension;
using Parse = Sanderling.Parse;

//  begin of configuration section ->

//  The bot uses the bookmarks from the menu which is opened from the button in the 'System info' panel.

//  Bookmarks of places to mine. Add additional bookmarks separated by comma.
string[] SetMiningSiteBookmark = new[] {
    "Mining",
    };

//  Bookmark of location where ore should be unloaded.
string UnloadBookmark = "MiningDockStation";

//  Name of the container to unload to as shown in inventory.
string UnloadDestContainerName = "Item Hangar";

//  when this is set to true, the bot will try to unload when undocked.
bool UnloadInSpace = false;

//  Bookmark of place to retreat to to prevent ship loss.
string RetreatBookmark = UnloadBookmark;

//  The bot loads this preset to the active tab. 
string OverviewPreset = "MiningAndRats";

var ActivateHardener = true; // activate shield hardener.

//  bot will start fighting (and stop mining) when hitpoints are lower. 
var DefenseEnterHitpointThresholdPercent = 85;
var DefenseExitHitpointThresholdPercent = 90;

var EmergencyWarpOutHitpointPercent = 60;

var FightAllRats = true;    //  when this is set to true, the bot will attack rats independent of shield hp.

var EnterOffloadOreHoldFillPercent = 95;    //  percentage of ore hold fill level at which to enter the offload process.

var RetreatOnNeutralOrHostileInLocal = false;   // warp to RetreatBookmark when a neutral or hostile is visible in local.

//  <- end of configuration section

Func<object> BotStopActivity = () => null;

Func<object> NextActivity = MainStep;
tetreum commented 7 years ago

I've modified the following line: https://github.com/Arcitectus/Sanderling/blob/master/src/Sanderling/Sanderling.Exe/sample/script/Mine.ore.cs#L153

if(OreHoldFilledForOffload && 0 == DronesInSpaceCount)

To ensure the drones have arrived before leaving, rather than relaying on a simple timeout (https://github.com/Arcitectus/Sanderling/blob/master/src/Sanderling/Sanderling.Exe/sample/script/Mine.ore.cs#L213)

Also bot switches sometimes to Sanderling window :S (and doesn't switch to eve online one when started)