Is this a usable logic tree for mining bot?

I’m working on something and I’m having a lot of issues getting it to even 60%.

Am I using too basic elm functions to achieve what I would like to do with this logic tree? If it’s even considered a logic tree. Maybe it does not work like I think it does.

It starts at this line in BotEngineApp.elm

        (case  context.readingFromGameClient |> topmostAsteroidFromOverviewWindow of
          Nothing ->
              describeBranch "I see no asteroids in the overview. Looking for a belt to mine."
                        (returnDronesToBay context.readingFromGameClient
                          |> Maybe.withDefault
                                (warpToMiningSite context.readingFromGameClient)
                        )
                        
          Just asteroidInOverview ->
              describeBranch "Found a belt to mine in."
                travelToMiningSite context seeUndockingComplete
                    (case context.readingFromGameClient |> topmostNotAsteroidFromOverviewWindow of 
                        Nothing ->
                            describeBranch "No rat detected. Deploying mining drones."
                                (returnDronesToBay context.readingFromGameClient
                                    |> Maybe.withDefault
                                        (lockTargetFromOverviewEntryAndEnsureIsInRange
                                            context.readingFromGameClient
                                            context.eventContext.appSettings.miningModuleRange
                                            asteroidInOverview
                                                |> Maybe.withDefault
                                                    (launchAndEngageMiningDrones context.readingFromGameClient
                                                    (describeBranch "Locked '" ++ (asteroidInOverview.objectName |> Maybe.withDefault "Nothing") ++ "' and launched drones." waitForProgressInGame)
                                                        |> Maybe.withDefault
                                                            (case context |> knownMiningModules |> List.filter (.isActive >> Maybe.withDefault False >> not) |> List.head of
                                                                Nothing ->
                                                                    describeBranch "All known mining modules are active."
                                                                        (readShipUIModuleButtonTooltips context
                                                                            |> Maybe.withDefault waitForProgressInGame
                                                                        )

                                                                Just inactiveModule ->
                                                                    describeBranch "I see an inactive mining module. Activating it."
                                                                    (clickModuleButtonButWaitIfClickedInPreviousStep context inactiveModule)
                                                            )
                                                    )
                                            )
                                )
                                

                        Just notasteroidInOverview ->
                            describeBranch ("Detected rat named '" ++ (notasteroidInOverview.objectName |> Maybe.withDefault "Nothing") ++ "'. Deploying combat drones.")
                                (returnDronesToBay context.readingFromGameClient
                                    |> Maybe.withDefault
                                        unlockTargetsForMining context
                                        |> Maybe.withDefault
                                            (lockTargetFromOverviewEntryAndEnsureIsInRange
                                            context.readingFromGameClient
                                            context.eventContext.appSettings.ratsTargetingRange
                                            notasteroidInOverview
                                                |> Maybe.withDefault
                                                    (describeBranch "Locked '" ++ (notasteroidInOverview.objectName |> Maybe.withDefault "Nothing") ++ "' and launched drones." waitForProgressInGame)
                                                    (launchAndEngageCombatDrones context.readingFromGameClient )
                                            )
                                )
                    )
)

I understand I didn’t paste all the others functions but if it could be useful I will.

What would you like to do? I did not find that info.

As far as I understand, you tried to make some changes to a mining bot. Does that code you posted contain more than one new function compared to the one you linked on GitHub?

Since you have some program code changes, I wonder, can we see the a commit with these changes somewhere on GitHub or GitLab?

I’m still experimenting with what I can change.

This one change is the biggest one yet. I kind of put it aside to wait and understand elm structures better before going back at it.

I don’t have neither. I probably will make an account on Github

1 Like

All the new functions are just repurposed functions that already existed mostly.
For example:

launchDrones was split into launchCombatDrones and launchMiningDrones

unlockTargetsNotForMining became unlockTargetsForMining to unlock asteroids before targeting rats

asteroidInOverview was duplicated into notAsteroidInOverview to detect all non-asteroids in overview(rats in my case)

They all works when called by themselves but building a logic tree with them is giving me some issues.

I started using simulation to test changes done to scripts. It is much faster to get the right result.

What issues? Do you see something surprising?

I see there is already a working mining bot at bots/implement/applications/eve-online/eve-online-mining-bot at 1e297e82593d9d690abd5466f8edd19bda816839 · Viir/bots · GitHub

Did you try that one to see if it is closer to what you want?

Ah never minds this topic. I tried closing it.