[Release] Eve Online Botting Framework

03/03/2016 13:29 0ptimist#16
Quote:
Originally Posted by Vyndariel View Post
Zum Testzeitpunkt war ich immer von Station abgedockt, hatte keine überlappenden Fenster und Button zum Inventory ist auch so alles dort wie gefordert eingestellt.
Ok, dann habe ich noch ein paar fragen zu dem Test:

Hat der Bot das Sonnensystemmenü geöffnet?
->Wenn ja, war dort der Bookmark '00 - Station' sichtbar?
War im ShipUI der readout aktiv?
Was wird im API Explorer unter MemoryMeasurementParsed?.Value?.ShipUi?.HitpointsA ndEnergy angezeigt? (Dort sollten die Hitpoints angezeigt werden)
03/03/2016 13:43 0ptimist#17
Quote:
Originally Posted by supersonic666 View Post
EDIT:

nvm, went to your forum, found everything. thank you very much!

-----------------------------------------------------------------------

Hello Optimist, how would i go about adding code to the mining script, so it docks to the station if neutral or enemy pilots are present in local, then waits for local to be clear before going out again. it should be part of defense check part of the script.

if you could give me some ideas how to start i would appriciate that.

so far everything works great.
Just for the record, here is the implementation I would test next decide whether to warp out because of the looks of local:

Code:
using Parse = Sanderling.Parse;

bool IsNeutralOrEnemy(IChatParticipantEntry participantEntry) =>
   !(participantEntry?.FlagIcon?.Any(flagIcon =>
     new[] { "good standing", "excellent standing" }
     .Any(goodStandingText =>
        flagIcon?.HintText?.RegexMatchSuccessIgnoreCase(goodStandingText) ?? false)) ?? false);

WindowChatChannel    chatLocal =>
     Sanderling.MemoryMeasurementParsed?.Value?.WindowChatChannel
     ?.FirstOrDefault(windowChat => windowChat?.Caption?.RegexMatchSuccessIgnoreCase("local") ?? false);

//	assuming that own character is always visible in local
bool Retreat	=> 1 != chatLocal?.ParticipantView?.Entry?.Count(IsNeutralOrEnemy);
As you can see, it uses a whitelist of harmless standings and counts the chat participants which have any other flag.

If this works, I will add it to the included mining script.
03/03/2016 23:33 supersonic666#18
Quote:
Originally Posted by 0ptimist View Post
Just for the record, here is the implementation I would test next decide whether to warp out because of the looks of local:

Code:
using Parse = Sanderling.Parse;

bool IsNeutralOrEnemy(IChatParticipantEntry participantEntry) =>
   !(participantEntry?.FlagIcon?.Any(flagIcon =>
     new[] { "good standing", "excellent standing" }
     .Any(goodStandingText =>
        flagIcon?.HintText?.RegexMatchSuccessIgnoreCase(goodStandingText) ?? false)) ?? false);

WindowChatChannel    chatLocal =>
     Sanderling.MemoryMeasurementParsed?.Value?.WindowChatChannel
     ?.FirstOrDefault(windowChat => windowChat?.Caption?.RegexMatchSuccessIgnoreCase("local") ?? false);

//	assuming that own character is always visible in local
bool Retreat	=> 1 != chatLocal?.ParticipantView?.Entry?.Count(IsNeutralOrEnemy);
As you can see, it uses a whitelist of harmless standings and counts the chat participants which have any other flag.

If this works, I will add it to the included mining script.

works perfectly, thanks alot.
03/05/2016 14:49 0ptimist#19
Sanderling Release v16.02.04
This release brings improvements to the memory reading and scripting.

You can load it from [Only registered and activated users can see links. Click Here To Register...]

changes since v16.00.19:
  • fix a NullReferenceException in parsing of mission description.
  • fix bug in API Explorer which prevented propagation of some elements in Measurement to Tree View as described at [Only registered and activated users can see links. Click Here To Register...]
  • add find&replace tool to the integrated script editor as requested at [Only registered and activated users can see links. Click Here To Register...]
  • add #r directive to BotSharp which enables usage of other .NET assemblies in your scripts. (see example below) In response to request at [Only registered and activated users can see links. Click Here To Register...]
  • add main icon components to IOverviewEntry which contain several indicators regarding targeting. In response to request at [Only registered and activated users can see links. Click Here To Register...]
  • add MessageInput UIElement to WindowChatChannel to make sending chat messages easier. As described at [Only registered and activated users can see links. Click Here To Register...] (see example below)
  • add contained UIElements to PanelGroup to support navigation in Neocom.

Examples for using some of the new features

sending a message to a chat channel
Code:
void ChatSendMessage(WindowChatChannel windowChat, string messageText)
{
     if(null == windowChat) return;

     Sanderling.MouseClickLeft(windowChat?.MessageInput);
     Sanderling.TextEntry(messageText);
     Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
}

void ChatCorpSendMessage(string messageText) => ChatSendMessage(
        Sanderling.MemoryMeasurementParsed?.Value?.WindowChatChannel?.FirstOrDefault(c => c?.Caption?.RegexMatchSuccessIgnoreCase("corp") ?? false),
        messageText);
employing the #r directive to make use .NET assembly of your choice
Code:
#r "System.Speech" // Assembly name, in this case to be found in GAC

using System.Speech.Synthesis;

var synth = new SpeechSynthesizer();

synth.Speak("BotSharp at your service.");
03/06/2016 01:03 Vyndariel#20
Ore-Script mit veränderten Bookmark-Namen und Rats auf true


Code:
01.02.13  status transition from Pausing to Running.01.02.14  Microsoft.CodeAnalysis.Scripting.CompilationErrorException: (368,15): error CS1061: 'string' does not contain a definition for 'ValueFromRegexMatchGroupAtIndex' and no extension method 'ValueFromRegexMatchGroupAtIndex' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
   bei Microsoft.CodeAnalysis.Scripting.ScriptBuilder.ThrowIfAnyCompilationErrors(DiagnosticBag diagnostics, DiagnosticFormatter formatter)
   bei Microsoft.CodeAnalysis.Scripting.ScriptBuilder.CreateExecutor[T](ScriptCompiler compiler, Compilation compilation, CancellationToken cancellationToken)
   bei Microsoft.CodeAnalysis.Scripting.Script`1.GetExecutor(CancellationToken cancellationToken)
   bei Microsoft.CodeAnalysis.Scripting.Script`1.RunAsync(Object globals, CancellationToken cancellationToken)
   bei BotSharp.ScriptRun.<>c__DisplayClass58_0.<Start>b__0()01.02.14  status = Failed.
03/06/2016 09:54 0ptimist#21
Quote:
Originally Posted by Vyndariel View Post
Ore-Script mit veränderten Bookmark-Namen und Rats auf true


Code:
01.02.13  status transition from Pausing to Running.01.02.14  Microsoft.CodeAnalysis.Scripting.CompilationErrorException: (368,15): error CS1061: 'string' does not contain a definition for 'ValueFromRegexMatchGroupAtIndex' and no extension method 'ValueFromRegexMatchGroupAtIndex' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
   bei Microsoft.CodeAnalysis.Scripting.ScriptBuilder.ThrowIfAnyCompilationErrors(DiagnosticBag diagnostics, DiagnosticFormatter formatter)
   bei Microsoft.CodeAnalysis.Scripting.ScriptBuilder.CreateExecutor[T](ScriptCompiler compiler, Compilation compilation, CancellationToken cancellationToken)
   bei Microsoft.CodeAnalysis.Scripting.Script`1.GetExecutor(CancellationToken cancellationToken)
   bei Microsoft.CodeAnalysis.Scripting.Script`1.RunAsync(Object globals, CancellationToken cancellationToken)
   bei BotSharp.ScriptRun.<>c__DisplayClass58_0.<Start>b__0()01.02.14  status = Failed.
Das kommt daher das die genannte methode aufgrund einer kollision in einen anderen Namensraum verschoben wurde.
Das Problem kann behoben werden durch das hinzufügen der folgenden using directive am Anfang des Scripts:
Code:
using BotSharp.ToScript.Extension;
Übrigens kann man in der "static diagnostics" sektion alle compilerfehler sehen, der log den du kopiert hast zeigt im falle von fehlern beim kompilieren nur den ersten.
So kann das in der UI aussehen:
[Only registered and activated users can see links. Click Here To Register...]
03/07/2016 12:19 Vyndariel#22
Hey,

thanks a lot for your advice! With that iniatial line of code it's working ;)


I was wondering if you consider adding Mining Drone, as well as multiple bookmark-support?


Cheers
03/07/2016 22:08 0ptimist#23
Quote:
Originally Posted by Vyndariel View Post
Hey,

thanks a lot for your advice! With that iniatial line of code it's working ;)


I was wondering if you consider adding Mining Drone, as well as multiple bookmark-support?


Cheers
Drones and multiple bookmarks are already supported.

The Drone Window is at
Code:
MemoryMeasurementParsed?.Value?.WindowDroneView?[0]
[Only registered and activated users can see links. Click Here To Register...]
03/07/2016 23:01 Vyndariel#24
could you give us newbs working examples with existing code like the ore-script, especially multiple bookmarks are very interesting, especially in combination with mining crystals and filters?

This would boost that script massively ;)

Cheers
03/07/2016 23:27 0ptimist#25
Quote:
Originally Posted by Vyndariel View Post
could you give us newbs working examples with existing code like the ore-script, especially multiple bookmarks are very interesting, especially in combination with mining crystals and filters?

This would boost that script massively ;)

Cheers
Sure, I just changed the sample ore mining script to use multiple bookmarks for mining sites. :D
You can see the commit with the differences highlighted at [Only registered and activated users can see links. Click Here To Register...]

As you can see, it picks a random mining site from the configured set.
03/10/2016 19:12 Vyndariel#26
also I would like to know how I could change the script to target 2 roids instead of 1
03/11/2016 13:01 0ptimist#27
Quote:
Originally Posted by Vyndariel View Post
also I would like to know how I could change the script to target 2 roids instead of 1
for each roid you want to target do this:
  • choose the entry in the overview which represents the roid.
  • leftclick on that overview entry.
  • simulate keypress of the 'lock' keyboard shortcut. (You could also lock via the context menu but as long you can rely on knowing the configured keyboard shortcut that is more efficient)

I wrote a complete script which should implement the described approach and lock a configurable number of roids for you to test:

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

var numberOfRoidsToLock	= 2;

var LockTargetKeyboardShortcut = new[]{ VirtualKeyCode.LCONTROL};	// default of CTRL

Sanderling.Parse.IMemoryMeasurement	Measurement	=>
	Sanderling?.MemoryMeasurementParsed?.Value;

//	extract the ore type from the name as seen in overview. "Asteroid (Plagioclase)"
string OreTypeFromAsteroidName(string AsteroidName)	=>
	AsteroidName.ValueFromRegexMatchGroupAtIndex(@"Asteroid \(([^\)]+)", 0);

Sanderling.Parse.IWindowOverview	WindowOverview	=>
	Measurement?.WindowOverview?.FirstOrDefault();

Parse.IOverviewEntry[] ListAsteroidOverviewEntry =>
	WindowOverview?.ListView?.Entry
	?.Where(entry => null != OreTypeFromAsteroidName(entry?.Name))
	?.OrderBy(entry => entry.DistanceMax ?? int.MaxValue)
	?.ToArray();

Parse.IOverviewEntry[] ListAsteroidOverviewEntryLockingOrLocked =>
	ListAsteroidOverviewEntry
	?.Where(entry => (entry.MeTargeted ?? false) || (entry.MeTargeting ?? false))
	?.ToArray();

while(!(numberOfRoidsToLock <= ListAsteroidOverviewEntryLockingOrLocked?.Length))
{
	var	nextToLock	= ListAsteroidOverviewEntry?.Except(ListAsteroidOverviewEntryLockingOrLocked)?.FirstOrDefault();

	Host.Log("Lock another one: " + nextToLock?.Name);
	
	Sanderling.MouseClickLeft(nextToLock);
	
	Sanderling.KeyboardPressCombined(LockTargetKeyboardShortcut);
}
03/12/2016 10:48 Vyndariel#28
I really feel kinda dumb O.o I actually have no idea how to include this into the mining script O.o
03/12/2016 17:51 0ptimist#29
Quote:
Originally Posted by Vyndariel View Post
I really feel kinda dumb O.o I actually have no idea how to include this into the mining script O.o
I have no idea what your situation is since I don't know what you tried so far and how that failed.
03/12/2016 23:43 Vyndariel#30
I just use the default ore mining script, as we edited some things in already - but I assume I need to change the whole target routine or something in that existing script or do I just create a new void somewhere?

sry 4 derping