Simba Code:
//The check if a settings file is already around, and if so, load those settings into our form
procedure LoadForm(Sender: TObject);
var
equipmentList: TStringArray;
i: integer;
begin
SaveFileName:= AppPath + comboBoxes[2].ITEMS[comboBoxes[2].ITEMINDEX];//Read's the combo box that contains the file name options (players) and sets it as the designated load from file
if(not FileExists(SaveFileName))then
Exit;//don't load something that doesn't exist
try//fill in all the text and whatnot boxes with the values saved in the file.
textBoxes[0].Caption:= ReadINI('Settings', 'PlayerName', SaveFileName);
textBoxes[1].Caption:= ReadINI('Settings', 'PlayerPassword', SaveFileName);
textBoxes[2].Caption:= ReadINI('Settings', 'PlayerPin', SaveFileName);
textBoxes[3].Caption:= ReadINI('Settings', 'HealthToRun', SaveFileName);
textBoxes[4].Caption:= ReadINI('Settings', 'HealthToEat', SaveFileName);
textBoxes[5].Caption:= ReadINI('Settings', 'FoodString', SaveFileName);
textBoxes[6].Caption:= ReadINI('Settings', 'BreakLengthMin', SaveFileName);
textBoxes[7].Caption:= ReadINI('Settings', 'BreakLengthMax', SaveFileName);
textBoxes[8].Caption:= ReadINI('Settings', 'TimeTillBreakMin', SaveFileName);
textBoxes[9].Caption:= ReadINI('Settings', 'TimeTillBreakMax', SaveFileName);
textBoxes[10].Caption:= ReadINI('Settings', 'UltimateSlot', SaveFileName);
textBoxes[11].Caption:= ReadINI('Settings', 'ThresholdSlot', SaveFileName);
textBoxes[12].Caption:= ReadINI('Settings', 'MaxPlayers', SaveFileName);
textBoxes[13].Caption:= ReadINI('Settings', 'FoodQuantity', SaveFileName);
comboBoxes[0].ItemIndex:= StrToInt(ReadINI('Settings', 'TotalXPBar', SaveFileName));
comboBoxes[1].ItemIndex:= StrToInt(ReadINI('Settings', 'SlayerXPBar', SaveFileName));
checkBoxes[0].Checked:= StrToBool(ReadINI('Settings', 'ImplementBreaks', SaveFileName));
checkBoxes[1].Checked:= StrToBool(ReadINI('Settings', 'AFKBreaks', SaveFileName));
checkBoxes[2].Checked:= StrToBool(ReadINI('Settings', 'SmartProggy', SaveFileName));
checkBoxes[3].Checked:= StrToBool(ReadINI('Settings', 'TextProggy', SaveFileName));
checkBoxes[4].Checked:= StrToBool(ReadINI('Settings', 'SmartDebug', SaveFileName));
checkBoxes[5].Checked:= StrToBool(ReadINI('Settings', 'ObjectDebug', SaveFileName));
checkBoxes[6].Checked:= StrToBool(ReadINI('Settings', 'TextDebug', SaveFileName));
checkBoxes[7].Checked:= StrToBool(ReadINI('Settings', 'LootEffigies', SaveFileName));
checkBoxes[8].Checked:= StrToBool(ReadINI('Settings', 'LootSpecialBones', SaveFileName));
checkBoxes[9].Checked:= StrToBool(ReadINI('Settings', 'LootCharms', SaveFileName));
checkBoxes[10].Checked:= StrToBool(ReadINI('Settings', 'LootStuff', SaveFileName));
checkBoxes[11].Checked:= StrToBool(ReadINI('Settings', 'UsePotions', SaveFileName));
except
WriteLn('The file you chose to load has an error in it!');
end;
end;