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;
}
}