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.