How to optimize the function

bool OreHoldFilledForOffload()
string OreHoldString = Measurement.WindowInventory[0].SelectedRightInventoryCapacity.Text;
String[] OreHoldStringSplit = OreHoldString.Split(’/’);
String[] OreHoldStringSplit1 = OreHoldStringSplit[1].ToString().Split(’ ');
var OreHoldFillPercent = float.Parse(OreHoldStringSplit[0])/float.Parse(OreHoldStringSplit1[0])*100;
if( OreHoldFillPercent >= EnterOffloadOreHoldFillPercent)
return true;
return false;

What about replacing the float.Parse calls with using the numeric ore hold capacity values available from the parsed memory measurement?

Sanderling already contains a lot of parsing code, also for the ore hold capactiy. You can read the parsed version of the memory measurement from Sanderling.MemoryMeasurementParsed (

You can find the state of the hold at this path: Sanderling.MemoryMeasurementParsed.Value.WindowInventory[0].SelectedRightInventoryCapacityMilli

It implements the following interface:

public interface IInventoryCapacityGauge
	long? Used { get; }
	long? Max { get; }
	long? Selected { get; }