ChangeTailorBODs  
 Code: Select all
Program ChangeTailorBODs;
{
Autor: Half-Life;
Description: Скрипт для сдачи бодов тейлора в луне. Потому что в луне можно реварды сразу в банк скидывать. Запускаете скрипт, таргетом на вендора, потом таргетом на полную книгу и таргетом на пустую книгу. В конце работы скрипта ткань полученная за боды, обесцвечивается и скидывается в сумку для использования при заполнении новых бодов.
UOStealthClientVersion: 6.2.1;
Warning! Будьте бдительны! - Администрация многих игровых серверов враждебно относится к использованию стелс клиента на своих серверах. Заподозрив вас в использовании стелс клиента и других неправославных программ они начинают сатанеть и в порыве слепой ярости могут попасть по вам Банхаммером;
}
const
RestockBag=$40087344; // ID мешка куда сбрасывать обесцвеченную ткань.
DyeTub=$400E3A21; // ID краски.
BODType=$2258; // Тип бода.
ClothType=$1767; // Тип ткани.
GoldType=$0EED; // Золото
WaitTime=500;
WaitLag=10000;
WaitCycles=7;
var
BOD,Vendor,BulkSource,BulkDestination,BankBox:Cardinal;
Procedure TargetVendor;
var
VendorName:String;
Res:Boolean;
begin
  ClientPrint('Укажите вендора');
  While not Res and not dead do
  begin
    ClientRequestObjectTarget;
    WaitForClientTargetResponse(50000);
    if ClientTargetResponsePresent then
    Vendor:=ClientTargetResponse.ID;
    VendorName:=GetCliloc(Vendor);
    Wait(WaitTime);
    if VendorName <> '' then Res:=True;
  end;
  UoSay(VendorName);
  UoSay('bank');
end;
Procedure TargetBulkSource;
var
Res:Boolean;
begin
  ClientPrint('Укажите откуда брать боды');
  While not Res and not dead do
  begin
    ClientRequestObjectTarget;
    WaitForClientTargetResponse(50000);
    if ClientTargetResponsePresent then
    BulkSource:=ClientTargetResponse.ID;
    if BulkSource <> 0 then Res:=True;
  end;
  UseObject(BulkSource);
  Wait(WaitTime);
  CheckLag(WaitLag);
  If GetGumpID(GetGumpsCount-1)<>$54F555DF then TargetBulkSource;
  WaitGump('1');
  Wait(WaitTime);
  CheckLag(WaitLag);
  WaitGump('3');
  Wait(WaitTime);
  CheckLag(WaitLag);
  WaitGump('0');
  Wait(WaitTime);
  CheckLag(WaitLag);
  while IsGump do CloseSimpleGump(GetGumpsCount-1);
end;
Procedure TargetBulkDestination;
var
Res:Boolean;
begin
  ClientPrint('и куда ложить');
  While not Res and not dead do
  begin
    ClientRequestObjectTarget;
    WaitForClientTargetResponse(50000);
    if ClientTargetResponsePresent then
    BulkDestination:=ClientTargetResponse.ID;
    if BulkDestination <> 0 then Res:=True;
  end;
end;
procedure GetBOD;
var
StartTime:TDateTime;
begin
  ClearJournal;
  StartTime:=Now;
  CheckLag(WaitLag);
  SetContextMenuHook(Vendor, 1);
  RequestContextMenu(Vendor);
  Wait(250);
  if InJournalBetweenTimes('An offer', StartTime, Now) > 0 then Exit;
  If GetGumpID(GetGumpsCount-1)<>$9BADE6EA then GetBOD;
  WaitGump('1');
  Wait(250);
  CheckLag(WaitLag);
  FindType(BODType, backpack);
  while FindCount > 0 do begin
    MoveItem(finditem,1,BulkDestination,0,0,0);
    Wait(250);
    CheckLag(WaitLag);
    FindType(BODType, backpack);
  end;
  while IsGump do CloseSimpleGump(GetGumpsCount-1);
end;
procedure SearchBOD;
var
StartTime:TDateTime;
begin
  StartTime:=Now;
  FindType(BODType, backpack);
  if (finditem<>0) then
  begin
    BOD:=finditem;
  end
  else begin
    UseObject(BulkSource);
    Wait(250);
    CheckLag(10000);
    if InJournalBetweenTimes('The book is empty.', StartTime, Now) > 0 then begin
      AddToSystemJournal('Закончились Боды');
      Terminated:=False;
      Exit;
    end;
    If GetGumpID(GetGumpsCount-1)<>$54F555DF then SearchBOD;
    Waitgump('5');
    Wait(500);
    while IsGump do CloseSimpleGump(GetGumpsCount-1);
    FindType(BODType, backpack);
    BOD:=FindItem;
  end;
  while FindCount > 0 do begin
    MoveItem(FindItem,1,Vendor,0,0,0);
    Wait(WaitTime*2);
    FindType(BODType, backpack);
  end;
end;
procedure DropResourse;
begin
  FindType(ClothType, backpack);
  While (FindQuantity > 1) do begin
    MoveItem(FindItem,FindFullQuantity,BankBox,0,0,0);
    Wait(WaitTime);
    FindType(ClothType, backpack);
  end;
  FindType(GoldType, backpack);
  While (FindQuantity > 1) do begin
    MoveItem(FindItem,FindFullQuantity,BankBox,0,0,0);
    Wait(WaitTime);
    FindType(GoldType, backpack);
  end;
end;
procedure UncolorRewards;
begin
  FindType(ClothType, BankBox);
  While (FindQuantity > 1) do begin
    UseObject(DyeTub);
    Wait(250);
    TargetToObject(FindItem);
    MoveItem(FindItem,FindFullQuantity,RestockBag,0,0,0);
    Wait(WaitTime);
    FindType(ClothType, BankBox);
  end;
end;
begin
  AddGumpIgnoreByID(4063159494);
  BankBox:=ObjAtLayer(BankLayer);
  if not Connected then begin
    Connect;
    Wait(10000);
  end;
  While IsGump do CloseSimpleGump(GetGumpsCount-1);
  CheckLag(WaitLag);
  Terminated:=True;
  TargetVendor;
  TargetBulkSource;
  TargetBulkDestination;
  while Terminated do begin
    if Dead then Halt;
    if not Connected() then begin
      Connect();
      Wait(10000);
      Continue;
    end;
    GetBOD;
    DropResourse;
    SearchBOD;
    if not Terminated then Continue;
  end;
  UncolorRewards;
end.





