Нескрываю, переделаный скрипт на карпентри, спасибо тому, кто писал на карпу, но я очень старался =)
Code: Select all
Program Tailor;
var
ItemCostHide,TotalHides,i: integer;
stime : TDateTime;
Trash,TempHides : cardinal; 
HideType,ItemType,ToolType : word; 
ItemGump:string;
{$Include 'all.inc'} 
procedure FullDisconnect; 
begin 
SetARStatus(false); 
Disconnect; 
end; 
function timer(var acttimer:integer;actafter:integer):boolean; 
begin 
result:=false; 
acttimer:=acttimer+1; 
if acttimer>=actafter then 
begin 
   acttimer:=0; 
   result:=true;        
end; 
end; 
procedure Checktools; 
begin 
WaitConnection(3000); 
checksave; 
findtype(ToolType,backpack); 
if (findcount > 0) then Exit; 
findtype(ToolType,ground); 
if (findcount > 0) then 
begin 
Grab(finditem,1) 
Exit; 
end; 
Addtosystemjournal('нету тейлор тусов, логаут'); 
FullDisconnect; 
while true do wait(1000); 
end; 
procedure CheckHides; 
Label a1st; 
begin 
WaitConnection(3000); 
checksave; 
if (GetQuantity(TempHides) >= ItemCostHide) then Exit; 
a1st: 
WaitConnection(3000); 
findtype(HideType,ground); 
if findcount = 0 then 
begin 
Addtosystemjournal('закончилась кожа, или не найдена, логаут'); 
FullDisconnect; 
while true do wait(1000); 
end; 
if findquantity < ItemCostHide then 
begin 
Ignore(finditem); 
goto a1st; 
end 
else TempHides:=finditem; 
end; 
procedure MoveMakeItem;
begin
findtype(ItemType,backpack);
if findcount > 0 then 
begin
ClickOnObject(finditem); {контроль за цветом и типом производимой вещи}
repeat
Checksave;
moveitem(findtype(ItemType,backpack),1,Trash,0,0,0);
until findcount < 1
end;       
end;
Begin 
{===============================================================================
======================================}
ItemGump:='хххх';       {номер гампа делаемого итема}
ItemType:=$хххх;        {тайп делаемого итема}
ToolType:=$хххх;        {тайп инструмета}
HideType:=$хххх;        {тайп кожи}
Trash:=$хххххххх;       {ID мусорника}
ItemCostHide:=х;        {кол-во кожи требуемое на 1 итем}
{===============================================================================
======================================}
FindDistance := 2;
SetARStatus(true); 
TempHides:=0; 
Clearjournal; 
if connected then hungry(1,ground); 
while not dead do 
begin  
if targetpresent then canceltarget;  
MoveMakeItem; 
CheckTools; 
CheckHides;
WaitConnection(2000); 
checksave; 
CheckTargetError(2,2);
stime := Now;
WaitGump(ItemGump);
WaitTargetObject(TempHides); 
UseObject(FindType(ToolType,backpack));
 
repeat 
CheckSave;
InJournalBetweenTimes('destroy|make|create|made|already', stime, Now); 
wait(50); 
until (LineCount > 0) or (Now > stime + (1.0/1440)); 
if timer(i,100) then 
begin
Hungry(1,ground);
FindType(HideType,ground);
TotalHides:=FindFullQuantity;
AddToSystemJournal('Осталось '+IntToStr(TotalHides)+' кожи ');
end; 
end;
End.

