That solved it. Thanks a lot, Homer 
Simba Code:
program new;
var
text, text1: string;
int: integer;
function TrimLetters(s : string) : string;
var
LetterArray: TStringArray;
i: Integer;
begin
LetterArray := ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',
'p','q','r','s','t','u','v','w','x','y','z', '.', ',', ' '];
result := s;
for i := 0 to Length(LetterArray) - 1 do
result := Replace(result, LetterArray[i], '', [rfReplaceAll, rfIgnoreCase]);
end;
begin
ClearDebug;
text := GetTextAtEx(296, 186, 440, 199, 0, 0, 0, 6400255, 5, 'UpChars');
text1 := TrimLetters(text);
int := StrToInt(text1);
Writeln(int);
end.
But now I'm left with another problem; I get this error when I try to include SRL in the script
Code:
[Error] (18:80): Invalid number of parameters at line 17
Compiling failed.
Simba Code:
program new;
{$i SRL/SRL.scar}
{$i srl/srl/misc/grandexchange.scar}
var
text, text1: string;
int: integer;
function TrimLetters(s : string) : string;
var
LetterArray: TStringArray;
i: Integer;
begin
LetterArray := ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',
'p','q','r','s','t','u','v','w','x','y','z', '.', ',', ' '];
result := s;
for i := 0 to Length(LetterArray) - 1 do
result := Replace(result, LetterArray[i], '', [rfReplaceAll, rfIgnoreCase]);
end;
begin
SetupSRL;
ClearDebug;
text := GetTextAtEx(296, 186, 440, 199, 0, 0, 0, 6400255, 5, 'UpChars');
text1 := TrimLetters(text);
int := StrToInt(text1);
Writeln(int);
end.
The same also happens with the GetTextAtEx(....) function. It seems that both simba and SRL have the same function and there is now way that I know off to tell the scipt which function to use :S