I bet it would involve using in-game time but I’m not sure how to go about it. I am trying to make my current script as efficient as possible and some commands require additional delay( botStepDelayMilliseconds is too low for some).
How could I implement a function that essentially wait for a designed amount of time? (EDIT: maybe I could double/triple the botstepsdelay instead? Using delayInMilliSeconds as a multiplier)
What I have in mind is
botStepDelayMultiplier : BotDecisionContext -> Int -> Maybe DecisionPathNode
botStepDelayMultiplier context delayMultiplier
let
currentTime =
context.eventContext.timeInMilliseconds
currentTimeSnapshot =
context.memory.timeInMillisecondsSnapshot
delayedTime =
currentTimeSnapshot + (delayMultiplier * context.eventContext.appSettings.botStepDelayMilliseconds)
in
if currentTime < delayedTime then
Just waitForProgressInGame
else
Nothing
Would something like this be possible?
All these functions are meta programming. I dont have any of them but they would essentially do what their name says.
I would use like such to double or triple the botsteps delay in front of some commands.
As you mentioned, use multiply the default base delay time.
Setting the delay in milliseconds.
Let’s look at both in more detail.
Multiplying the default base delay time
To complete the implementation you already started, we can copy from existing implementations.
I did a quick search and found two implementations of this approach.
The second example is better. It also has a detailed discussion of the design and breaks the programming down into steps: Adding a delay to undock
Setting the delay in milliseconds
When your target time is less than two steps away, use this approach for more fine-grained control of the delay. To implement this in your app, you only need to apply EveOnline.AppFrameworkSeparatingMemory.setMillisecondsToNextReadingFromGameBase on the decision value that you return from your policy function:
In other words, the type of the values you use this function on is the same as for the more often used describeBranch.
Here is an example code using it in an EVE Online bot:
(describeBranch "Click on the module."
(EveOnline.AppFrameworkSeparatingMemory.setMillisecondsToNextReadingFromGameBase 3333
(decideActionForCurrentStep
(inactiveModule.uiNode |> clickOnUIElement MouseButtonLeft)
)
)
)
Updated my mining bot to the latest version. Took an hour or so. Should be faster for my other scripts.
The flow seems to be much faster. Probably because there is no default botstepdelay. Makes sense that we can customize it with setMillisecondsToNextReadingFromGameBase.