Разбирайся
Код:
Program Taming;
var
aList,H,K,C,i,j,g,ID,PRI: LongInt;
aType: Word;
S: String;
begin
GetCharsList(aList, False);
GetListCount(aList, K);
while true do
begin
for i:=0 to K-1 do
begin
GetJournalNew;
GetListItem(aList,i,H,S);
GetCharInfo(H,aType,ID);
SetLastTarget(ID)
SendKey(k_F4); //UseSkill Taming - WaitForTarget - LastTarget
PRI:=0; j:=0;
while (PRI=0) and (j < 19) do
begin
j:=j+1;
Delay(1000);
GetJournalNew;
GetJournalCount(C);
for g:=0 to C-1 do
begin
GetJournalString(g,j_LowerCase,S);
if (pos('see the target',S)>0) or (pos('lack skill',S)>0)then PRI:=1;
if (pos('seems to accept',S)>0) or (pos('too far',S)>0)then PRI:=1;
if (pos('already tame',S)>0) then PRI:=1;
if (pos('fail to tame',S)>0) and (PRI<>1) then PRI:=2;
end;
end;
if (PRI=1) then Say('All release');
if (PRI=2) and (i>0) then i:=i-1;
end;
end.