Move ore from fleet hangar to Ore hanger

Hi there, I’m transforming part of a program to move ore from the fleet hangar to the Ore hangar, the fleet hangar is constantly selected instead of the Ore hold but I’m running into difficulties locating the Ore hold

oreHoldFromInventoryWindow : EveOnline.ParseUserInterface.InventoryWindow → Maybe UIElement
oreHoldFromInventoryWindow =
.leftTreeEntries

List.filter (.text >> String.toLower >> String.contains “ore hold”)
List.head
Maybe.map .uiNode

Sadly enough reusing this didn’t seem to work. I think I need to dig further in the tree but I don’t know how. Could you please help.

One way is to look at the definition of the type you are using:

Here we see that for the InventoryWindowLeftTreeEntry you have two ways of navigating to the children and descendants:

  • uiNode: This one contains the whole subtree of this element.
  • children: This one is specifically for the children that are entries in the inventory tree view.

Another way is using the expander buttons in the visual explorer in the alternate UI for EVE Online:

1 Like

perfect thank you, much appreciated!

I ended up doing this:

.uiNode >> .uiNode >> EveOnline.ParseUserInterface.getAllContainedDisplayTexts >> List.any (String.toLower >> String.contains “ore hold”

I’m struggling to find the same “ore hold”. What am I doing wrong here?

oreHoldFromInventoryWindow : EveOnline.ParseUserInterface.InventoryWindow → Maybe UIElement
oreHoldFromInventoryWindow =
.leftTreeEntries
>> List.filter( .children >> .text >> String.toLower >> String.contains “ore hold”)
>> List.head
>> Maybe.map .uiNode

Getting .text from the value out of .children does not work:
.children gets you an instance of List. But the .text function needs a record as an argument, so it does not work with a List value.

I have changed your code to make it compile:

oreHoldFromInventoryWindow : EveOnline.ParseUserInterface.InventoryWindow -> Maybe UIElement
oreHoldFromInventoryWindow =
    .leftTreeEntries
        >> List.concatMap (.children >> List.map EveOnline.ParseUserInterface.unwrapInventoryWindowLeftTreeEntryChild)
        >> List.filter (.text >> String.toLower >> String.contains "ore hold")
        >> List.head
        >> Maybe.map .uiNode

The line with List.concatMap produces a list that contains all children of the nodes on the root level. The function above assumes that the ore hold is on the second level of the tree.

Thank you! This works :slight_smile: