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

Фишинг ZHE

тут можно задать вопрос по скриптингу
Roman
Neophyte
Neophyte
Posts: 37
Joined: 03.11.2014 21:48

Re: Фишинг ZHE

Post by Roman »

Verana wrote: if FindType( fishpole, fishpoleColor, Ground, True ) > 0 then begin (я так понял ему уже знак больше не нравится ?)
function FindType(ObjType: Word; Container: Cardinal) : Cardinal
function FindTypeEx(ObjType: Word; Color: Word; Container: Cardinal; InSub: Boolean): Cardinal
Verana
Novice
Novice
Posts: 60
Joined: 26.06.2015 18:44

Re: Фишинг ZHE

Post by Verana »

Roman wrote:
Verana wrote: if FindType( fishpole, fishpoleColor, Ground, True ) > 0 then begin (я так понял ему уже знак больше не нравится ?)
function FindType(ObjType: Word; Container: Cardinal) : Cardinal
function FindTypeEx(ObjType: Word; Color: Word; Container: Cardinal; InSub: Boolean): Cardinal
я в стелсе и в скриптах на нулевом уровне, можно чуть подробнее объяснить что с этим делать и как правильно применить?
Macks
Apprentice
Apprentice
Posts: 250
Joined: 27.02.2006 22:23
Location: АоП - Age Of Power

Re: Фишинг ZHE

Post by Macks »

Verana wrote:спасибо попробовал и вот что пишет...

13:16:24:493 [4]: Compiler: [Error] (C:\Games\Steth\Scripts\Fishing4.sc at 161:54): Invalid number of parameters

вот эта строчка 161:54

if FindType( fishpole, fishpoleColor, Ground, True ) > 0 then begin (я так понял ему уже знак больше не нравится ?)
Ему не нравится несоответствие параметров передаваемых функции.

Нужно

Code: Select all

if FindType( fishpole, Ground ) > 0 then begin
Verana
Novice
Novice
Posts: 60
Joined: 26.06.2015 18:44

Re: Фишинг ZHE

Post by Verana »

Macks wrote:
Verana wrote:спасибо попробовал и вот что пишет...

13:16:24:493 [4]: Compiler: [Error] (C:\Games\Steth\Scripts\Fishing4.sc at 161:54): Invalid number of parameters

вот эта строчка 161:54

if FindType( fishpole, fishpoleColor, Ground, True ) > 0 then begin (я так понял ему уже знак больше не нравится ?)
Ему не нравится несоответствие параметров передаваемых функции.

Нужно

Code: Select all

if FindType( fishpole, Ground ) > 0 then begin
спасибо! он стал удочки подбирать но он берет одну начинает рыбачить и потом бросает удочку в сумку, берет в руки с пола следующую начинает и опять в сумку... и так до бесконечности, а как сделать так чтоб он брал с пола одну удочку только когда в руках и в паке удочки уже нет (все сломались, закончились)? просто на одной лодке несколько рыбаков ловят и нужно чтоб они с пола брали когда сломают свою удочку...
буду очень вам признателен! когда удочки на полу закончились, он просто перестал рыбачить... скрипт включен но при этому удочку не закидывает в воду...
Last edited by Verana on 11.07.2015 16:51, edited 1 time in total.
Verana
Novice
Novice
Posts: 60
Joined: 26.06.2015 18:44

Re: Фишинг ZHE

Post by Verana »

сейчас скрипт выглядит так:
Program FishingZulu;
{$Include 'all.inc'}

type
WaterRecord = Record
t,x,y,z,a: integer;
end;

var
WaterTile: array[0..50] of integer;
WaterPlace: array[0..500] of WaterRecord;
WaterCount: integer;
x,y,c,a,i: integer;
s: boolean;

const
mainbag = $416CBDDD; //сумка с добычей
fishpole = $0DC0; //удочка(или сети)
fishpoleColor = $0000; //цвет удочки в зависимости от цвета дерева
dagger = $0F51; //дагер
Trash = $416CEC12; //Мусорка
cut = 1; //1-Резать рыбу(даггер в руки), 0-не резать

procedure CheckGold;
var bag : Cardinal;

Begin
repeat
Ignore(mainbag);
findtype($0E75,ground);
if (FindCount >= 1) and (GetDistance(finditem) <=2) and (GetDistance(finditem) >=0) and connected and (not dead) then begin
bag := finditem;
useobject(bag);
wait(100);
MoveItem(findtype($0EED,bag), 0, mainbag, 0, 0, 0);
wait(100);
MoveItem(bag, 0, Trash, 0, 0, 0);
end;

until (FindCount < 1) or dead;
End;

procedure MoveSos;
begin
repeat
FindType($099F, backpack);
if (FindCount >= 1) and (GetDistance(finditem) <=2) and (GetDistance(finditem) >=0) and connected and (not dead) then begin
wait(100);
MoveItem(finditem, 0, Trash, 0, 0, 0);
wait(100);
end;
until (FindCount < 1) or dead;
end;

procedure MoveMap;
begin
repeat
FindType($14ED, ground);
if (FindCount >= 1) and (GetDistance(finditem) <=2) and (GetDistance(finditem) >=0) and connected and (not dead) then begin
wait(100);
MoveItem(finditem, 0, Trash, 0, 0, 0);
wait(100);
end;
until (FindCount < 1) or dead;
end;

procedure seaweed;
begin
repeat
FindType($0DBA, ground);
if (FindCount >= 1) and (GetDistance(finditem) <=2) and (GetDistance(finditem) >=0) and connected and (not dead) then begin
wait(100);
MoveItem(finditem, 0, Trash, 0, 0, 0);
wait(100);
end;
until (FindCount < 1) or dead;
end;

procedure fishgrab;
begin
if FindType($09CC, ground) > 0 then
MoveItem(finditem, 0, mainbag, 0, 0, 0);
if FindType($09CD, ground) > 0 then
MoveItem(finditem, 0, mainbag, 0, 0, 0);
if FindType($09CE, ground) > 0 then
MoveItem(finditem, 0, mainbag, 0, 0, 0);
if FindType($09CF, ground) > 0 then
MoveItem(finditem, 0, mainbag, 0, 0, 0);
if FindType($14EB, ground) > 0 then
MoveItem(finditem, 0, mainbag, 0, 0, 0);
if FindType($0DD6, ground) > 0 then
MoveItem(finditem, 0, mainbag, 0, 0, 0);
if FindType($0DD7, ground) > 0 then
MoveItem(finditem, 0, mainbag, 0, 0, 0);
if FindType($0DD8, ground) > 0 then
MoveItem(finditem, 0, mainbag, 0, 0, 0);
end;

procedure CheckDagger;
begin
if (cut = 1) and (RHandLayer<>dagger) then begin
Equipt(RHandLayer, dagger);
end;
if cut = 0 then begin
unequip(RHandLayer);
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 6 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;
WaterPlace[c].a:=1;
c:=c+1;
end;
end;
i:=i+1;
end;
end;

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

procedure Fishing;

begin
for a:=0 to WaterCount do
begin
Hungry(1,-1);
clearjournal;
if WaterPlace[a].a = 1 then begin
WaitTargetTile(WaterPlace[a].t, WaterPlace[a].x, WaterPlace[a].y, WaterPlace[a].z);
wait(5000);
//if Length(LastJournalMessage)=34 then begin
//WaterPlace[a].a:=0;
//AddToSystemJournal('Заброкован таил');
//ClearJournal;
//end;
if FindType( fishpole, Ground ) > 0 then begin
AddToSystemJournal('Fishing Poles found: ' + IntToStr(FindCount));
Disarm;
Wait(1000);
Equip(LhandLayer, FindItem );
Wait(500);
UseObject( FindItem );
end;
if cut = 0 then begin
fishgrab;
end;
CheckGold;
MoveSos;
MoveMap;
seaweed;
end;
end;
end;

begin
SetARStatus(true);

s:=true;

WaterTile[0]:=6038;
WaterTile[1]:=6039;
WaterTile[2]:=6040;
WaterTile[3]:=6041;
WaterTile[4]:=6042;
WaterTile[5]:=6043;
WaterTile[6]:=6044;


FindWaterTile;

AddToSystemJournal('Найдено тайлов для рыбалки: '+IntToStr(WaterCount));
while not Dead and s do begin
if cut = 1 then begin
CheckDagger;
end;
Fishing;
end;
end.
Macks
Apprentice
Apprentice
Posts: 250
Joined: 27.02.2006 22:23
Location: АоП - Age Of Power

Re: Фишинг ZHE

Post by Macks »

Verana wrote:сейчас скрипт выглядит так:

Code: Select all

Program FishingZulu;
{$Include 'all.inc'}

type
WaterRecord = Record
t,x,y,z,a: integer;
end;

var
WaterTile: array[0..50] of integer;
WaterPlace: array[0..500] of WaterRecord;
WaterCount: integer;
x,y,c,a,i: integer;
s: boolean;

const
mainbag = $416CBDDD; //сумка с добычей
fishpole = $0DC0; //удочка(или сети)
fishpoleColor = $0000; //цвет удочки в зависимости от цвета дерева
dagger = $0F51; //дагер
Trash = $416CEC12; //Мусорка
cut = 1; //1-Резать рыбу(даггер в руки), 0-не резать

procedure CheckGold;
var bag : Cardinal;
Begin
  repeat
    Ignore(mainbag);
    findtype($0E75,ground);
    if (FindCount >= 1) and (GetDistance(finditem) <=2) and (GetDistance(finditem) >=0) and connected and (not dead) then begin
      bag := finditem;
      useobject(bag);
      wait(100);
      MoveItem(findtype($0EED,bag), 0, mainbag, 0, 0, 0);
      wait(100);
      MoveItem(bag, 0, Trash, 0, 0, 0);
    end;
  until (FindCount < 1) or dead;
End;

procedure MoveSos;
begin
  repeat
    FindType($099F, backpack);
    if (FindCount >= 1) and (GetDistance(finditem) <=2) and (GetDistance(finditem) >=0) and connected and (not dead) then begin
      wait(100);
      MoveItem(finditem, 0, Trash, 0, 0, 0);
      wait(100);
    end;
  until (FindCount < 1) or dead;
end;

procedure MoveMap;
begin
  repeat
    FindType($14ED, ground);
    if (FindCount >= 1) and (GetDistance(finditem) <=2) and (GetDistance(finditem) >=0) and connected and (not dead) then begin
      wait(100);
      MoveItem(finditem, 0, Trash, 0, 0, 0);
      wait(100);
    end;
  until (FindCount < 1) or dead;
end;

procedure seaweed;
begin
  repeat
    FindType($0DBA, ground);
    if (FindCount >= 1) and (GetDistance(finditem) <=2) and (GetDistance(finditem) >=0) and connected and (not dead) then begin
      wait(100);
      MoveItem(finditem, 0, Trash, 0, 0, 0);
      wait(100);
    end;
  until (FindCount < 1) or dead;
end;

procedure fishgrab;
begin
  if FindType($09CC, ground) > 0 then
  MoveItem(finditem, 0, mainbag, 0, 0, 0);
  if FindType($09CD, ground) > 0 then
  MoveItem(finditem, 0, mainbag, 0, 0, 0);
  if FindType($09CE, ground) > 0 then
  MoveItem(finditem, 0, mainbag, 0, 0, 0);
  if FindType($09CF, ground) > 0 then
  MoveItem(finditem, 0, mainbag, 0, 0, 0);
  if FindType($14EB, ground) > 0 then
  MoveItem(finditem, 0, mainbag, 0, 0, 0);
  if FindType($0DD6, ground) > 0 then
  MoveItem(finditem, 0, mainbag, 0, 0, 0);
  if FindType($0DD7, ground) > 0 then
  MoveItem(finditem, 0, mainbag, 0, 0, 0);
  if FindType($0DD8, ground) > 0 then
  MoveItem(finditem, 0, mainbag, 0, 0, 0);
end;

procedure CheckDagger;
begin
  if (cut = 1) and (RHandLayer<>dagger) then begin
    Equipt(RHandLayer, dagger);
  end;
  if cut = 0 then begin
    unequip(RHandLayer);
  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 6 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;
        WaterPlace[c].a:=1;
        c:=c+1;
      end;
    end;
    i:=i+1;
  end;
end;

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

procedure Fishing;
begin
  Hungry(1,-1);
  clearjournal;
  for a := 0 to WaterCount do
  begin
    ClientPrintEx(Self, 0, 0, 'Fishing: ' + IntToStr(a) + '/' + IntToStr(WaterCount));
    if WaterPlace[a].a = 1 then begin
      WaitTargetTile(WaterPlace[a].t, WaterPlace[a].x, WaterPlace[a].y, WaterPlace[a].z);
      if UseType( fishpole, $FFFF ) < 1 then begin
        if FindType( fishpole, Ground ) > 0 then begin
          AddToSystemJournal('Fishing Poles found: ' + IntToStr(FindCount));
          Disarm;
          Wait(1000);
          Equip(LhandLayer, FindItem );
          Wait(500);
          UseObject( FindItem );
        end;
      end;
      wait(5000);
      if cut = 0 then begin
        fishgrab;
      end;
      CheckGold;
      MoveSos;
      MoveMap;
      seaweed;
    end;
  end;
end;

begin
  SetARStatus(true);
  s := true;

  WaterTile[0]:=6038;
  WaterTile[1]:=6039;
  WaterTile[2]:=6040;
  WaterTile[3]:=6041;
  WaterTile[4]:=6042;
  WaterTile[5]:=6043;
  WaterTile[6]:=6044;

  FindWaterTile;
  AddToSystemJournal('Найдено тайлов для рыбалки: '+IntToStr(WaterCount));

  while not Dead and s do begin
    if cut = 1 then begin
      CheckDagger;
    end;
    Fishing;
  end;
end.
Verana
Novice
Novice
Posts: 60
Joined: 26.06.2015 18:44

Re: Фишинг ZHE

Post by Verana »

Ух, очень вас благодарю!!! скрипт заработал как надо! единственное не знаю как можно более тонко настроить так чтоб лишний вылавливаемый мусор выкидывался в траш а нужный к примеру кидался в ящик который лежит или встроен в лодку... не хочу надоедать поэтому это уже лишь в том случае если у вас будет свободное время и желание сделать этот скрипт еще лучше!

Большое спасибо!
Verana
Novice
Novice
Posts: 60
Joined: 26.06.2015 18:44

Re: Фишинг ZHE

Post by Verana »

Скрипт всю ночь работал и к утру встретил такую картину, чар стоит и пытается всю рыбу что у него под ногами лежит к себе в пак положить, но из-за перевеса все обратно выпадает на пол лодки в итоге он стоит ничего не ловит... лучше если бы он все сразу кидал себе под ноги, как это можно сделать? чтоб не пытался собирать у себя в паке...
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: Фишинг ZHE

Post by drabadan »

Verana wrote:Скрипт всю ночь работал и к утру встретил такую картину, чар стоит и пытается всю рыбу что у него под ногами лежит к себе в пак положить, но из-за перевеса все обратно выпадает на пол лодки в итоге он стоит ничего не ловит... лучше если бы он все сразу кидал себе под ноги, как это можно сделать? чтоб не пытался собирать у себя в паке...
может не в пак, а в сумку указанную в переменной мэинбег... А куда бы ты хотел, чтобы уходила рыба? И рыба, в виде стейков или целая?
Verana
Novice
Novice
Posts: 60
Joined: 26.06.2015 18:44

Re: Фишинг ZHE

Post by Verana »

drabadan wrote:может не в пак, а в сумку указанную в переменной мэинбег... А куда бы ты хотел, чтобы уходила рыба? И рыба, в виде стейков или целая?
когда включаю скрипт чар некоторое время ловит целую рыбу и забивает себе бекппек и только через пару минут начинает резать, хотя там есть строка
"cut = 1; //1-Резать рыбу(даггер в руки), 0-не резать"
хотелось бы чтоб он сразу всю рыбу скидывал под себя и складывал в стак, так как у нас на одном тайле больше 300 единиц нельзя чтоб лежало, остальное будет пропадать, а стак считается как 1 единицы...после определенного уровня скилла начинает вылавливаться магическая рыба которую желательно не резать, а всю остальную можно и порезать... магической рыбы всего 8 вида, для бафов инвиза, хила и т.д... можно как то их будет в игнор выставить, и указать к примеру ящик (либо под себя чтоб кидал) в который он будет магическю рыбу складывать, а остальную резал и скидывал вниз под собой в виде фиш стейков?

вот 4 вида магической рыбы (еще не все могу выловаить, скилл маловат)

* Info * : ID: $417E2549 Name: NoName Type: $0DD6 Color: $0015 (Night Sight/ он не очень актуален и его мажно было бы и резать)
magic fish of night sight

* Info * : ID: $417D0C15 Name: NoName Type: $0DD6 Color: $054B (Bless)
magic fishs of bless

* Info * : ID: $417D02D9 Name: NoName Type: $0DD6 Color: $0009 (Heal)
magic fishs of heal

* Info * : ID: $417E3BAC Name: NoName Type: $0DD6 Color: $0029 (Agil)
magic fish of agility

и таких еще 4 вида магических рыбин... всего 8

вся остальная рыба обычная
Пример:


* Info * : ID: $417D3F70 Name: NoName Type: $09CE Color: $0000
blue fishs

* Info * : ID: $417E22C6 Name: NoName Type: $09CC Color: $0000
green fishs

* Info * : ID: $417E3165 Name: NoName Type: $0DD9 Color: $0000
small fishs

* Info * : ID: $417E22BD Name: NoName Type: $0DD7 Color: $0000
small fishs

* Info * : ID: $417E22C2 Name: NoName Type: $0DD8 Color: $0000
small fishs

* Info * : ID: $417E22E1 Name: NoName Type: $09CF Color: $0000
yellow fishs

* Info * : ID: $417E3CB4 Name: NoName Type: $09CD Color: $0000
brown fishs

боюсь тут не весь список обычной рыбы
Verana
Novice
Novice
Posts: 60
Joined: 26.06.2015 18:44

Re: Фишинг ZHE

Post by Verana »

Будем улучшать скрипт?) последний вариант вполне рабочий, лишь надо дополнить
Verana
Novice
Novice
Posts: 60
Joined: 26.06.2015 18:44

Re: Фишинг ZHE

Post by Verana »

я уж подумал что drabadan хочет помочь...
Post Reply