Fishing

Внимательно смотрите в настройки (банк\секьюр и т.п.).
Автолуп отключаем (.options). Так ловит быстрее.

Program Fishing;
{$include 'all.inc'}

type
WaterRecord = Record t,x,y,z: integer; end;
                                                                                                                                
var
WaterTile: array[0..50] of integer;
WaterPlace: array[0..500] of WaterRecord;
List: TStringList;
Fish: array[0..10] of integer;
WaterCount, Trash, contrl, Tgp, x,y,c,a,s,i: integer;
n: TDateTime;

// Настройки //
const
CheckDagger=false;          //Если false - снимает нож и лутает выловленную рыбу с земли
//0 = оставлять на земле. 1 = в контейнер. 2 = в мусорку.
MoveMapTo=2;                //Карты
MoveBackpackTo=2;           //Мешки(бэкпаки)
MoveSosTo=2;                //Сос-бутылки
securechest=$4EDC864A;      //Секьюр или контейнер в банке куда скидываем улов
gotobank=0;                 //0 = не ходить в банк. 1 = ходить
xBankTile=1000;             //Координата X откуда зовётся банк
yBankTile=1000;             //Координата Y откуда зовётся банк

procedure CheckCon;
begin
  if Connected=False then
  begin;
    repeat
      Wait(1000);
    until Connected=True;
    Wait(5000);
  end;
end;

procedure CheckGold;
var
b: integer;
begin
  CheckCon;
  FindDistance:=0;
  FindType($0E75, ground);
  if (FindCount > 0) then
  begin
    List:=TStringList.Create();
    GetFindedList(List);
    for i:=0 to List.Count-1 do
    begin
      CheckCon;
      b:=StrToInt('$'+List.Strings[i]);
      UseObject(B);
      repeat
        Wait(50);
      until (LastContainer=B) or (not Connected);
      if FindTypeEx($0EED, $FFFF, b, false) > 0 then
      Tgp:=Tgp+GetQuantity(finditem);
      AddToSystemJournal('FOUND: ' + IntToStr(GetQuantity(finditem)) + ' GOLD COINS');
      MoveItem(finditem, 0, backpack, 0, 0, 0);
      contrl:=1;
      AddToSystemJournal('TOTAL DURING THE SESSION FOUND: ' + IntToStr(Tgp) + ' GOLD COINS');
      if List.Count=1 then break;
    end;
  end;
end;

procedure MoveMap;
begin
  CheckCon;
  FindDistance:=0;
  FindType($14ED, ground);
  if (FindCount > 0) then
  begin
    List:=TStringList.Create();
    GetFindedList(List);
    for i:=0 to List.Count-1 do
    begin
      CheckCon;
      case MoveMapTo of
        1: MoveItem(StrToInt('$'+List.Strings[i]), 1, Backpack, 0, 0, 0);
        2: MoveItem(StrToInt('$'+List.Strings[i]), 1, Trash, 0, 0, 0);
        else MoveItem(StrToInt('$'+List.Strings[i]), 1, MoveMapTo, 0, 0, 0);
      end;
    end;
  end;
end;

procedure MoveBP;
begin
  CheckCon;
  FindDistance:=0;
  FindType($0E75, ground);
  if (FindCount > 0) then
  begin
    List:=TStringList.Create();
    GetFindedList(List);
    for i:=0 to List.Count-1 do
    begin
      CheckCon;
      case MoveBackpackTo of
        1: MoveItem(StrToInt('$'+List.Strings[i]), 1, backpack, 0, 0, 0);
        2: MoveItem(StrToInt('$'+List.Strings[i]), 1, Trash, 0, 0, 0);
        else MoveItem(StrToInt('$'+List.Strings[i]), 1, MoveBackpackTo, 0, 0, 0);
      end;
    end;
  end;
end;

procedure MoveSos;
begin
  if FindType($099F, backpack) > 0 then
  case MoveSosTo of
    0: DropHere(finditem);
    2: MoveItems(backpack, $099F, $FFFF, Trash, 0, 0, 0, 10);
    else MoveItems(backpack, $099F, $FFFF, MoveSosTo, 0, 0, 0, 10);
  end;
end;

procedure CheckFish;
var
f: integer;

begin
  if CheckDagger=False then
  for f:=0 to 7 do
  begin
    FindDistance:=0;
    FindType(Fish[f], ground);
    if FindQuantity > 0 then
    MoveItem(finditem, 0, $4ECFD245, 0,0,0);
  end;
end;

function CheckTool: boolean;
begin
  CheckCon;
  FindType($0DBF, backpack);
  if (dead=false) and (FindQuantity = 0) and (ObjAtLayer(LhandLayer) = 0) then
  begin
    AddToSystemJournal('Нет удочки');
    s:=0;
    result:=false;
    SetARStatus(false);
    Disconnect;
  end
  else
  result:=true;
  if CheckDagger=true then
  if ObjAtLayer(RHandLayer) = 0 then
  begin
    FindType($0F51, backpack);
    if FindQuantity > 0 then
    begin
      Equip(RHandLayer, finditem);
    end
    else
    begin
      AddToSystemJournal('Нет ножа');
      s:=0;
      result:=false;
      SetARStatus(false);
      Disconnect;
    end
  end;
end;

procedure CheckWaterTile;
var
t: integer;
LCount: integer;
TTile: TStaticCell;

begin
  TTile:=ReadStaticsXY(x, y, WorldNum);
  LCount:=GetLayerCount(x, y, WorldNum);
  i:=0;
  while i < LCount do
  begin
    for t:=0 to 5 do
    begin
      if TTile.Statics[0].Tile=WaterTile[t] then
      begin
        WaterPlace[c].t:=TTile.Statics[0].Tile;
        WaterPlace[c].x:=x;
        WaterPlace[c].y:=y;
        WaterPlace[c].z:=TTile.Statics[0].z;
        c:=c+1;
      end;
    end;
    i:=i+1;
  end;
end;

procedure FindWaterTile;
begin
  for x:=GetX(self)-6 to GetX(self)+6 do
  for y:=GetY(self)-6 to GetY(self)+6 do
  begin
    CheckWaterTile;
  end;
  WaterCount:=c-1;
end;

procedure DropBank;
var
SelfX, SelfY : integer;

begin
  CheckCon;
  if gotobank = 1 then
  begin
    SelfX := GetX(Self);
    SelfY := GetY(Self);
    NewMoveXY(xBankTile, yBankTile, true, 1, true);
    UOSay('bank');
  end;
  begin
    if findtype($097B, backpack) > 0 then Ignore(finditem);
    EmptyContainer(backpack, securechest, 500);
    CheckCon;
    contrl:=0;
    IgnoreReset;
    hungry(0, backpack);
    if gotobank = 1 then
    begin
      NewMoveXY(SelfX, SelfY, true, 1, true);
    end;
  end;
end;

procedure Fishing;
var
t: TDateTime;

begin
  while (not dead) do
  Begin
    for a:=0 to WaterCount do
    begin
      CheckCon;
      t:=now;
      if CheckTool=true then
      begin
        UseType($0DBF, $FFFF);
        WaitTargetTile(WaterPlace[a].t, WaterPlace[a].x, WaterPlace[a].y, WaterPlace[a].z);
        repeat
          CheckGold;
          if CheckDagger=false then CheckFish;
          if MoveMapTo <> 0 then MoveMap;
          if MoveBackpackTo <> 0 then MoveBP;
          if MoveSosTo <> 1 then MoveSos;
          Wait(300);
        until (InJournalBetweenTimes('stop|already|to be biting|far|any fish|that on this|cast your fishing|see that.', t, now) > 0) or not Connected or Dead;
        Wait(300);
        If InJournalBetweenTimes('something else.', t, now) > 0 then
        begin
          Disconnect;
          wait(5000);
          Connect;
        end;
        if contrl = 1 then DropBank;
      end
      else break;
    end;
  end;
  a:=0;
end;

begin
  SetPauseScriptOnDisconnectStatus(false);
  c:=0;
  s:=1;
  WaterTile[0]:=6038;
  WaterTile[1]:=6039;
  WaterTile[2]:=6040;
  WaterTile[3]:=6041;
  WaterTile[4]:=6042;
  WaterTile[5]:=6043;
  Fish[0]:=$09CF;
  Fish[1]:=$09CE;
  Fish[2]:=$09CD;
  Fish[3]:=$09CC;
  Fish[4]:=$0DD8;
  Fish[5]:=$0DD7;
  Fish[6]:=$0DD6;
  Fish[7]:=$0DBA;
  CheckCon;
  FindWaterTile;
  if CheckDagger=false then
  if ObjAtLayer(RHandLayer) > 0 then
  UnEquip(RHandLayer);
  AddToSystemJournal('Найдено тайлов для рыбалки: '+IntToStr(WaterCount));
  if (MoveBackpackTo=2) or (MoveMapTo=2) or (MoveSosTo=2) then
  begin
    FindDistance:=2;
    FindType($0E77, ground);
    if FindCount <> 0 then
    Trash:=finditem
    else
    begin
      AddToSystemJournal('Мусорка не найдена. Должна быть рядом с персом.');
      s:=0;
    end;
  end;
  while (s=1) and (not dead) do
  Fishing;
end.
 
faq/stealth/fishing.txt · Последние изменения: 2019/11/15 11:13 — tsatsur
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki