I see there is code to activate hardeners. I am wondering how I would activate a “Small Shield Booster II” when damage from rats is occuring.
Thank you.
I see there is code to activate hardeners. I am wondering how I would activate a “Small Shield Booster II” when damage from rats is occuring.
Thank you.
I see there is code to activate hardeners. I am wondering how I would activate a “Small Shield Booster II” when damage from rats is occuring.
Thank you.
The first thing which comes to mind is that so far the only way to activate a module is to toggle it when it is not yet active. So first I check whether it is active already by using the property “RampActive” (The ramp is the circle segment on the module representation in the ShipUI). For the toggling part, I suggest you use the function from https://github.com/Arcitectus/Sanderling/blob/932403ffdd7e705ff34528012c3ecf4745f356b8/src/Sanderling/Sanderling.Exe/sample/script/Mine.ore.cs#L507-L517
You can obtain references to all Modules from
Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
Then you will need a function to decide for a given module whether it is a “Small Shield Booster II”.
In the current version you can only make this check by looking at the module tooltip which can be triggered by hovering the mouse over the module.
You could use the method “ModuleMeasureAllTooltip” from the mining script to let the bot measure the tooltips of all modules. The bot will then remember those as long as the modules are visible. You can find the function at https://github.com/Arcitectus/Sanderling/blob/932403ffdd7e705ff34528012c3ecf4745f356b8/src/Sanderling/Sanderling.Exe/sample/script/Mine.ore.cs#L474-L491
When the tooltip of the module has been measured, you get references to all the labels in the tooltip using this path:
YourModuleReference?.TooltipLast?.Value?.LabelText
If you wanted to use any Shield Booster, you would just use the property “IsShieldBooster”.