Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Скрипт для получения очков на 30 ХЛД из брит библиотеки

Only working scripts
Post Reply
Half-Life
Novice
Novice
Posts: 86
Joined: 30.10.2012 12:06
Location: Одесса
Contact:

Скрипт для получения очков на 30 ХЛД из брит библиотеки

Post by Half-Life »

Вся инфа под спойлером.
BritishLibrary

Code: Select all

Program BritishLibrary;
{
Autor: Half-Life;
Description: Скрипт для получения очков на 30 ХЛД из британской библиотеки. Чар реколится к дому с металлом и ковальней. Делает щиты, реколится в библиотеку и сдаёт их. Нужен скилл тинкеринг для крафта тулзов и 1 тинкер тулза в паке.
UOStealthClientVersion: 6.2.1;
Warning! Будьте бдительны! - Администрация многих игровых серверов враждебно относится к использованию стелс клиента на своих серверах. Заподозрив вас в использовании стелс клиента и других неправославных программ они начинают сатанеть и в порыве слепой ярости могут попасть по вам Банхаммером;
}
const

Restock=$400337FD; // ID сундука с металлом
ItemType=$1B73; // Тип щита.
ItemCount=50; // Количество щитов.
NumF=29;      // Кнопка категории Sheilds в БС менюшке слева 
NumS=2;       // Кнопка самого щита в БС менюшке справа
NPC=$000000E2; // ID хуепуталы который принимает заказ
ButtonNPC=304; // Кнопка отвещающая за приём заказа(щитов)

RuneBook=$4002BD4D; // ID рб с руками в библиотеку и домой.
HomeRuneIndex=0;   // Номер рунки к дому. Отсчёт начинается с 0 
LibraryRuneindex=1; // Номер рунки в библиотеку.
RuneBookShift=5; // Чем реколится. 5 - магия, 7 - чива.
HomeX=1975; // Кордината Х в месте рекола к дому
HomeY=1213; // Кордината У в месте рекола к дому
LibX=1410; // Кордината Х в месте рекола к хуепутале
LibY=1608; // Кордината У в месте рекола к хуепутале

CraftToolsType=$0FBB;  // Тип тулзы крафтящей щиты
TinkerToolsType=$1EB8; // Тип тинкер тулзы
TKNumFirst=8; // Кнопка категории Tools в тинкер менюшке слева
TKNumSecond=23;  // Кнопка делающая тинкер тулзу
TKCraftNumSecond=86; // Кнопка делающая крафт тулзу

IngotsType=$1BF2; // Тип металла
IngotsColor=$0000; // Цвет простого металла
IngotsCount=550; // Количество простого металла которое мы берём.

WaitTime=500;
WaitLag=10000;
RecalTime=2000;
WaitCycles=7;

var
CraftTool,TinkerTool:Cardinal;
cTime,cTime2:TDateTime;

procedure DropResourse;
begin
  if Dead or not Connected then Exit;
  While FindType(IngotsType, backpack)>1 do begin
    MoveItem(FindItem,FindFullQuantity-50,Restock,0,0,0);
  end;
end;

procedure CheckResourses(ItemType:Word;ItemColor:Word;ItemCount:Integer);
var
CountInPack,CountItem:Integer;
begin
  if Dead or not Connected then Exit;
  UseObject(Restock);
  Wait(WaitTime*2);
  FindTypeEx(ItemType,ItemColor,Backpack,false);
  CountInPack:=FindQuantity;
  if ItemType=IngotsType then begin
    FindType(ItemType,backpack);
    CountItem:=(ItemCount-CountInPack)-(FindCount*9);
    if CountItem>0 then begin
      wait(1500);
      FindTypeEx(ItemType,ItemColor,Restock,false);
      Grab(FindItem,CountItem+50);
    end;
  end
  else
  if CountInPack<ItemCount then begin
    wait(1500);
    FindTypeEx(ItemType,ItemColor,Restock,false);
    Grab(FindItem,ItemCount-CountInPack);
  end;
end;

function CheckCraftTool:Boolean;
begin
  if Dead or not Connected then Exit;
  CheckLag(WaitLag);
  FindType(CraftToolsType, Backpack);
  CraftTool:=FindItem;
  Result:=FindCount > 0;
end;


function CheckTinkerTool:Boolean;
begin
  if Dead or not Connected then Exit;
  While IsGump do CloseSimpleGump(GetGumpsCount-1);
  CheckLag(WaitLag);
  FindType(TinkerToolsType, Backpack);
  TinkerTool:=FindItem;
  Result:=FindCount > 1;
end;

procedure CreateTKTools;
begin
  CheckResourses(IngotsType,IngotsColor,IngotsCount);
  while not CheckTinkerTool do begin
    If not IsGump then UseObject(TinkerTool);
    WaitGump(INtToStr(TKNumSecond));
    Wait(1000);
  end;
end;

function CreateCraftTools:Boolean;
begin
  if Dead or not Connected then Exit;
  While IsGump do CloseSimpleGump(GetGumpsCount-1);
  if not CheckTinkerTool then begin
    CreateTKTools;
  end;
  CheckResourses(IngotsType,IngotsColor,IngotsCount);
  While IsGump do CloseSimpleGump(GetGumpsCount-1);
  UseObject(TinkerTool);
  Wait(WaitTime);
  WaitGump(IntToStr(TKNumFirst));
  Wait(WaitTime);
  CheckLag(WaitLag);
  while not CheckCraftTool do begin
    if Dead or not Connected then Exit;
    If not IsGump then begin
      UseObject(TinkerTool);
      Wait(WaitTime);
      Continue;
    end;
    WaitGump(IntToStr(TKCraftNumSecond));
    Wait(1000);
  end;
  CloseSimpleGump(GetGumpsCount-1);
  Result:=CheckCraftTool;
end;

procedure CraftItem;
var
Res:Boolean;
GumpInfo:TGumpInfo;
Text:String;
begin
  if Dead or not Connected then Exit;
  FindType(ItemType, Backpack);
  if FindCount>=ItemCount then begin
    DropResourse;
    Exit;
  end;
  while not CheckCraftTool do begin
    CreateCraftTools;
  end;
  While IsGump do CloseSimpleGump(GetGumpsCount-1);
  UseObject(CraftTool);
  Wait(WaitTime);
  CheckLag(WaitLag);
  If not IsGump or (GetGumpID(GetGumpsCount-1)<>$38920ABD) then CraftItem;
  Wait(WaitTime);
  CheckLag(WaitLag);
  WaitGump(IntToStr(NumF));
  while not Res do begin
    if Dead or not Connected then Exit;
    If not IsGump then UseObject(CraftTool);
    WaitGump(IntToStr(NumS));
    Wait(1500);
    CheckLag(WaitLag);
    while not CheckCraftTool do begin
      CreateCraftTools;
      Wait(WaitTime);
      UseObject(FindItem);
    end;
    if GetGumpID(GetGumpsCount-1)=$38920ABD then begin
      GetGumpInfo(GetGumpsCount-1,GumpInfo);
      Text:=GetClilocById(gumpInfo.XmfHTMLGumpColor[12].Cliloc_id);
      if Pos('You do not have',Text)>0 then CheckResourses(IngotsType,IngotsColor,IngotsCount);
    end;
    FindType(ItemType, Backpack);
    AddToSystemJournal('Сделано '+IntToStr(FindCount)+' Buckler из '+IntToStr(ItemCount));
    if FindCount >= ItemCount then Res:=True;
  end;
  While IsGump do CloseSimpleGump(GetGumpsCount-1);
  Wait(100);
  DropResourse;
end;

procedure CheckConnect;
begin
  if Connected then Exit;
  repeat
    Connect;
    Wait(10000);
  until Connected;
end;

function RecallRune(RuneBook:Cardinal; Rune:Byte):Boolean;
var
X,Y:Word;
begin
  While IsGump do CloseSimpleGump(GetGumpsCount-1);
  Result:=False;
  X:=GetX(Self);
  Y:=GetY(Self);
  CheckLag(WaitLag);
  Wait(WaitTime);
  if Dead or not Connected then Exit;
  cTime2:=Now;
  while (cTime2 < cTime)do begin
    cTime2:=Now;
    wait(100);
  end;
  UseObject(RuneBook);
  CheckLag(WaitLag);
  cTime:=Now+0.00008;
  if IsGump then begin
    if NumGumpButton(GetGumpsCount-1, RuneBookShift + 6*Rune) then begin
      CheckLag(WaitLag);
      Wait(RecalTime);
      CheckLag(Waitlag);
      Result:=(X <> GetX(Self)) or (Y <> GetY(Self));
    end else Result:=False;
  end else Result:=False;
end;

function Go(X,Y,RuneIndex:Integer):Boolean;
begin
  repeat
    if (GetX(self)=X) and (GetY(self)=Y) then Exit;
    if Dead or not Connected then Exit;
    Result:=RecallRune(RuneBook,RuneIndex);
  until Result;
end;

procedure MakeQuest;
var
GumpInfo:TGumpInfo;
Points:Integer;
begin
  While FindType(ItemType,backpack)>0 do begin
    UseObject(NPC);
    CheckLag(WaitLag);
    Wait(WaitTime);
    WaitGump(IntToStr(ButtonNPC));
    CheckLag(WaitLag);
    Wait(WaitTime);
    ConsoleEntryUnicodeReply(IntToStr(Count(ItemType)));
  end;
  CheckLag(WaitLag);
  Wait(WaitTime);
  WaitGump('1');
  Wait(WaitTime);
  if GetGumpID(GetGumpsCount-1)=$95A059A6 then begin
    GetGumpInfo(GetGumpsCount-1, GumpInfo);
    Points:=StrToInt(gumpInfo.Text[gumpInfo.GumpText[0].text_id]);
    AddToSystemJournal('Количество поинтов = '+IntToStr(Points));
  end;
  While IsGump do CloseSimpleGump(GetGumpsCount-1);
end;

begin

  while True do begin
    if Dead then begin
      AddToSystemJournal('Вы Умерли');
      Halt;
    end;
    CheckConnect;
    Go(HomeX,HomeY,HomeRuneIndex);
    CheckResourses(IngotsType,IngotsColor,IngotsCount);
    CraftItem;
    Go(LibX,LibY,LibraryRuneIndex);
    MakeQuest;
  end;

end.
Post Reply