Skip to content

Commit

Permalink
Support explicitly setting a specific named location as the mining site
Browse files Browse the repository at this point in the history
Expand the example for mining in EVE Online with an additional way to pick a mining site:

+ Expand the settings record with an optional field to specify a mining site.
+ Expand the function to warp to the mining site to use the new settings entry if present. If the new mining site setting is not used, warp to a random asteroid belt as before.
+ Expand the bot settings parsing to offer using the new setting via the standard bot-settings prompt interface.

Related discussion: https://forum.botlab.org/t/eve-online-mining-bot/4708
  • Loading branch information
Viir committed Oct 6, 2023
2 parents 38db276 + 8616a6f commit 4409dca
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions implement/applications/eve-online/eve-online-mining-bot/Bot.elm
@@ -1,4 +1,4 @@
{- EVE Online mining bot version 2023-08-06
{- EVE Online mining bot version 2023-10-06
The bot warps to an asteroid belt, mines there until the mining hold is full, and then docks at a station or structure to unload the ore. It then repeats this cycle until you stop it.
If no station name or structure name is given with the bot-settings, the bot docks again at the station where it was last docked.
Expand Down Expand Up @@ -117,6 +117,7 @@ defaultBotSettings =
, botStepDelayMilliseconds = { minimum = 1300, maximum = 1500 }
, selectInstancePilotName = Nothing
, includeAsteroidPatterns = []
, miningSiteLocation = Nothing
}


Expand Down Expand Up @@ -224,6 +225,15 @@ parseBotSettings =
)
}
)
, ( "mining-site-location"
, { description = "Name of a mining site as it appears in the solar system surroundings menu of the game client."
, valueParser =
AppSettings.valueTypeString
(\location settings ->
{ settings | miningSiteLocation = Just location }
)
}
)
]
|> Dict.fromList
)
Expand Down Expand Up @@ -255,6 +265,7 @@ type alias BotSettings =
, botStepDelayMilliseconds : IntervalInt
, selectInstancePilotName : Maybe String
, includeAsteroidPatterns : List String
, miningSiteLocation : Maybe String
}


Expand Down Expand Up @@ -1217,12 +1228,22 @@ dockToStationOrStructureUsingSurroundingsButtonMenu { prioritizeStructures, desc
warpToMiningSite : BotDecisionContext -> DecisionPathNode
warpToMiningSite context =
useContextMenuCascadeOnListSurroundingsButton
(useMenuEntryWithTextContaining "asteroid belts"
(useRandomMenuEntry (context.randomIntegers |> List.head |> Maybe.withDefault 0)
(useMenuEntryWithTextContaining "Warp to Within"
(useMenuEntryWithTextContaining "Within 0 m" menuCascadeCompleted)
)
)
(case context.eventContext.botSettings.miningSiteLocation of
Nothing ->
useMenuEntryWithTextContaining "asteroid belts"
(useRandomMenuEntry (context.randomIntegers |> List.head |> Maybe.withDefault 0)
(useMenuEntryWithTextContaining "Warp to"
(useMenuEntryWithTextContaining "Within 0 m" menuCascadeCompleted)
)
)

Just miningSiteLocation ->
useMenuEntryWithTextContaining "location"
(useMenuEntryWithTextContaining miningSiteLocation
(useMenuEntryWithTextContaining "Warp to"
(useMenuEntryWithTextContaining "Within" menuCascadeCompleted)
)
)
)
context

Expand Down

0 comments on commit 4409dca

Please sign in to comment.