Please i need help with coding few lines of code useing Viirès version of sanderling

please i need help to select a bookmark from the people&places window and set destination from the list of bookmarks i have listed for the bot to use in the bots config

im new to C# i just need lines i can copy and paste and work with to learn how the coding works im working with the existing bot but i dont want to be limited to mining in the one area i wanna be able to go out and look for rare areas to mine save to bookmark and add it to the bot config so it can gate jump the bot is allready set up for gate jumping i just need to set destinations

so what i wanna do is change this to work from the people and places window
but instead of jumping or warping i wanna set destination from bookmarks

bool InitiateWarpToRandomMiningSite()	=>
	InitiateDockToOrWarpToBookmark(RandomElement(SetMiningSiteBookmark));

bool InitiateDockToOrWarpToBookmark(string bookmarkOrFolder)
{
	loopr1:
	var ManeuverType = Measurement?.ShipUi?.Indication?.ManeuverType;
	if(ShipManeuverTypeEnum.Warp == ManeuverType	||
		ShipManeuverTypeEnum.Jump == ManeuverType)
		{
		Host.Log("Wait Finish");
		Host.Delay(3000);
		goto loopr1;
		}
	Host.Log("dock to or warp to bookmark or random bookmark in folder: '" + bookmarkOrFolder + "'");
	
	
	
	var listSurroundingsButton = Measurement?.InfoPanelCurrentSystem?.ListSurroundingsButton;
	
	Sanderling.MouseClickRight(listSurroundingsButton);
	
	var bookmarkMenuEntry = Measurement?.Menu?.FirstOrDefault()?.EntryFirstMatchingRegexPattern("^" + bookmarkOrFolder + "$", RegexOptions.IgnoreCase);

	if(null == bookmarkMenuEntry)
	{
		Host.Log("menu entry not found for bookmark or folder: '" + bookmarkOrFolder + "'");
		return true;
	}

	var currentLevelMenuEntry = bookmarkMenuEntry;

	for (var menuLevel = 1; ; ++menuLevel)
	{
		Sanderling.MouseClickLeft(currentLevelMenuEntry);

		var menu = Measurement?.Menu?.ElementAtOrDefault(menuLevel);
		var dockMenuEntry = menu?.EntryFirstMatchingRegexPattern("dock", RegexOptions.IgnoreCase);
		var warpMenuEntry = menu?.EntryFirstMatchingRegexPattern(@"warp.*within\s*0", RegexOptions.IgnoreCase);
		var approachEntry = menu?.EntryFirstMatchingRegexPattern(@"approach", RegexOptions.IgnoreCase);

		var maneuverMenuEntry = dockMenuEntry ?? warpMenuEntry;
	

	Host.Delay(100);
	Sanderling.InvalidateMeasurement();


		if (null != maneuverMenuEntry)
		{
			Host.Log("initiating '" + maneuverMenuEntry.Text + "' on entry '" + currentLevelMenuEntry?.Text + "'");
			Sanderling.MouseClickLeft(maneuverMenuEntry);
			return false;
		}

		if (null != approachEntry)
		{
			Host.Log("found menu entry '" + approachEntry.Text + "'. Assuming we are already there.");
			return false;
		}

		var setBookmarkOrFolderMenuEntry =
			menu?.Entry;	//	assume that each entry on the current menu level is a bookmark or a bookmark folder.

		var nextLevelMenuEntry = RandomElement(setBookmarkOrFolderMenuEntry);

		if(null == nextLevelMenuEntry)
		{
			Host.Log("no suitable menu entry found");
			return true;
		}

		currentLevelMenuEntry = nextLevelMenuEntry;
	}
}

How about this approach:

  • Right click on the locations entry in the people and places window to open the context menu on that entry.
  • Use menu entries to set the location as the destination for auto pilot.

Do you see any issues with this approach?

1 Like

I See No problems with that looks like it should this method added the fleet warp capability to astroid belts

now how do i go aboutwriteing this i know very little about the bot scripting languge im can follow the code take stuff out and and one or tow lines im unable to write my self

For communication here, supported languages are English, Spanish and German.
I am unable to understand the entirety of your post, therefore I cannot process it at the moment.
For example, I do not understand the meaning of the following sentence:

now how do i go aboutwriteing this i know very little about the bot scripting languge im can follow the code take stuff out and and one or tow lines im unable to write my self

Feel free to edit this to translate to one of the supported languages mentioned above or create a new post/issue to enable us to progress further.

now how do i go about writing the code i know very little about the bot scripting languge #C i can follow the code and make out how it works … take stuff out and move one or tow lines or removes a few lines of code… im unable to write code from scratch my self

What do you think about the guide at C# Programming Guide | Microsoft Docs ?
Does that help you?