Tibia, NG Bot, Elf Bot, IBot, NeoBot, Redbot Waypointy, Skrypty, Tutoriale, Poradniki, Problemy Strona Główna


Poprzedni temat «» Następny temat
Depositer small stone
Autor Wiadomość
Semran 


Dołączył: 03 Sie 2009
Posty: 113
Skąd: Konin
Wysłany: 2009-08-07, 00:01   Depositer small stone

C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From goblins to depot.wpt' -tutaj daj swoje wp z goblinów do dp.
C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From depot to goblins.wpt' - a tutaj z dp do goblinów.

Skrypt ten odnosi kamyki przy danej ich ilości!


Kod:
const
BackpackToEmpty = 2 // z ktorego bp ma wrzucac kamyczki do depo
CaveToDepotWaypoints = 'C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From goblins to depot.wpt' // Goblins to DP
DepotToCaveWaypoints = 'C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From depot to goblins.wpt' // DP to Goblins

StonesAmount = 40; // Ile kamyczkow ma zebrac
WaitTime = 10;

var
Stones: integer;

Function GetTileFromXYZ(X, Y, Z: integer): TTile;
begin
Result := nil;
if abs((Self.X - 7) - X) > 14 then Exit;
if abs((Self.Y - 5) - Y) > 11 then Exit;
if Self.Z <> Z then Exit;
Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)];
end;

Procedure UseTile(X,Y,Z: Integer);
Var
Tile: TTile;
begin
if Z = Self.Z then
begin
Tile := GetTileFromXYZ(X, Y, Z);
Tile.Item[1].Use;
end;
else Unreachable := True;
end;

Procedure UseRope(X,Y,Z: Integer);
begin
if Z = Self.Z then
begin
Self.Containers.UseItemWithGround(3003, X, Y, Z);
end;
else Unreachable := True;
end;

Procedure MoveTo(X,Y,Z: Integer);
begin
if Z = Self.Z then
begin
Self.MoveTo(X,Y,Z);
end;
else Unreachable := True;
end;

Procedure UseShovel(X,Y,Z: Integer);
var Tile: TTile
begin
if Z = Self.Z then
begin
repeat
Self.Containers.UseItemWithGround(5710, X, Y, Z);
Self.Containers.UseItemWithGround(3457, X, Y, Z);
Sleep(1000);
UpdateWorld;
Tile := GetTileFromXYZ(X, Y, Z);
until Tile.Item[0].Properties.Hole or Terminated
Self.MoveTo(X, Y, Z);
end;
else Unreachable := True;
end;

Procedure WaypointToAction(X,Y,Z,Action :Integer);
begin
UpdateWorld;
Case Action of
1: UseRope(X,Y,Z);
2: UseTile(X,Y,Z);
3: MoveTo(X, Y+1, Z+1);
4: MoveTo(X, Y-1, Z-1);
5: MoveTo(X, Y, Z-1);
6: MoveTo(X, Y, Z);
7: UseShovel(X,Y,Z-1);
8: MoveTo(X, Y, Z);
9: Sleep(X*1000);
else
MoveTo(X,Y,Z);
end;
end;

Function WaypointReached(X,Y,Z,Action :Integer): Boolean;
begin
UpdateWorld;
Result := False;
Case Action of
1: if (Z = Self.Z + 1) then Result := True;
2: if (Z = Self.Z + 1) then Result := True;
3: if (Z = Self.Z) then Result := True;
4: if (Z = Self.Z) then Result := True;
5: if (Z = Self.Z) then Result := True;
6: if ((X = Self.X) and (Y = Self.Y) and (Z = Self.Z)) then Result := True;
7: if (Z = Self.Z) then Result := True;
8: if (abs(Z - Self.Z) = 1) then Result := True;
9: Result := True;
else
if ((X = Self.X) and (Y = Self.Y) and (Z = Self.Z)) then Result := True;
end;
end;

Function CountWaypoints(FilePath: String): Integre;
Var
i: Integer
WaypointFile: TextFile
begin
i := 0
AssignFile(WaypointFile, FilePath);
ReSet(WaypointFile);
while not EoF(WaypointFile) do
begin
temp:= ReadLn(WaypointFile);
i := i+1;
end;
Result:= (i/4);
end;

Function ExtractWaypointsFromFile(FilePath: String; Count: Integer): Integre;
Var
i: Integr
WaypointsArray: Integer
WaypointFile: TextFile
begin
WaypointsArray := VarArrayCreate([0, Count - 1, 0, 3], $C);
AssignFile(WaypointFile, FilePath);
ReSet(WaypointFile);
for i:=0 to Count-1 do
begin
WaypointsArray[i,0] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,1] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,2] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,3] := StrToInt(ReadLn(WaypointFile));
end;
CloseFile(WaypointFile);
Result := WaypointsArray;
end;

procedure DepositeStones;
begin
UpdateWorld;
A := nil;
for x := 6 to 8 do
begin
if x > 8 then break;
for y := 4 to 6 do
begin
if y > 6 then break;
for i := 0 to Screen.Tile[x,y].Count - 1 do
begin
if i >= Screen.Tile[x,y].Count then break;
if Screen.Tile[x,y].Item[i].properties.depot then
begin
A := Screen.Tile[x,y].Item[i];
break;
end;
SLEEP(50);
end;
end;
end;
if A <> nil then
if BackpackToEmpty > 0 then
begin
A.Open;
C := Self.Containers.Count;
Sleep(1500);
UpdateWorld;
if C <> Self.Containers.Count then
begin
for G := Self.Containers.Container[BackpackToEmpty - 1].Count - 1 downto 0 do
begin
if G >= Self.Containers.Container[BackpackToEmpty - 1].Count then break;
Self.Containers.Container[BackpackToEmpty - 1].Item[G].MoveToContainer(Self.Containers.Container[Self.Containers.Count - 1],20,0);
sleep(100);
end;
end;
end;
else if BackpackToEmpty = 0 then
begin
A.Open;
C := Self.Containers.Count;
Sleep(1500);
UpdateWorld;
if C <> Self.Containers.Count then
begin
for ok := 0 to self.containers.Count - 2 do
begin
if ok >= Self.Containers.Count - 1 then break;
for G := Self.Containers.Container[ok].Count - 1 downto 0 do
begin
if G >= Self.Containers.Container[ok].Count then break;
Self.Containers.Container[ok].Item[G].MoveToContainer(Self.Containers.Container[
elf.Containers.Count - 1],100,0);
sleep(100);
end;
end;
end;
end;
end;

function CountItemAmountFromOpenBackpack(ID: integer): integer;
var
x: integer;
y: integer;
begin
Result := 0;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then begin
Result := Result + Self.Containers.Container[x].Item[y].Amount;
end;
end;
end;
end;

Procedure FollowWaypoint(FilePath: String)
begin
Index := 0
Unreachable := False
WaypointsCount := CountWaypoints(FilePath);
WP := ExtractWaypointsFromFile(FilePath, WaypointsCount);

while (Index <> (WaypointsCount-1)) and (not Terminated) do
begin
if Unreachable then
begin
Index := Index+1;
Unreachable := False;
end;

if Index = (WaypointsCount-1) then Index := 0;
if WaypointReached(WP[Index,0],WP[Index,1],WP[Index,2],WP[Index,3]) then
Index := Index +1;

WaypointToAction(WP[Index,0],WP[Index,1],WP[Index,2],WP[Index,3]);

Sleep(1000);
end;
end;

begin
updateworld
Stones := CountItemAmountFromOpenBackpack(1781);
if Stones < StonesAmount then Exit;

FollowWaypoint(CaveToDepotWaypoints);

While (Stones > 0) and (not terminated) do
begin
DepositeStones;
Sleep(WaitTime*1000);
updateworld;
Stones := CountItemAmountFromOpenBackpack(3031);
end;
if Terminated then Exit;

FollowWaypoint(DepotToCaveWaypoints);

Sleep(1000);
end;




A ten przy danej ilości CAP
Kod:

const
BackpackToEmpty = 1 // ID backpacka z kamyczkami
CaveToDepotWaypoints = 'tutaj z goblinow do dp'
DepotToCaveWaypoints = 'tutaj z dp do goblinow'

CapacityAmount = 100;
WaitTime = 5;

Function GetTileFromXYZ(X, Y, Z: integer): TTile;
begin
Result := nil;
if abs((Self.X - 7) - X) > 14 then Exit;
if abs((Self.Y - 5) - Y) > 11 then Exit;
if Self.Z <> Z then Exit;
Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)];
end;

Procedure UseTile(X,Y,Z: Integer);
Var
Tile: TTile;
begin
if Z = Self.Z then
begin
Tile := GetTileFromXYZ(X, Y, Z);
Tile.Item[1].Use;
end;
else Unreachable := True;
end;

Procedure UseRope(X,Y,Z: Integer);
begin
if Z = Self.Z then
begin
Self.Containers.UseItemWithGround(3003, X, Y, Z);
end;
else Unreachable := True;
end;

Procedure MoveTo(X,Y,Z: Integer);
begin
if Z = Self.Z then
begin
Self.MoveTo(X,Y,Z);
end;
else Unreachable := True;
end;

Procedure UseShovel(X,Y,Z: Integer);
var Tile: TTile
begin
if Z = Self.Z then
begin
repeat
Self.Containers.UseItemWithGround(5710, X, Y, Z);
Self.Containers.UseItemWithGround(3457, X, Y, Z);
Sleep(1000);
UpdateWorld;
Tile := GetTileFromXYZ(X, Y, Z);
until Tile.Item[0].Properties.Hole or Terminated
Self.MoveTo(X, Y, Z);
end;
else Unreachable := True;
end;

Procedure WaypointToAction(X,Y,Z,Action :Integer);
begin
UpdateWorld;
Case Action of
1: UseRope(X,Y,Z);
2: UseTile(X,Y,Z);
3: MoveTo(X, Y+1, Z+1);
4: MoveTo(X, Y-1, Z-1);
5: MoveTo(X, Y, Z-1);
6: MoveTo(X, Y, Z);
7: UseShovel(X,Y,Z-1);
8: MoveTo(X, Y, Z);
9: Sleep(X*1000);
else
MoveTo(X,Y,Z);
end;
end;

Function WaypointReached(X,Y,Z,Action :Integer): Boolean;
begin
UpdateWorld;
Result := False;
Case Action of
1: if (Z = Self.Z + 1) then Result := True;
2: if (Z = Self.Z + 1) then Result := True;
3: if (Z = Self.Z) then Result := True;
4: if (Z = Self.Z) then Result := True;
5: if (Z = Self.Z) then Result := True;
6: if ((X = Self.X) and (Y = Self.Y) and (Z = Self.Z)) then Result := True;
7: if (Z = Self.Z) then Result := True;
8: if (abs(Z - Self.Z) = 1) then Result := True;
9: Result := True;
else
if ((X = Self.X) and (Y = Self.Y) and (Z = Self.Z)) then Result := True;
end;
end;

Function CountWaypoints(FilePath: String): Integre;
Var
i: Integer
WaypointFile: TextFile
begin
i := 0
AssignFile(WaypointFile, FilePath);
ReSet(WaypointFile);
while not EoF(WaypointFile) do
begin
temp:= ReadLn(WaypointFile);
i := i+1;
end;
Result:= (i/4);
end;

Function ExtractWaypointsFromFile(FilePath: String; Count: Integer): Integre;
Var
i: Integr
WaypointsArray: Integer
WaypointFile: TextFile
begin
WaypointsArray := VarArrayCreate([0, Count - 1, 0, 3], $C);
AssignFile(WaypointFile, FilePath);
ReSet(WaypointFile);
for i:=0 to Count-1 do
begin
WaypointsArray[i,0] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,1] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,2] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,3] := StrToInt(ReadLn(WaypointFile));
end;
CloseFile(WaypointFile);
Result := WaypointsArray;
end;

procedure DepositeStones;
begin
UpdateWorld;
A := nil;
for x := 6 to 8 do
begin
if x > 8 then break;
for y := 4 to 6 do
begin
if y > 6 then break;
for i := 0 to Screen.Tile[x,y].Count - 1 do
begin
if i >= Screen.Tile[x,y].Count then break;
if Screen.Tile[x,y].Item[i].properties.depot then
begin
A := Screen.Tile[x,y].Item[i];
break;
end;
SLEEP(50);
end;
end;
end;
if A <> nil then
if BackpackToEmpty > 0 then
begin
A.Open;
C := Self.Containers.Count;
Sleep(1500);
UpdateWorld;
if C <> Self.Containers.Count then
begin
for G := Self.Containers.Container[BackpackToEmpty - 1].Count - 1 downto 0 do
begin
if G >= Self.Containers.Container[BackpackToEmpty - 1].Count then break;
Self.Containers.Container[BackpackToEmpty - 1].Item[G].MoveToContainer(Self.Containers.Container[Self.Containers.Count - 1],20,0);
sleep(100);
end;
end;
end;
else if BackpackToEmpty = 0 then
begin
A.Open;
C := Self.Containers.Count;
Sleep(1500);
UpdateWorld;
if C <> Self.Containers.Count then
begin
for ok := 0 to self.containers.Count - 2 do
begin
if ok >= Self.Containers.Count - 1 then break;
for G := Self.Containers.Container[ok].Count - 1 downto 0 do
begin
if G >= Self.Containers.Container[ok].Count then break;
Self.Containers.Container[ok].Item[G].MoveToContainer(Self.Containers.Container[
elf.Containers.Count - 1],100,0);
sleep(100);
end;
end;
end;
end;
end;

function CountItemAmountFromOpenBackpack(ID: integer): integer;
var
x: integer;
y: integer;
begin
Result := 0;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then begin
Result := Result + Self.Containers.Container[x].Item[y].Amount;
end;
end;
end;
end;

Procedure FollowWaypoint(FilePath: String)
var block: integer;
begin
Index := 0
Unreachable := False
WaypointsCount := CountWaypoints(FilePath);
WP := ExtractWaypointsFromFile(FilePath, WaypointsCount);

while (Index <> (WaypointsCount-1)) and (not Terminated) do
begin
if Unreachable then
begin
Index := Index+1;
Unreachable := False;
end;

if Index = (WaypointsCount-1) then
begin
Index := 0;
end;

if WaypointReached(WP[Index,0],WP[Index,1],WP[Index,2],WP[Index,3]) then
Index := Index +1;
WaypointToAction(WP[Index,0],WP[Index,1],WP[Index,2],WP[Index,3]);
Sleep(1000);

end;
end;

begin
updateworld
if Self.Capacity > CapacityAmount then Exit;

FollowWaypoint(CaveToDepotWaypoints);
Stones:=CountItemAmountFromOpenBackpack(1781);
While (not terminated) and (Stones > 0) do
begin
DepositeStones;
Sleep(WaitTime*1000);
updateworld;
Stones:=CountItemAmountFromOpenBackpack(1781);
end;

FollowWaypoint(DepotToCaveWaypoints);

Sleep(1000);
end;



Cytat:
CapacityAmount = 100;
tu wpisać ile ma mieć CAP jak będzie odnosił kamienie

Tutaj jest napisane jak ustawić depositer gdyż nie wystarczy odpalić skrypt
_________________
jestem jak kot na pustyni...nie ogarniam tej kuwety

Ostatnio zmieniony przez Damik 2010-11-02, 19:32, w całości zmieniany 1 raz  
 
 
anszperger1
[Usunięty]

Wysłany: 2009-12-24, 10:20   

A ten skrypt to nie jest do elfa ??

[ Dodano: 2009-12-24, 10:22 ]
bo mi pisalo [Error] Untitled(192): Unknown identifier or variable is not declared: 'elf'
jak bys mogl to poprosze skrypy dla ng
 
 
Arqs69
[Usunięty]

Wysłany: 2010-02-07, 21:05   

zrobił byś tutorial jak zrobić własny depositer ?? albo dodał byś gobliny edron z depositerem :) ?? odwdzięcze sie :P
 
     
Semran 


Dołączył: 03 Sie 2009
Posty: 113
Skąd: Konin
Wysłany: 2010-02-08, 23:16   

te skrypty działają również na goblinach w edron, wystarczy Tutaj
Cytat:
C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From goblins to depot.wpt' -tutaj daj swoje wp z goblinów do dp.
C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From depot to goblins.wpt' - a tutaj z dp do goblinów.

dać wpt z goblinów na edron do dp i na odwrót
_________________
jestem jak kot na pustyni...nie ogarniam tej kuwety

 
     
artix1244
[Usunięty]

Wysłany: 2010-02-28, 07:18   

....
 
     
Wasyl 

Dołączył: 04 Mar 2010
Posty: 12
Wysłany: 2010-03-04, 10:05   

a mógł byś dodać wpt z fermor hills do dp ab i spowrotem na expa zeby depositer działał? Dam ' pomógł ' ;s
 
     
bizzoneq 

Dołączył: 31 Paź 2010
Posty: 1
Wysłany: 2010-11-02, 15:36   Re: Depositer small stone

Semran napisał/a:
C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From goblins to depot.wpt' -tutaj daj swoje wp z goblinów do dp.
C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From depot to goblins.wpt' - a tutaj z dp do goblinów.

Skrypt ten odnosi kamyki przy danej ich ilości!


Kod:
const
BackpackToEmpty = 2 // z ktorego bp ma wrzucac kamyczki do depo
CaveToDepotWaypoints = 'C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From goblins to depot.wpt' // Goblins to DP
DepotToCaveWaypoints = 'C:\Program Files\TibiaBot NG\waypoints\[Femor hills] From depot to goblins.wpt' // DP to Goblins

StonesAmount = 40; // Ile kamyczkow ma zebrac
WaitTime = 10;

var
Stones: integer;

Function GetTileFromXYZ(X, Y, Z: integer): TTile;
begin
Result := nil;
if abs((Self.X - 7) - X) > 14 then Exit;
if abs((Self.Y - 5) - Y) > 11 then Exit;
if Self.Z <> Z then Exit;
Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)];
end;

Procedure UseTile(X,Y,Z: Integer);
Var
Tile: TTile;
begin
if Z = Self.Z then
begin
Tile := GetTileFromXYZ(X, Y, Z);
Tile.Item[1].Use;
end;
else Unreachable := True;
end;

Procedure UseRope(X,Y,Z: Integer);
begin
if Z = Self.Z then
begin
Self.Containers.UseItemWithGround(3003, X, Y, Z);
end;
else Unreachable := True;
end;

Procedure MoveTo(X,Y,Z: Integer);
begin
if Z = Self.Z then
begin
Self.MoveTo(X,Y,Z);
end;
else Unreachable := True;
end;

Procedure UseShovel(X,Y,Z: Integer);
var Tile: TTile
begin
if Z = Self.Z then
begin
repeat
Self.Containers.UseItemWithGround(5710, X, Y, Z);
Self.Containers.UseItemWithGround(3457, X, Y, Z);
Sleep(1000);
UpdateWorld;
Tile := GetTileFromXYZ(X, Y, Z);
until Tile.Item[0].Properties.Hole or Terminated
Self.MoveTo(X, Y, Z);
end;
else Unreachable := True;
end;

Procedure WaypointToAction(X,Y,Z,Action :Integer);
begin
UpdateWorld;
Case Action of
1: UseRope(X,Y,Z);
2: UseTile(X,Y,Z);
3: MoveTo(X, Y+1, Z+1);
4: MoveTo(X, Y-1, Z-1);
5: MoveTo(X, Y, Z-1);
6: MoveTo(X, Y, Z);
7: UseShovel(X,Y,Z-1);
8: MoveTo(X, Y, Z);
9: Sleep(X*1000);
else
MoveTo(X,Y,Z);
end;
end;

Function WaypointReached(X,Y,Z,Action :Integer): Boolean;
begin
UpdateWorld;
Result := False;
Case Action of
1: if (Z = Self.Z + 1) then Result := True;
2: if (Z = Self.Z + 1) then Result := True;
3: if (Z = Self.Z) then Result := True;
4: if (Z = Self.Z) then Result := True;
5: if (Z = Self.Z) then Result := True;
6: if ((X = Self.X) and (Y = Self.Y) and (Z = Self.Z)) then Result := True;
7: if (Z = Self.Z) then Result := True;
8: if (abs(Z - Self.Z) = 1) then Result := True;
9: Result := True;
else
if ((X = Self.X) and (Y = Self.Y) and (Z = Self.Z)) then Result := True;
end;
end;

Function CountWaypoints(FilePath: String): Integre;
Var
i: Integer
WaypointFile: TextFile
begin
i := 0
AssignFile(WaypointFile, FilePath);
ReSet(WaypointFile);
while not EoF(WaypointFile) do
begin
temp:= ReadLn(WaypointFile);
i := i+1;
end;
Result:= (i/4);
end;

Function ExtractWaypointsFromFile(FilePath: String; Count: Integer): Integre;
Var
i: Integr
WaypointsArray: Integer
WaypointFile: TextFile
begin
WaypointsArray := VarArrayCreate([0, Count - 1, 0, 3], $C);
AssignFile(WaypointFile, FilePath);
ReSet(WaypointFile);
for i:=0 to Count-1 do
begin
WaypointsArray[i,0] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,1] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,2] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,3] := StrToInt(ReadLn(WaypointFile));
end;
CloseFile(WaypointFile);
Result := WaypointsArray;
end;

procedure DepositeStones;
begin
UpdateWorld;
A := nil;
for x := 6 to 8 do
begin
if x > 8 then break;
for y := 4 to 6 do
begin
if y > 6 then break;
for i := 0 to Screen.Tile[x,y].Count - 1 do
begin
if i >= Screen.Tile[x,y].Count then break;
if Screen.Tile[x,y].Item[i].properties.depot then
begin
A := Screen.Tile[x,y].Item[i];
break;
end;
SLEEP(50);
end;
end;
end;
if A <> nil then
if BackpackToEmpty > 0 then
begin
A.Open;
C := Self.Containers.Count;
Sleep(1500);
UpdateWorld;
if C <> Self.Containers.Count then
begin
for G := Self.Containers.Container[BackpackToEmpty - 1].Count - 1 downto 0 do
begin
if G >= Self.Containers.Container[BackpackToEmpty - 1].Count then break;
Self.Containers.Container[BackpackToEmpty - 1].Item[G].MoveToContainer(Self.Containers.Container[Self.Containers.Count - 1],20,0);
sleep(100);
end;
end;
end;
else if BackpackToEmpty = 0 then
begin
A.Open;
C := Self.Containers.Count;
Sleep(1500);
UpdateWorld;
if C <> Self.Containers.Count then
begin
for ok := 0 to self.containers.Count - 2 do
begin
if ok >= Self.Containers.Count - 1 then break;
for G := Self.Containers.Container[ok].Count - 1 downto 0 do
begin
if G >= Self.Containers.Container[ok].Count then break;
Self.Containers.Container[ok].Item[G].MoveToContainer(Self.Containers.Container[
elf.Containers.Count - 1],100,0);
sleep(100);
end;
end;
end;
end;
end;

function CountItemAmountFromOpenBackpack(ID: integer): integer;
var
x: integer;
y: integer;
begin
Result := 0;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then begin
Result := Result + Self.Containers.Container[x].Item[y].Amount;
end;
end;
end;
end;

Procedure FollowWaypoint(FilePath: String)
begin
Index := 0
Unreachable := False
WaypointsCount := CountWaypoints(FilePath);
WP := ExtractWaypointsFromFile(FilePath, WaypointsCount);

while (Index <> (WaypointsCount-1)) and (not Terminated) do
begin
if Unreachable then
begin
Index := Index+1;
Unreachable := False;
end;

if Index = (WaypointsCount-1) then Index := 0;
if WaypointReached(WP[Index,0],WP[Index,1],WP[Index,2],WP[Index,3]) then
Index := Index +1;

WaypointToAction(WP[Index,0],WP[Index,1],WP[Index,2],WP[Index,3]);

Sleep(1000);
end;
end;

begin
updateworld
Stones := CountItemAmountFromOpenBackpack(1781);
if Stones < StonesAmount then Exit;

FollowWaypoint(CaveToDepotWaypoints);

While (Stones > 0) and (not terminated) do
begin
DepositeStones;
Sleep(WaitTime*1000);
updateworld;
Stones := CountItemAmountFromOpenBackpack(3031);
end;
if Terminated then Exit;

FollowWaypoint(DepotToCaveWaypoints);

Sleep(1000);
end;




A ten przy danej ilości CAP
Kod:

const
BackpackToEmpty = 1 // ID backpacka z kamyczkami
CaveToDepotWaypoints = 'tutaj z goblinow do dp'
DepotToCaveWaypoints = 'tutaj z dp do goblinow'

CapacityAmount = 100;
WaitTime = 5;

Function GetTileFromXYZ(X, Y, Z: integer): TTile;
begin
Result := nil;
if abs((Self.X - 7) - X) > 14 then Exit;
if abs((Self.Y - 5) - Y) > 11 then Exit;
if Self.Z <> Z then Exit;
Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)];
end;

Procedure UseTile(X,Y,Z: Integer);
Var
Tile: TTile;
begin
if Z = Self.Z then
begin
Tile := GetTileFromXYZ(X, Y, Z);
Tile.Item[1].Use;
end;
else Unreachable := True;
end;

Procedure UseRope(X,Y,Z: Integer);
begin
if Z = Self.Z then
begin
Self.Containers.UseItemWithGround(3003, X, Y, Z);
end;
else Unreachable := True;
end;

Procedure MoveTo(X,Y,Z: Integer);
begin
if Z = Self.Z then
begin
Self.MoveTo(X,Y,Z);
end;
else Unreachable := True;
end;

Procedure UseShovel(X,Y,Z: Integer);
var Tile: TTile
begin
if Z = Self.Z then
begin
repeat
Self.Containers.UseItemWithGround(5710, X, Y, Z);
Self.Containers.UseItemWithGround(3457, X, Y, Z);
Sleep(1000);
UpdateWorld;
Tile := GetTileFromXYZ(X, Y, Z);
until Tile.Item[0].Properties.Hole or Terminated
Self.MoveTo(X, Y, Z);
end;
else Unreachable := True;
end;

Procedure WaypointToAction(X,Y,Z,Action :Integer);
begin
UpdateWorld;
Case Action of
1: UseRope(X,Y,Z);
2: UseTile(X,Y,Z);
3: MoveTo(X, Y+1, Z+1);
4: MoveTo(X, Y-1, Z-1);
5: MoveTo(X, Y, Z-1);
6: MoveTo(X, Y, Z);
7: UseShovel(X,Y,Z-1);
8: MoveTo(X, Y, Z);
9: Sleep(X*1000);
else
MoveTo(X,Y,Z);
end;
end;

Function WaypointReached(X,Y,Z,Action :Integer): Boolean;
begin
UpdateWorld;
Result := False;
Case Action of
1: if (Z = Self.Z + 1) then Result := True;
2: if (Z = Self.Z + 1) then Result := True;
3: if (Z = Self.Z) then Result := True;
4: if (Z = Self.Z) then Result := True;
5: if (Z = Self.Z) then Result := True;
6: if ((X = Self.X) and (Y = Self.Y) and (Z = Self.Z)) then Result := True;
7: if (Z = Self.Z) then Result := True;
8: if (abs(Z - Self.Z) = 1) then Result := True;
9: Result := True;
else
if ((X = Self.X) and (Y = Self.Y) and (Z = Self.Z)) then Result := True;
end;
end;

Function CountWaypoints(FilePath: String): Integre;
Var
i: Integer
WaypointFile: TextFile
begin
i := 0
AssignFile(WaypointFile, FilePath);
ReSet(WaypointFile);
while not EoF(WaypointFile) do
begin
temp:= ReadLn(WaypointFile);
i := i+1;
end;
Result:= (i/4);
end;

Function ExtractWaypointsFromFile(FilePath: String; Count: Integer): Integre;
Var
i: Integr
WaypointsArray: Integer
WaypointFile: TextFile
begin
WaypointsArray := VarArrayCreate([0, Count - 1, 0, 3], $C);
AssignFile(WaypointFile, FilePath);
ReSet(WaypointFile);
for i:=0 to Count-1 do
begin
WaypointsArray[i,0] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,1] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,2] := StrToInt(ReadLn(WaypointFile));
WaypointsArray[i,3] := StrToInt(ReadLn(WaypointFile));
end;
CloseFile(WaypointFile);
Result := WaypointsArray;
end;

procedure DepositeStones;
begin
UpdateWorld;
A := nil;
for x := 6 to 8 do
begin
if x > 8 then break;
for y := 4 to 6 do
begin
if y > 6 then break;
for i := 0 to Screen.Tile[x,y].Count - 1 do
begin
if i >= Screen.Tile[x,y].Count then break;
if Screen.Tile[x,y].Item[i].properties.depot then
begin
A := Screen.Tile[x,y].Item[i];
break;
end;
SLEEP(50);
end;
end;
end;
if A <> nil then
if BackpackToEmpty > 0 then
begin
A.Open;
C := Self.Containers.Count;
Sleep(1500);
UpdateWorld;
if C <> Self.Containers.Count then
begin
for G := Self.Containers.Container[BackpackToEmpty - 1].Count - 1 downto 0 do
begin
if G >= Self.Containers.Container[BackpackToEmpty - 1].Count then break;
Self.Containers.Container[BackpackToEmpty - 1].Item[G].MoveToContainer(Self.Containers.Container[Self.Containers.Count - 1],20,0);
sleep(100);
end;
end;
end;
else if BackpackToEmpty = 0 then
begin
A.Open;
C := Self.Containers.Count;
Sleep(1500);
UpdateWorld;
if C <> Self.Containers.Count then
begin
for ok := 0 to self.containers.Count - 2 do
begin
if ok >= Self.Containers.Count - 1 then break;
for G := Self.Containers.Container[ok].Count - 1 downto 0 do
begin
if G >= Self.Containers.Container[ok].Count then break;
Self.Containers.Container[ok].Item[G].MoveToContainer(Self.Containers.Container[
elf.Containers.Count - 1],100,0);
sleep(100);
end;
end;
end;
end;
end;

function CountItemAmountFromOpenBackpack(ID: integer): integer;
var
x: integer;
y: integer;
begin
Result := 0;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then begin
Result := Result + Self.Containers.Container[x].Item[y].Amount;
end;
end;
end;
end;

Procedure FollowWaypoint(FilePath: String)
var block: integer;
begin
Index := 0
Unreachable := False
WaypointsCount := CountWaypoints(FilePath);
WP := ExtractWaypointsFromFile(FilePath, WaypointsCount);

while (Index <> (WaypointsCount-1)) and (not Terminated) do
begin
if Unreachable then
begin
Index := Index+1;
Unreachable := False;
end;

if Index = (WaypointsCount-1) then
begin
Index := 0;
end;

if WaypointReached(WP[Index,0],WP[Index,1],WP[Index,2],WP[Index,3]) then
Index := Index +1;
WaypointToAction(WP[Index,0],WP[Index,1],WP[Index,2],WP[Index,3]);
Sleep(1000);

end;
end;

begin
updateworld
if Self.Capacity > CapacityAmount then Exit;

FollowWaypoint(CaveToDepotWaypoints);
Stones:=CountItemAmountFromOpenBackpack(1781);
While (not terminated) and (Stones > 0) do
begin
DepositeStones;
Sleep(WaitTime*1000);
updateworld;
Stones:=CountItemAmountFromOpenBackpack(1781);
end;

FollowWaypoint(DepotToCaveWaypoints);

Sleep(1000);
end;



Cytat:
CapacityAmount = 100;
tu wpisać ile ma mieć CAP jak będzie odnosił kamienie

Tutaj jest napisane jak ustawić depositer gdyż nie wystarczy odpalić skrypt




może mi ktoś wytłumaczy jak dokładnie te wayponty dodac? ścieżke do pliku , czy jak bo nie kumam ?
robie coś po swojemu ale mam błąd
_________________
bizoneq
Ostatnio zmieniony przez Damik 2010-11-02, 19:32, w całości zmieniany 1 raz  
 
     
lechu101 
Pomogłem ? daj GP

Wiek: 27
Dołączył: 05 Lis 2010
Posty: 8
Wysłany: 2010-11-05, 21:36   

ten depositer kamyczki tylko odnosi czy kase tez ?
 
     
miko183 

Dołączył: 09 Lis 2010
Posty: 4
Wysłany: 2010-11-18, 20:18   

mógł byś zrobic też wpt do odnoszenia kamyczków i kasy?
 
     
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group - anime - Mapa Forum
Style created by Kula & Gozda