function GetParam LeftWord RightWord string var Text string string var

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function GetParam(LeftWord,RightWord:string;var Text:string):string;
var i:Integer;
begin
i:=pos(LeftWord,Text);
if i<>0
then
begin
i:=i+Length(LeftWord)-1;
Delete(Text,1,i);
Result:=Copy(Text,1,Pos(rightWord,Text)-1);
end
else Result:='';
end;
procedure GetUserInfo(resp:string;var user:TUserInfo);
begin
delete(resp,1,pos('class="rbg"',resp));
//имя юзера
user.name:=GetParam('>','<',resp);
//ранг
delete(resp,1,pos('class="s7"',resp)+10);
user.rang:=Bild_lvl(GetParam('<td class="s7">','</td>',resp));
//расса
delete(resp,1,pos('class="s7"',resp)+10);
GetParam('<td>','</td>',resp);
user.rase:=GetParam('<td>','</td>',resp);
//альянс
delete(resp,1,pos('class="s7"',resp)+10);
GetParam('<td>','</td>',resp);
user.Allianz:=GetParam('<td>','</td>',resp);
if pos('href',user.Allianz)<>0 then user.Allianz:=GetParam('>','<',resp)
else user.Allianz:='-';
//сколько деревень
delete(resp,1,pos('class="s7"',resp)+10);
GetParam('<td>','</td>',resp);
user.MaximumVillage:=Bild_lvl(GetParam('<td>','</td>',resp));
//население
delete(resp,1,pos('class="s7"',resp)+10);
GetParam('<td>','</td>',resp);
user.Population:=Bild_lvl(GetParam('<td>','</td>',resp));
end;