Fuzzy building A-Bot


#128

Thanks @Viir , and the reason for asking was as mentioned it looked like a bug in the engine since it didn’t wan’t to click on ignore site.
I believe that when the skip anomaly issue is solved the bot with be quite stable, with Focus fire and Aggressive on drones should solve most issues.
If not that will be a last thing to look at, maybe :slight_smile:


#129

Could someone please send me the executable (.exe) file with the following changes.

  • Orbits the current target at 30 KM
  • Collect the drones when they appear neutral

#130

It´s not available.
Still hoping for our guys to help when they have time : )


#131

hi guys im new here and im not sure if this forum is still active but i’ll post anyway. I was thinking of adding a code in Retreat.cs that turns off the afterburner so it doesnt take like 30 seconds to get into warp (which is more than enough for an interceptor to fly in and kill you) but I have no idea how to write codes taht controls the modules. can anyone offer me a bit of advice for this?


#132

I thought so, too. Soo, i added extention method in BotExtension.cs


static public bool IsAfterburner(this Accumulation.IShipUiModule module, Bot bot) =>
		module?.TooltipLast?.Value?.TitleElementText()?.Text?.RegexMatchSuccessIgnoreCase("Afterburner") ?? false;

And then in Retreat.cs we can check it:

var ab = Bot?.MemoryMeasurementAccu?.ShipUiModule?.Where(m => m?.IsAfterburner(Bot) ?? false).FirstOrDefault();
							if (ab.IsActive(Bot) ?? false)
							{
								yield return new BotTask { Effects = new[] { ab.MouseClick(BotEngine.Motor.MouseButtonIdEnum.Left) } };
							}

#133

thank you for your response :smiley: sorry to pester you some more but I am very new to c# (im barely competent in c++) and do not understand much of how this sanderling bot works. does this code work by just pasting it to the bottom of Botextension.cs and Retreat.cs respectively or would I have to add them differently?

I would appreciately greatly if you could just share your Botextension.cs and Retreat.cs with me :smile:

Also would you know how to recall drones as well when you are trying to warp off?


#134

Sorry, my english too bad for understanding what do you mean.
If you dont have access to modify some class you can add some functions by Extension methods:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
Soo we added function IsAfterburner wich will return true if our module is afterburner. Simple example:

if (Bot?.MemoryMeasurementAccu?.ShipUiModule?.First()?.IsAfterburner(Bot) ?? false)
{
   //do something if first module is Afterburner
}

I use hotkey Shift+R

 //recall drones to dronebay
yield return new BotTask
{
	Effects = new[] { MotionParamExtension.KeyboardPressCombined(new[] {
                       WindowsInput.Native.VirtualKeyCode.SHIFT, WindowsInput.Native.VirtualKeyCode.VK_R 
                       }) }
};

(also see Ctrl+click).


#135

Thanks for the reply again @Terpla :smiley:

For the Drone part I implemented the code in following way into retreat.cs:

                        var i = 0;

			if (i < 1)
			{
				i++;
				yield return new BotTask
				{
					Effects = new[] { MotionParamExtension.KeyboardPressCombined(new[] {
					 WindowsInput.Native.VirtualKeyCode.SHIFT, WindowsInput.Native.VirtualKeyCode.VK_R
					 }) }
				};
				

			}
			else
			{
				yield break;
			}

but this only makes the ship recall drone and not warp to citadel. please help me

also i tried your code for turning off afterburner but it’s not working

can you share your retreat.cs with me so I can figure it out?

also do you know how to make player detection work properly?

Thank you always :smiley:


#136

As i understand your code it just click Shift+R. Why do you think that the bot will warp to the citadel?

nope

Use search on this forum.


#137

What was the fit you posted o.smium won’t load for me? I started a alpha to try this out and eventually sub the account hopefully.

I Have no experience in coding so maybe I’m doing something wrong when trying to compile I get this error: c:/mingw/bin/…/lib/gcc/mingw32/6.3.0/…/…/…/…/mingw32/bin/ld.exe: cannot open output file Sanderling.ABot.exe: Permission denied
collect2.exe: error: ld returned 1 exit status

I also don’t seem to have Solution Explorer? @Viir


#139

My friends…

I’m new to programming, I do not really know anything at all, but I’m trying to edit the BOT to work as I expect.

I downloaded Visual Studio and installed it, I downloaded a copy with all “Fuzzied / A-Bot — ORBIT-Player-Detection” files.

I open combat.cs but I can not find the line where I orbit a given object so I can edit.

And another question I’m having is, how do I make the files become an executable .exe for me to put the BOT to work?


#140

@Terpla

this is my full code of the retreat.cs

using System.Collections.Generic;
using Sanderling.Motor;
using Sanderling.ABot.Parse;

	namespace Sanderling.ABot.Bot.Task
{
	public class RetreatTask : IBotTask
	{
		public Bot Bot;

		public IEnumerable<IBotTask> Component
		{
		get
		{
			var memoryMeasurement = Bot?.MemoryMeasurementAtTime?.Value;

			if (!memoryMeasurement.ManeuverStartPossible())
				yield break;

			var retreatBookmark = Bot?.ConfigSerialAndStruct.Value?.RetreatBookmark;

			if (ab.IsActive(Bot) ?? false)
			{
				yield return new BotTask { Effects = new[] { ab.MouseClick(BotEngine.Motor.MouseButtonIdEnum.Left) } };
			}
			
			yield return new BotTask
			{
				Effects = new[] { MotionParamExtension.KeyboardPressCombined(new[] {
				 WindowsInput.Native.VirtualKeyCode.SHIFT, WindowsInput.Native.VirtualKeyCode.VK_R
				 }) }
			};
				

			yield return new MenuPathTask
			{
				RootUIElement = memoryMeasurement?.InfoPanelCurrentSystem?.ListSurroundingsButton,
				Bot = Bot,
				ListMenuListPriorityEntryRegexPattern = new[] { new[] { retreatBookmark }, new[] { @"dock", ParseStatic.MenuEntryWarpToAtLeafRegexPattern } },

			};
						}
	}

	public IEnumerable<MotionParam> Effects => null;
}

}

I am not very knowledgeable in C# so I cant understand why each task won’t move to the next task once its completed. For example, the bot will keep trying to recall drones instead of pressing recall drones then moving on to docking in citadel.

I tried using yield break to solve this but it doesnt seem to work. I also tried to create a if loop using counters to limit the number of times the loop is executed but it didnt work either. I only have experience in c++ and obviously c# is very different and hence I ask you for your advice.

also for this my search says there is a bug with the sanderling engine and that needs to be fixed. Does this mean I have to update some files with the latest version of sanderling release?

@raphael.mca
hello and welcome :smiley: i’m very new to programming as well so I’m afraid there isnt much I can do to help you with coding.

To build the code open Sanderling.ABot.sln which can be found in the src folder using visual studios and go to Build -> Solution Build. Then you can find the file you just built using the search tab for .exe files :smiley:


#141

also would you have any recommended articles for me to read to learn to code this myself? Which tutorials would I have to look up specifically to help me code for A bot?


#143

Hi, I’m trying to create an executable, I’m trying to make the following command line:

The original line is
VirtualKeyCode.SHIFT

That simulates the SHIF key, I would like to simulate the “W”

I put it like this …
VirtualKeyCode.W

but it is giving error, can anyone help me?


#144

Hi,

Sorry I havent been active lately, crazy work hours lately…
If you want to do sites, I don’t see any reason to do them other than as efficiently as possible.
Don’t try to go to the higher ones, just do the ones you need little tank with so you can max dps.

Here is the fit for that, I avg between 18-22 mil a tick in “hubs” sites: ( Changed it from private to Public)
https://o.smium.org/loadout/140493


#145

Thanks! I’m runing a fairly tanky fit because its a alpha but I’ll move into that.

How did you few the file in solution exporer like Viir said? I feel like my visual studio doesn’t have it.
I assumed it was a extention and found a solution explorer but now I can’t find one that doesn’t allow you to restore nuget packages like viir told you in this thread.

This is my first time using visual studi the only experiance I’ve had with coding was using eclipse tring to learn PHP.


#146

I had to navigate to the right line in the explorer menu like stated, one is per file I think you want the top level being the root for the project. It gives you several other options among other a few regarding nugets


#147

Friends, I was able to compile the file and create the executable .exe
I was also able to change the SHIFT key to W in the orbit morph.

My next challenges are …
-Receive the drones when a neutral arrives in the place (can be using a VirtualKey)
-Leave the anomaly when the shield reaches 30% (to avoid dying)

Can someone help me do these functions?


#148

How were you able to compile? I’ve looked at above fuzzy/viir posts and I don’t have those same options and based on the screenshot my Visual studio loots different then theirs maybe they are on a older version.

Would you mind sharing the exe I don’t know if thats allowed here though since no one has yet.

When I look on google it shows I need to enable nuget package restore through the tools Tools > Options though I have no Tools option. I don’t know if I’m just too stupid or what.

I’m pretty sure I read someone on the forums about Recieving drones before warping when a nuet arriaves in local.


#149

Look at default Mine.ore.cs script - it contains both functions you asking for.