var act:integer; e1:char; e2:char; e3:char; e4:char; ne:integer; i1:char; i2:char; i3:char; i4:char; ni:integer; x1:char; x2:char; x3:char; x4:char; y1:char; y2:char; y3:char; y4:char; z1:char; z2:char; z3:char; z4:char; nk:integer; act2:integer;tac:integer;
procedure SendMsg(msg:string); 
begin 
buf:=#$4A; 
WriteD(0); 
WriteD(10); 
WriteS(''); 
WriteS(msg); 
SendToClient; 
end;
begin
if FromClient and (pck[1]=#$1B) and (pck[2]=#$07) then 
begin 
nk:=1; 
SendMsg('Reset position'); 
end;
if FromClient and (pck[1]=#$1B) and (pck[2]=#$06) then 
begin 
ni:=1; 
SendMsg('Reset item ID'); 
end;
if FromClient and (pck[1]=#$1B) and (pck[2]=#$05) then 
begin 
ne:=1; 
SendMsg('Reset ench ID'); 
end;
if FromClient and (pck[1]=#$58) then 
begin 
if ni=1 then 
begin 
i1:=pck[2]; 
i2:=pck[3]; 
i3:=pck[4]; 
i4:=pck[5]; 
ni:=0; 
SendMsg('Item ID captured'); 
end; 
end;
if FromClient and (pck[1]=#$14) then 
begin 
if ne=1 then 
begin 
e1:=pck[2]; 
e2:=pck[3]; 
e3:=pck[4]; 
e4:=pck[5]; 
ne:=0; 
SendMsg('Ench ID captured'); 
end; 
end;
if FromClient and (pck[1]=#$12) then 
begin 
if nk=1 then 
begin 
x1:=pck[10]; 
x2:=pck[11]; 
x3:=pck[12]; 
x4:=pck[13]; 
y1:=pck[14]; 
y2:=pck[15]; 
y3:=pck[16]; 
y4:=pck[17]; 
z1:=pck[18]; 
z2:=pck[19]; 
z3:=pck[20]; 
z4:=pck[21]; 
nk:=0; 
SendMsg('Position captured'); 
end; 
end;
if FromClient and (pck[1]=#$1B) and (pck[2]=#$03) then 
begin 
act:=1; 
act2:=1; 
SendMsg('Fake ON'); 
end;
if FromClient and (pck[1]=#$1B) and (pck[2]=#$04) then 
begin 
act:=0; 
SendMsg('Fake OFF'); 
end;
if act=1 then 
begin
if FromClient and (pck[1]=#$58) then 
begin 
i1:=pck[2]; 
i2:=pck[3]; 
i3:=pck[4]; 
i4:=pck[5]; 
buf:=#$12 + i1+i2+i3+i4 + #$01#$00#$00#$00 + x1+x2+x3+x4+y1+y2+y3+y4+z1+z2+z3+z4; 
SendToServer; 
end;
if FromClient and (pck[1]=#$1B) and (pck[2]=#$08) then 
begin 
buf:=#$14 + e1+e2+e3+e4 + #$00#$00#$00#$00; 
SendToServer; 
act2:=0; 
tac:=2; 
end;
if FromClient and (pck[1]=#$1B) and (pck[2]=#$09) then 
begin 
buf:=#$12 + i1+i2+i3+i4 + #$01#$00#$00#$00 + x1+x2+x3+x4+y1+y2+y3+y4+z1+z2+z3+z4; 
SendToServer; 
buf:=#$58 +i1+i2+i3+i4; 
SendToServer; 
act2:=0; 
tac:=3; 
end;
end;
end.
