I tried the following code segment from a different thread. This does not seem to work. Items from the ore hold are selected but a destination container cannot be found. I checked to make sure the label text was correct. Thank you for the help.
void UnloadToHangar(string DestinationContainerName = "Item Hangar") { Host.Log("unload to hangar."); EnsureWindowInventoryOpenOreHold(); for ( ; ; ) { var OreHoldItem = WindowInventory?.SelectedRightInventory?.ListView?.Entry?.FirstOrDefault(); var DestinationContainer = WindowInventory?.LeftTreeListEntry?.SelectMany(entry => new[]{entry}.Concat(entry.EnumerateChildNodeTransitive())) ?.FirstOrDefault(entry => string.Equals(entry?.Text, DestinationContainerName, StringComparison.InvariantCultureIgnoreCase)); if (null == DestinationContainer) Host.Log("error: Inventory entry labeled '" + DestinationContainerName + "' not found"); if(null == OreHoldItem) break; // 0 items in OreHold Sanderling.MouseDragAndDrop(OreHoldItem, DestinationContainer); } }
I figured out the issue. You are using a string.Equals test and it looks like a “StartsWith” might be more appropriate due to the added text for distance in a POC. Here is the log entry:
I figured out the issue. You are using a string.Equals test and it looks like a “StartsWith” might be more appropriate due to the added text for distance in a POC. Here is the log entry:
Unlike “StartsWith”, this should stell prevent a unwanted match with a container name which is not the same but starts the same (No idea what container names are to be found out there).