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

нужна помощь (Fishing)

тут можно задать вопрос по скриптингу
Post Reply
BigBrother2006
Neophyte
Neophyte
Posts: 11
Joined: 13.11.2006 18:34
Location: Череповец
Contact:

нужна помощь (Fishing)

Post by BigBrother2006 »

Code: Select all

program Fishing; {(c)Made by Slak}
type FishR = record
   Tile:word;
   X,Y,Z:integer;
end;

const
FishFile = 'Tiles.txt'; // {Имя файла с координатами тайлов...скинуть в папку где сам скрипт}
pole = $0DBF; //тип удочки
dagger = $0f51; //тип дагера

var FishP: array [0..333] of FishR;
    CountDim,i : Integer;
    stime : TDateTime;

{$Include 'all.inc'}


procedure GetRail(FileNam : String);
var
List : TStringList;
i : integer;
s : string;
begin
   List := TStringList.Create;
   List.LoadFromFile(FileNam);
   for i := 0 to List.Count-1 do
   begin
      s := List.strings[i] + ' ';
      FishP[i].Tile := StrToInt(Copy(s,1,Pos(' ',s)-1));
      Delete(s,1,Pos(' ',s));
      FishP[i].X := StrToInt(Copy(s,1,Pos(' ',s)-1));
      Delete(s,1,Pos(' ',s));
      FishP[i].Y := StrToInt(Copy(s,1,Pos(' ',s)-1));
      Delete(s,1,Pos(' ',s));
      FishP[i].Z := StrToInt(Copy(s,1,Pos(' ',s)-1));
      Delete(s,1,Pos(' ',s));
   end;
   CountDim := i-1;
end;

procedure moved;
var bag : Cardinal;

Begin
repeat
  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(1000);
   grab(findtype($0EED,bag),0); wait(500);
   Ignore(bag);
   findtype($0e75,ground);
  end;
until (FindCount < 1) or dead;
{wait (1000);
FindType($099f, backpack);
               while (FindCount > 0) do
               begin
                  DropHere(FindItem);
                  wait(600); 
end;}
End;

Begin
SetARStatus(true);
Hungry(2,backpack);
clearjournal;
IgnoreReset;
GetRail(FishFile);
while true do
begin
while Connected and (not dead) do
begin
useobject(backpack);
if ( GetType(ObjAtLayer(RhandLayer))<>dagger ) and Connected and (not dead) then
begin
  if ObjAtLayer(LhandLayer)<>0 then unequip(LhandLayer); wait(1000);
  if ObjAtLayer(RhandLayer)<>0 then unequip(RhandLayer); wait(1000);
  useobject(backpack); wait(1000);
  findtype(dagger, backpack);
  if (FindCount > 0) then Equip(RhandLayer,finditem); wait(1000);
end;
  for i := 0 to CountDim do
  begin
   repeat
   stime := Now;
      CheckSave;
      usetype(pole,$FFFF);
      WaitForTarget(5000);
      if TargetPresent then TargetToTile(FishP[i].Tile,FishP[i].X,FishP[i].Y,FishP[i].Z); //координату z на свою менять нада!!!
      CheckTargetError(5,2);
      WaitJournalLine(now,'seem to|stop|far away|t use that',30000);
      moved;
   until (InJournalBetweenTimes('seem to|far away|t use that', stime, Now) >= 0)  or dead;
  end;
  Hungry(2,backpack);
end;
wait(100);
end;
End.
Здраствуйте.
Имеется вот такой скриптик. Хотелось что бы при произнесении определенной фразы, например give me my fish, чар скидывал на землю нарезаную рыбу которую он наловил. :roll:
помогите пожжалуста.
BigBrother2006
Neophyte
Neophyte
Posts: 11
Joined: 13.11.2006 18:34
Location: Череповец
Contact:

Post by BigBrother2006 »

патюсь сделать отдельный скриптик...но что то нифига не получается

Code: Select all

program dropfish; 

{$Include 'all.inc'}

const
fish1 = $097A;     // ID=0x40E87EE4 Type=0x097A

Begin

if InJournal('my fish') then begin
  DropHere(findtype(fish1,backpack));
  wait(1000);
  ClearJournal;
  end;
End.
22:39:57 [fish1]: Compiling
22:39:57 [fish1]: Compiler: [Error] (dropfish.sc at 10:25): Type mismatch
22:39:57 [fish1]: Compiling failed
22:39:57 [fish1]: Script dropfish.sc stoped successfuly

вот такая фигня... полюбому какиенить там = < > нада вставить %)
помогите ктонибудь....
Fiel
Posts: 4
Joined: 05.11.2006 11:03

Post by Fiel »

М.б. так?

Code: Select all

if (InJournal('my fish')>=0) then
begin
BigBrother2006
Neophyte
Neophyte
Posts: 11
Joined: 13.11.2006 18:34
Location: Череповец
Contact:

Post by BigBrother2006 »

Code: Select all

program dropfish; 

{$Include 'all.inc'}

const
fish1 = $097A;     // ID=0x40E87EE4 Type=0x097A

Begin
if (InJournal('my fish')>=0) then 
begin
  DropHere(findtype(fish1,backpack));
  wait(1000);
  ClearJournal;
  end;
End.
0:23:39 [fish1]: Compiling
0:23:39 [fish1]: Compiled succesfully
0:23:39 [fish1]: Succesfully executed
0:23:39 [fish1]: Script dropfish.sc stoped successfuly

тоже что то не то =\
уже голова думать перестает
Fiel
Posts: 4
Joined: 05.11.2006 11:03

Post by Fiel »

Code: Select all

program dropfish;
const
	fish1 = $097A;     // ID=0x40E87EE4 Type=0x097A
Begin
	if (InJournal('my fish')>0) then
	begin
		if findtype(fish1,backpack)>0 then
			DropHere(finditem)
		else
			addtosystemjournal('Нарезанной рыбы в паке нет %)');
		wait(1000);
		ClearJournal;
	end
	else
		addtosystemjournal('Команда на сброс рыбы не найдена в журнале');
End.
Что выводит в журнале? ;)
У себя проверил - сбрасывает.
BigBrother2006
Neophyte
Neophyte
Posts: 11
Joined: 13.11.2006 18:34
Location: Череповец
Contact:

Post by BigBrother2006 »

17:56:00 [fish1]: Compiling
17:56:00 [fish1]: Compiled succesfully
17:56:00 [fish1]: Команда на сброс рыбы не найдена в журнале
17:56:00 [fish1]: Succesfully executed
17:56:00 [fish1]: Script ddddropfish.sc stoped successfuly

вот такое %)
использую Stealth_v1.0 (RC 3)
скрипт попрежнему не хотит слетает как ставлю сразуже
scf
Neophyte
Neophyte
Posts: 20
Joined: 06.02.2008 11:56

Post by scf »

Он же не зациклен
Fiel
Posts: 4
Joined: 05.11.2006 11:03

Post by Fiel »

scf wrote:Он же не зациклен
Да, не зациклен. %)

Code: Select all

program dropfish;
const
	fish1 = $097A;     // ID=0x40E87EE4 Type=0x097A
var
	myTime : TDateTime;
Begin
	myTime := Now;
	while not Dead do
	begin
		if (InJournalBetweenTimes('my fish',myTime,Now)>=0) then
		begin
			if findtype(fish1,backpack)>0 then
				DropHere(finditem)
			else
				addtosystemjournal('Нарезанной рыбы в паке нет %)');
			myTime := Now;
		end;
		wait(1000);
	end;
End.
BigBrother2006
Neophyte
Neophyte
Posts: 11
Joined: 13.11.2006 18:34
Location: Череповец
Contact:

Post by BigBrother2006 »

Fiel,scf огромное спасибо =) все работает =) гуд =)
scf
Neophyte
Neophyte
Posts: 20
Joined: 06.02.2008 11:56

Post by scf »

BigBrother2006, ты наверно запускаешь этот код как параллельный скрипт.
Используй как процедуру, вызывая в скрипте.
BigBrother2006
Neophyte
Neophyte
Posts: 11
Joined: 13.11.2006 18:34
Location: Череповец
Contact:

Post by BigBrother2006 »

оке =)
что то не могу понять что за цикл отвечает....
Fiel
Posts: 4
Joined: 05.11.2006 11:03

Post by Fiel »

Пока не помер идет проверка журнала.
Если в нем есть строка "my fish" в интервале времени от момента myTime до текущего времени (Now), то пытаемся найти в паке нарезанную рыбу. Если находим, то сбрасываем ее на пол, если нет - пишем что рыбы нет.
Далее обновляем метку времени myTime, что бы не сбрасывать рыбу постоянно после получения команды "my fish" %).
PM
Posts: 6
Joined: 12.08.2006 16:44
Contact:

Post by PM »

Вопрос по этому же скрипту.
Через какое то время просто затыкаеться и все..
Не могу понять на чем:(

задача в общем-то его немного кастрировать, ибо он не отыгрыват все что нада

в данный момент все работает в виде немного обрезанного скрипта

Code: Select all

program Fishing; {(c)Made by Slak}
type FishR = record
   Tile:word;
   X,Y,Z:integer;
end;

const
FishFile = 'Tiles.txt'; // {Имя файла с координатами тайлов...скинуть в папку где сам скрипт}
pole = $0DBF; //тип удочки
dagger = $0f51; //тип дагера

var FishP: array [0..333] of FishR;
    CountDim,i : Integer;
    stime : TDateTime;

{$Include 'all.inc'}

procedure GetRail(FileNam : String);
var
List : TStringList;
i : integer;
s : string;
begin
   List := TStringList.Create;
   List.LoadFromFile(FileNam);
   for i := 0 to List.Count-1 do
   begin
      s := List.strings[i] + ' ';
      FishP[i].Tile := StrToInt(Copy(s,1,Pos(' ',s)-1));
      Delete(s,1,Pos(' ',s));
      FishP[i].X := StrToInt(Copy(s,1,Pos(' ',s)-1));
      Delete(s,1,Pos(' ',s));
      FishP[i].Y := StrToInt(Copy(s,1,Pos(' ',s)-1));
      Delete(s,1,Pos(' ',s));
      FishP[i].Z := StrToInt(Copy(s,1,Pos(' ',s)-1));
      Delete(s,1,Pos(' ',s));
   end;
   CountDim := i-1;
end;


Begin
SetARStatus(true);
Hungry(2,backpack);
clearjournal;
IgnoreReset;
GetRail(FishFile);
while true do
begin
while Connected and (not dead) do
begin
useobject(backpack);
if ( GetType(ObjAtLayer(RhandLayer))<>dagger ) and Connected and (not dead) then
begin
  if ObjAtLayer(LhandLayer)<>0 then unequip(LhandLayer); wait(1000);
  if ObjAtLayer(RhandLayer)<>0 then unequip(RhandLayer); wait(1000);
  useobject(backpack); wait(1000);
  findtype(dagger, backpack);
  if (FindCount > 0) then Equip(RhandLayer,finditem); wait(1000);
end;
  for i := 0 to CountDim do
  begin
   repeat
   stime := Now;
      usetype(pole,$FFFF);
      WaitForTarget(5000);
      if TargetPresent then TargetToTile(FishP[i].Tile,FishP[i].X,FishP[i].Y,FishP[i].Z); 
      CheckTargetError(5,2);
      WaitJournalLine(now,'seem to|stop|far away|t use that',30000);
   until (InJournalBetweenTimes('seem to|far away|t use that', stime, Now) >= 0)  or dead;
  end;
  Hungry(2,backpack);
end;
wait(100);
end;
End.
и дополнительного скрипта на выброс сосбатлов на землю

Code: Select all

program dropsos;

Begin
while not Dead do
   begin 
repeat
  findtype($099f,backpack);
  if (FindCount  >= 1) and connected and (not dead) then begin
   DropHere(FindItem);
   wait(500);
  end;
until (FindCount < 1) or dead;
end;
End.
помогите плз их срастить(
Post Reply