From: DemiseScythe
You could gethttp with a php server running MySQL. Then you can use databases with simba. It is a lot more work but if you want a database, I see no other choice currently.
writing to a file:
const
currentXP = 5000;
function scriptfileExists():boolean;
begin
result := fileExists(appPath + 'scriptName.txt');
end;
procedure createScriptFile();
var
tmpFile:integer;
begin
if (scriptFileExists) then
exit()
else begin
tmpFile := createFile(appPath + 'scriptName.txt');
closeFile(tmpFile);
end;
end;
function getScriptXP():integer;
var
tmpFile:integer;
s:string;
begin
tmpFile := openFile(appPath + 'scriptName.txt', true);
readFileString(tmpFile, s, fileSize(tmpFile));
try
result := strToInt(s);
except
finally
closeFile(tmpFile);
end;
end;
procedure updateScriptFile();
var
tmpFile, prevXp:integer;
begin
if (not scriptfileExists()) then
createScriptFile()
else begin
prevXP := getScriptXP();
tmpFile := rewriteFile(appPath + 'scriptName.txt', true);
writeFileString(tmpFile, toStr(currentXP + prevXP));
closeFile(tmpFile);
end;
end;
begin
createScriptFile();
addOnTerminate('updateScriptFile');
end.
when the script terminates it will add how ever much xp was gained