Приходит пакет "pet status update":
Код:
B6 01 00 00 00 9B 79 0E 10 08 33 02 00 48 3B 02 00 08 D1 FF FF 4B 00 69 00 6C 00 6C 00 43 00 6F 00 6F 00 6C 00 00 00 04 04 98 00 80 96 98 00 D0 41 00 00 D0 41 00 00 31 09 00 00 A9 09 00 00 53 00 00 00 00 19 F5 C1 02 00 00 00 00 19 F5 C1 02 00 00 00 00 31 40 9A 03 00 00 00
Часть скрипта:
Код:
Const name=''
Var a : array[1..100] of string;
i,curhppos,curmppos : integer;
curmp,curhp,maxhp,maxmp,curhphex,curmphex : string;
procedure Send2Msg(msg:string);
begin
buf:=#$4A;
WriteD(0);
WriteD(10);
WriteS('');
WriteS(msg);
SendToClient;
end;
BEGIN
if (connectname=name) and (pck[1]=#$B6) and (fromserver) then
begin
for i:=1 to length(pck) do
a[i]:=pck[i];
{###############analiz curhp###############}
for i:=1 to length(pck) do
begin
if (a[i]=#$86) and (a[i+1]=#$96) and (a[i+2]=#$98) and (a[i+3]=#$00) then
curhppos:=i+4;
end;
curhphex:='#$'+a[curhppos]+'#$'+a[curhppos+1]+'#$'+a[curhppos+2]+'#$'+a[curhppos+3];
curhp:=ReadD(curhphex);
Пишет несоответствие типов.
В чем я ошибся и как считать хп нормально?