Mining script of Without

J’ai modifier le script de base fourni par Arcitectus pour ajouter quelques fonctionalitées de plus

Lien du script : http://pastebin.com/KZ3HM6K9

http://pasteboard.co/HBwROi3Y.png

Ne lock plus d’asteroid lorsqu’il est en mode défence(cela arrivait souvent)

*Les bookmark sont dans des dossiers

Les modules seront remesurés après chaque stop

Minage avec des des vaisseaux de plusieurs lasers en affectant un module par asteroide

Ne cible pas plus que le nombre de modules de minage

Avance et s’arrête dès que le mining range est atteint losrque les asteroides sont loing

Selectionne un asteroid au hasard dans la porté du module de minage (peut être moin louche)

Peut utiliser un module survey scanner et déterminer le temps d’activation de chaque module pour un rendement optimal

Calcul du volume dans les modules de minage afin de les arretés au moment que la soute soit pleine

  • Créer un dossier ou plusieurs et mettre les bookmarks dans le(s) dossier(s). Un dossier et puis un bookmark seront choisi aléatoirement. Les noms des bookmarks ne sont pas important. Les noms des dossier doivent etre cofigurés dans le script.

si quelqu’un a des idées d’améliorations dites le moi le et je verrais

//MàJ :

Implémentation des propositions offertes par Arcitectus

16-04-2016:

Il est désormait possible de miner avec des drones de minage

06-08-2016:

Petit update

10-08-2016:

Il est desormait possible d’utiliser un module Survey Scanner(beta)

11-08-2016:

Obtimisation du rendement et correction de divers bug

2 Likes

Very interesting.

si quelqu’un a des idées d’améliorations dites le moi le et je verrais

I have not looked at the behaviour, but I have some suggestions to make it less complex and easier to read:

Returning a default value instead of null:

Code I found in the linked script:

int Entier(int? entier){   int EntierRetourne;   if(entier == null)      EntierRetourne = 0;   else      EntierRetourne = (int)entier;    return EntierRetourne;}

As long as you don’t care about setting a breakpoint in this function, this is the same as:

int Entier(int? entier) => entier ?? 0;

As you can see, it is simpler to omit the call entirely and place the expression in the calling code.

Reading the ship speed:

Code I found in the linked script:

 string str_speed = Measurement?.ShipUi?.SpeedLabel?.Text; float Speed = 0; if (str_speed != null) { str_speed = str_speed?.Replace("m/s", null); float.TryParse(str_speed, out Speed); }

The property “SpeedMilli” on the IShipUi gives you the speed in thousandths, therefore you can replace it with this:

var Speed = (Sanderling?.MemoryMeasurementParsed?.Value?.ShipUi?.SpeedMilli ?? 0) / 1000f;

Picking a random element from a sequence/array:

Code I found in the linked script:

int RandomEntry = rand.Next(0, Entier(Measurement?.Menu?.ElementAtOrDefault(1)?.Entry?.Count())); //TO DOvar BookmarkMenuEntry = Measurement?.Menu?.ElementAtOrDefault(1)?.Entry?.ElementAtOrDefault(RandomEntry);

You used a similar pattern four times in the script. To make it easier to read, you can replace it with this:

var BookmarkMenuEntry = RandomElement(Measurement?.Menu?.ElementAtOrDefault(1)?.Entry);
T RandomElement<T>(IEnumerable<T> seq){    var counted = seq?.ToArray();         if(!(0 < counted?.Length))        return default(T);             return counted[rand.Next(counted.Length)];}
2 Likes

Merci pour les conseils je les ai implémentés

SpeedMilli est toujours null!?

The property “SpeedMilli” on the IShipUi gives you the speed in thousandths, therefore you can replace it with this:

var Speed = (Sanderling?.MemoryMeasurementParsed?.Value?.ShipUi?.SpeedMilli ?? 0) / 1000f;

SpeedMilli est toujours null!?

Sorry, the parsing code was actually missing. I added it, and published a new build: https://github.com/Arcitectus/Sanderling/releases/download/v16.03.12/16.03.12.Sanderling.exe

Thanks for the nice script, it turned out that this is your scripts published on pastebin. I found it by searching. before you post it on forum wink

I borrowed from you the source code and combined them with the basic script.  Also I added the settings for the number of targets for the mining and launch mining drones, and added function for on/off modules or focusing all on the same target. I’m just learning to write scripts and there are problems with knowledge of programming, but the script works tolerably. Of course I have a code is not so pure as yours. And I think that the my script  consumes memory resources more than basic script.

For me, would like to see:

  • Increased use of mining drones. (When the rats come, mining drones go back to the ship and start combat drones).
  • fix multiple modules (if possible). When ore mining is ends and if still some number of asteroids, the ship starts to fly from one corner to the other if there is no mining range.
  • The use of a scanner for the production to avoid time loss.

- When using multi extraction to determine which asteroids are busy (3*moduls+1drones)

thanks again.

Je voudrais faire une fonction qui vérifirait si les drones de minage sont lancé. Mais je sais pas trop comment faire voilà ce que j’ai fais :

 bool IsMiningDronesLaunch() // Je sais pas {     var LabelDronesInLocalSpace = Measurement?.WindowDroneView?.FirstOrDefault()?.ListView?.Entry?.FirstOrDefault(w => boolDefault(w?.LabelText?.FirstOrDefault()?.Text?.RegexMatchSuccessIgnoreCase("^Drones in Local Space")));     bool IsExpanded = boolDefault(LabelDronesInLocalSpace?.IsExpanded);     if(!IsExpanded)     {         ClickMenuEntryOnMenuRoot(LabelDronesInLocalSpace,"Expand");     }          var Label = Measurement?.WindowDroneView?.FirstOrDefault()?.LabelText?.FirstOrDefault(w => w.Text.RegexMatchSuccessIgnoreCase("^" + LabelNameMiningDrones) );          Sanderling.MouseClickRight(Label);// Ouais s'est limite          var Menu = Measurement?.Menu?.FirstOrDefault();          // Pas mal limite     bool  IsMiningDrones = (Menu?.Entry?.FirstOrDefault((w => w.Text.RegexMatchSuccessIgnoreCase("^Mine")))?.Text.RegexMatchSuccessIgnoreCase("^Mine") ?? false);     if(IsMiningDrones)     {         Host.Log("Les mining drones sont lancés");     }          return IsMiningDrones; }

Je voudrais de vos propositions

J’ai implémenter l’utilisation des drones de minage

Merci pour la modification du script.

J’ai juste 3 petits problèmes/bugs

1/ Le programme ferme toujours la fenêtre des drônes est-ce normal ? ce qui fait que quand ma soute est pleine, il reste coincé à l’étape “returning drone to bay” même s’ils ne sont pas sortis

2/ Est-il possible de changer les target pour miner à Nombre de lazer +1 => Gain de temps pour le lock

3/ Il ne veut pas undock de ce que je comprends, il coince dans cette boucle :

voidUndock()
{
    Sanderling.MouseClickLeft(Measurement?.WindowStation?.FirstOrDefault()?.UndockButton);
    
    Host.Log(“waiting for undocking to complete.”);
    while(Measurement?.IsDocked ?? true) Host.Delay(2111);

Host.Delay(4444);
    Sanderling.InvalidateMeasurement();
}

Quand je remplace par l’original :

voidUndock()
{
    while(Measurement?.IsDocked ?? true)
    {
        Sanderling.MouseClickLeft(Measurement?.WindowStation?.FirstOrDefault()?.UndockButton);
        Host.Log(“waiting for undocking to complete.”);
        Host.Delay(8000);
    }

Host.Delay(4444);
    Sanderling.InvalidateMeasurement();
}

Il bug moins mais on dirait qu’il ne trouve pas le bouton “Undock” du premier coup, il mets 4 ou 5 tentatives pour y arriver

It seems to me that this undock function - better. It allows to quickly switch to the other actions. In some cases excluded exit by the Host.Delay 8 + 8 seconds

//  выход из дока станции
void Undock()	{
    while (true) {
var ReadyForExit = Measurement?.WindowStation?.FirstOrDefault()?.LabelText?.FirstOrDefault( text => text.Text.RegexMatchSuccess("Отменить выход|Производится") );
if(ReadyForExit != null)	{
	//	Host.Log("Станция: производится выход из дока");
		Host.Delay(3333);
        		break;
		}
if (Measurement?.IsDocked ?? true)    {
        	Sanderling.MouseClickLeft(Measurement?.WindowStation?.FirstOrDefault()?.UndockButton);
       		 //	Host.Log("Станция: жму кнопку Выйти из дока");
 				goto loop;
			}
 loop:
Host.Delay(2222);
    		Sanderling.InvalidateMeasurement();
                        Host.Delay(2222);
}
}

Hello

I’m using the standard Mining script and changed the bookmarks but when it run the script I get the following error

[
  {
    “TimeDateTimeIntraDayCal”: “20.33.31”,
    “TimeDateTimeIntraSecMilliString”: “492”,
    “CaptionString”: “System.NullReferenceException: Object reference not set to an instance of an object.
   at BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass60_0.b__0()”,
    “LineIndex”: null,
    “CharacterIndexInLine”: null,
    “LineIndexInAvalonEdit”: null,
    “CharacterIndexInLineInAvalonEdit”: null
  }
]

I’m not sure what it is.

Any advice?

Hello

I’m using the standard Mining script and changed the bookmarks but when it run the script I get the following error

[
  {
    “TimeDateTimeIntraDayCal”: “20.33.31”,
    “TimeDateTimeIntraSecMilliString”: “492”,
    “CaptionString”: “System.NullReferenceException: Object reference not set to an instance of an object.
   at BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass60_0.b__0()”,
    “LineIndex”: null,
    “CharacterIndexInLine”: null,
    “LineIndexInAvalonEdit”: null,
    “CharacterIndexInLineInAvalonEdit”: null
  }
]

I’m not sure what it is.

Any advice?

Hello,

first you should switch to version 16.06.23 because older versions are not supported anymore.

Your description sounds like the problem only occurs after changing the script. If this is the case, send me this script. If you see the problem with all scripts, make sure you have the Microsoft .NET Framework 4.6.1 installed. You can download it from https://www.microsoft.com/download/details.aspx?id=49982

1 Like

Works like a charm now!

How can I change what type of asteroids to mine? Also my ship doesn’t stop moving so it always bumps in to the asteroids how can I change that?

Anyway the bot works thats the best part!

Thnx for the help

1 Like

Works like a charm now!

How can I change what type of asteroids to mine? Also my ship doesn’t stop moving so it always bumps in to the asteroids how can I change that?

Anyway the bot works thats the best part!

Thnx for the help

I do not know if the script of Without contains functionality for this, but in any case you can create an overview profile to filter the asteroids by type in the eve online client.

1 Like

Used the funtion void ShipStop (); from Without and it works. To mine different ores I changed the overview profile like you said and it works!Thnx for the helpKeep up the good work!

Voici un petit truc qui me dérange un peu :

Lorsqu’il clique sur l’onglet overview, il clique parfois sur le petit truc blanc avec des lignes horisontales et ne change finalement pas d’onglet.

Je travail actuellement sur un script pouvant utiliser un survey scanner.

Cependant il serait utile d’ajouter dans les “Entry” de la “WindowSurveyScanView” des données comme “MeTargeted”, “Name”, “Type”, “Quantity”, “DistanceMin”, “DistanceMax”

FRAvec votre script, Tu as un problem avec le tab “overview” parce que chez moi le tab minimalisez parfois.ENDo you have any problems with your script? My script (basic script) somethimes minimizes the overview tab so it warps to al my bookmarks because it can’t find asteroids.

Voici un petit truc qui me dérange un peu :

http://pasteboard.co/40aAX0r87.png

Lorsqu’il clique sur l’onglet overview, il clique parfois sur le petit truc blanc avec des lignes horisontales et ne change finalement pas d’onglet.

What is the goal of clicking on the tab? If the goal is to make the overview visible, you can solve this by not having the overview window contained in a window stack. You can unstack it by dragging the tab out of the stack. Then it will be visible all the time and you do not need anymore the code for the switching.

Do you have any problems with your script? My script (basic script) somethimes minimizes the overview tab so it warps to al my bookmarks because it can’t find asteroids.

How does it minimize the tab?