Цитата:
Сообщение от mks
Переделал для тех у кого 1й скрипт работает, но не останавливается заточив до указанного уровня:
delphi Код:
const
nik='xxxx';
Enchant=30;
var
UseItem, EnchantItem: string;
Count, CurrentEnch: integer;
Timer01: TTimer;
procedure Init;
begin
Timer01:=TTimer.Create(nil);
Timer01.OnTimer:=@OnTimer01;
Timer01.enabled:=false;
Timer01.interval:=500;
end;
procedure OnTimer01(Sender: TObject);
begin
buf:=UseItem;
SendToServerEx(nik);
buf:=EnchantItem;
SendToServerEx(nik);
end;
procedure Free;
begin
Timer01.free;
count:=0;
CurrentEnch:=0;
end;
begin
if FromServer and (pck[1]=#$87) then case ReadD(2) of
0: begin
CurrentEnch:=CurrentEnch+1;
if CurrentEnch=Enchant then Timer01.enabled:=false;
end;
2: CurrentEnch:=0;
end;
if FromClient and (pck[1]=#$19) then UseItem:=pck;
if FromClient and (pck[1]=#$5F) then EnchantItem:=pck;
if FromClient and (pck=#$34#$02#$00#$00#$00) then
begin
pck:='';
Timer01.enabled:=not(Timer01.enabled);
end;
end.
|
У меня твой скрипт теперь точно не видит конца...раньше он с раза второго понимал до скольки точить, а этот точит пока точки не кончаться...
Добавлено через 11 минут
Цитата:
Сообщение от mks
я думаю это просто была очепятка со стороны NLObP
имелось в виду:
if (ReadD(12)=ID_предмета) and (ReadD(34)=уровень заточки) then что_хотим_сделать;
а да, ID предмета и уровень заточки тут писать в десятичном виде (как обычные люди считают)
delphi Код:
const
Name='HORSE';
var
timer:TTimer;
x:byte; //îïðåäåëåíèå, êàêîäå äåéñòâèå ïî ñ÷åòó ìû ñîâåðøàåì
procedure Init;
begin
timer:=TTimer.Create(nil);
timer.interval:=150;
timer.OnTimer:=@fireTimer;
timer.enabled:=true;
x:=1;//ñíà÷àëà õ=1
end;
procedure Free;
begin
timer.Free;
end;
procedure fireTimer(Sender: TObject);
begin
case x of
1:begin
buf:=hstr('5F 48 65 BF 19 00 00 00 00 ');
SendToServerEx(Name);
inc(x);
end;
2:begin
buf:=hstr('5F 48 65 BF 19 00 00 00 00 ');
SendToServerEx(Name);
x:=1;
end;
end;{case}
end;
//кусок ниже ты получается влепил в таймер, пришлось расставить еще пару end; и begin;
begin
if FromServer then
begin
case pck[1] of
#$21: begin //InventoryUpdate
if (ReadD(12)=9456) and (ReadD(34)=5) then timer.enabled:=false;;
end;
end;
end;
end.
ЗЫ в алгоритм твоего скрипта не вникал, поправил синтаксис
|
Ввел все данные..точит отлично...не перетачивает=))))
Можете забирать)))СКРИПТ РОБОЧИЙ!!!!!!!!!!
БОЛЬШОЕ СПАСИБО mks и NLObP за то что сделали почти всё=))))И не послали меня на ***
!!!!!