Показать сообщение отдельно
Старый 15.12.2009, 01:31   #322
Рыцарь
 
Аватар для TAMBIK
 
Регистрация: 03.03.2009
Сообщений: 773
Сказал Спасибо: 361
Имеет 300 спасибок в 168 сообщенях
TAMBIK на пути к лучшему
По умолчанию

l2rx
Код:
//  Заточить предмет один раз
//  СТАРТ нажать соцдействие ДА
//  СТОП нажать соцдействие  НЕТ
//  Kamael-Hellbound 
  const
   nik='TAMBIK'; //<<== пишем свой НИК
   Enchant=16;  //<<== пишем Уровень Заточки

   var
   Timer01: TTimer;
   Timer02: TTimer;
   UseItem,EnchantItem:string;
   LVL,ObjectID,count:integer;
   autostart:Boolean;
 //========================
procedure SendMsg2(msg:string);
begin 
  buf:=#$4A;
  WriteD(0);
  WriteD(3);// <<= куда выводить сообщения -> пати чат
  WriteS('');
  WriteS(msg);
  SendToClientEx(nik);
end;
//=======================
procedure Init;
begin
ObjectID:=-1;
LVL:=0;
autostart:=false;

 Timer01:=TTimer.Create(nil);
 Timer01.OnTimer:=@OnTimer01;
 Timer01.enabled:=false;
 Timer01.interval:=1300; //<<== время  выбора свитка

 Timer02:=TTimer.Create(nil);
 Timer02.OnTimer:=@OnTimer02;
 Timer02.enabled:=false;
 Timer02.interval:=1300; //<<== время  заточки
SendMsg2( ' Привет от TAMBIKa' );
end;
procedure Free;
begin
 Timer01.free; 
 Timer02.free; 
end;
//=======================
procedure OnTimer01(Sender:TObject);
begin
  buf:=UseItem;
  SendToServerEx(nik);
  Timer01.enabled:=false;
end;
//=======================
procedure OnTimer02(Sender:TObject);
begin
  buf:=EnchantItem;
  SendToServerEx(nik);
  Timer02.enabled:=false;
end;
//=======================
procedure InventoryUpdate;
begin
if (ReadD(8) = ObjectID) then begin
    LVL:=ReadH(34); 
    SendMsg2( ' Enchant  =  '+IntToStr(LVL)+'   свитков : '+IntToStr(ReadH(94))+'' );
    end; 
if (ReadD(82) = ObjectID) then begin
    LVL:=ReadH(108);
    SendMsg2( ' Enchant  =  '+IntToStr(LVL)+'   свитков : '+IntToStr(ReadH(20))+' ' );
    end; 
 if (LVL < Enchant) and autostart then Timer01.enabled:=true;
 if (LVL = Enchant) then SendMsg2( '  ПРЕДМЕТ ЗАТОЧЕН  ! ! !' );
 SendMsg2( '............' ); 
end;
begin
  
  if FromServer and (pck[1]=#$21) then InventoryUpdate;
  if FromServer and autostart and (pck[1]=#$7C) then Timer02.enabled:=true;
  if FromClient and (pck[1]=#$19) then begin UseItem:=pck;end;
  if FromClient and (pck[1]=#$5F) and (ReadD(2) > -1) then begin
         ObjectID:=ReadD(2);
         EnchantItem:=pck;
         end;
  if FromClient and (pck[1]+pck[2]=#$34#$05) then autostart:=false;
  if FromClient and (pck[1]+pck[2]=#$34#$06) then begin
      autostart:=true;
      Timer01.enabled:=true;
    pck:='';
   end;
end.
__________________
Тут не форум гадалок, если ты делаешь все правильно и по пунктам - то все должно работать
TAMBIK вне форума   Ответить с цитированием