Код:
// Îòôèëüòðîâàòü ïàêåòû 0A, 04, 14, C5
const
name1 = 'bbpulse' ; //Íèê òîãî íà êîãî íàáèâàåì ïâï
name2 = 'glpulse' ; //Íèê òîãî ñ êîãî ñëèâàåì ïâï (òâèíê 1 ëâë)
ObjectID = '0A 28 D5 80 48' ; //èä òâèíêà
ObjectID2 = '0A 60 E8 80 48' ; //èä ìåéíà
target = '04 28 D5 80 48' ; //Òàðãåò ïî òâèíêó
useitem = '14 2C 9E 12 40 00 00 00 00' ; //Þçàíèå ðåñà ïî òâèíêó
var
Timer01:TTimer; //Òàéìåð íà÷àëà àòàêè òâèíêîì ïî ìåéíó
TimerCyrcle01:Integer;
k,karma: integer;
procedure Init;
begin
Timer01 := TTimer.Create(nil) ;
Timer01.Interval := 1500;
Timer01.Enabled := True ;
Timer01.Ontimer := @OnTimer01 ;
end;
procedure Free;
begin
Timer01.Free ;
end;
Procedure OnTimer01(Sender : TObject) ;
begin
case TimerCyrcle01 of
1: begin buf := hstr(ObjectID2) ;
SendToServerEx(name2) ;
end;
end;
end;
begin
if FromServer and (connectname=name1) and (pck[1] = #$05) then //Ìåéí îòâå÷àåò íà ôëàã òâèíêà
begin
buf:=Hstr(ObjectID);
sendtoserverex(name1);
end;
if FromServer and (connectname=name2) and (pck[1] = #$5E) then //Ïðè òðåéäå çàïóñêàåòñÿ òàéìåð àòàêè òâèíêîì ïî ìåéíó
begin
TimerCyrcle01:=1;
Timer01.enabled:=true;
end;
{if FromClient and (connectname=name2) and (pck[1] = #$37) then //Ïðè ñíÿòèè òàðãåòà ñ ìåéíà îñòàíàâëèâàåò òàéìåð
begin
Timer01.enabled:=false;
end;}
if FromServer and (connectname=name1) and (pck[1] = #$2A) then //Ïðè ñíÿòèè òàðãåòà ñ ìåéíà áåðåò â òàðãåò òâèíêà è âîñêðåøàåò
begin
buf:=HStr(target) ;
SendToServerEx(name1) ;
buf:=Hstr(useitem) ;
SendToServerEx(name1) ;
end;
if FromServer and (connectname=name2) and (pck[1] = #$ED) then //Îòâåòèòü "Äà" â äèàëîãå ñîãëàñíû ëè âîñêðåñèòñÿ
begin
buf:=Hstr('C5 E6 05 00 00 01 00 00 00') ;
SendToServerEx(name2) ;
TimerCyrcle01:=1;
Timer01.enabled:=true;
end;
{if FromServer and (connectname=name1) and (pck[1]=#$04) then begin
k:=22;
ReadS(k);
k:=k+62*4;
karma:=ReadD(k);
// if (karma>1) then
// begin
// buf:=hstr('38 6B 00 61 00 72 00 6D 00 61 00 61 00 61 00 00 00 00 00 00 00') ;
buf:=#$38;
WriteS('1');
WriteD(1);
SendToServerEx(dance) ;
//end;
end; }
end.