Simba Code:
//mine
type
Bar = record
barType, oreType:String;
barXP, coalReq:Integer;
maxCasts, profit:Integer;
end;
//yours
type
BarVar = record
name : string;
oreTextArray : TStringArray;
xpGain : extended;
coalNeeded : integer;
end;
Simba Code:
//mine
function getProfitBar(oreName, barName:String; coalAmt:Integer):integer;
var
orePrice, barPrice, natPrice:Integer;
begin
orePrice := getItemPrice(oreName, 1);
barPrice := getItemPrice(barName, 1);
natPrice := getitemPrice('Nature_rune', 1);
Result := barPrice - orePrice - natPrice - (coalAmt * getItemPrice('Coal', 1));
end;
//yours
function calculateProfit(): integer;
begin
orePrice := getItemPrice(barVariables.oreTextArray[2], 1);
barPrice := getItemPrice(barVariables.oreTextArray[3], 1);
natPrice := getitemPrice('Nature_rune', 1);
coalPrice := barVariables.coalNeeded * getItemPrice('Coal', 1);
Result := barPrice - coalPrice - orePrice - natPrice;
end;