Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MultiBetween(str, s1, s2: string): TStringArray;
- var
- strL, s1L, s2L, o, n, e, r: Integer;
- begin
- s1L := Length(s1);
- s2L := Length(s2);
- strL := Length(str);
- if ((s1 <> '') and (s2 <> '') and (strL > (s1L + s2L))) then
- begin
- SetLength(Result, (strL - (s1L + s2L)));
- repeat
- n := PosEx(s1, str, (n + 1));
- if (n < 1) then
- Break;
- e := PosEx(s2, str, (n + 1));
- if (e < 1) then
- Break;
- repeat
- o := n;
- n := PosEx(s1, str, (n + 1));
- until ((n >= e) or (n < 1));
- n := o;
- Result[r] := Between(s1, s2, Copy(str, n, (s1L + (e + s2L))));
- if (Result[r] <> '') then
- Inc(r);
- until ((e < 1) or (n < 1));
- end;
- SetLength(Result, r);
- end;
- function GetThatNumber(page: string): string;
- var
- TSA: TStringArray;
- str: string;
- begin
- str := Between('Attack', '</tr>', GetPage(page));
- TSA := MultiBetween(str, '<td align="right">', '</td>');
- if (High(TSA) > 0) then
- Result := TSA[1]
- else
- Result := '';
- SetLength(TSA, 0);
- end;
- begin
- WriteLn(GetThatNumber('http://services.runescape.com/m=hiscore_oldschool/hiscorepersonal.ws?user1=n6p'));
- end.
Advertisement
Add Comment
Please, Sign In to add comment