What's new

- TibiaBot NG Problem z zbieraniem lota

Status
Not open for further replies.

adam9271

New User
Joined
Mar 20, 2010
Messages
5
Reaction score
0
Witam. Gram na ots 7.92 i mam bota ng pod t? tibie ustawiam w cavebocie zeby zabijal potworki ale gdy go zabije nie otwiera go tylko idzie dalej. Prosze o POMOC
PS: Dam reputa za dobra podpowiedz!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

Marcinoos66

Senior User
Joined
Dec 18, 2008
Messages
1,196
Reaction score
99
Odp: Problem z zbieraniem lota

Prosz?, tutaj masz gotowy skrypt na otwieranie potwork?w.

PHP:
var
Loot: array of integer;
LootCount: 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;

function GetItemOnTile(ID: integer; Tile: TTile): TItem;
var
Z: integer;
begin
Result := nil;
for Z := 0 to Tile.Count - 1 do
begin
if Z >= Tile.Count then Break;
if Tile.Item[Z].ID = ID then
begin
Result := Tile.Item[Z];
Break;
end;
end;
end;

function GetItemFromOpenBackpack(Index, ID: integer): TItem;
var
y: integer;
begin
Result := nil;
if Index >= Self.Containers.Count then Exit;
for y := 0 to Self.Containers.Container[Index].Count - 1 do
begin
if y >= Self.Containers.Container[Index].Count then Break;
if Self.Containers.Container[Index].Item[y].ID = ID then
begin
Result := Self.Containers.Container[Index].Item[y];
Exit;
end;
end;
end;

procedure Event_ContainerOpened(Index, ID: integer; Name: string);
var
x: integer;
Found: boolean;
begin
if Index = 0 then Exit;
repeat
Found := False;
for x := 0 to LootCount - 1 do
begin
UpdateWorld;
Item := GetItemFromOpenBackpack(Index, Loot[x]);
if Item <> nil then
begin
Found := True;
Item.MoveToContainer(Self.Containers.Container[0], 0, 0);
Sleep(200);
end;
end;
until not Found;
end;

procedure Event_ItemCreated(ID, X, Y, Z: integer);
var
Corpse: TItem;
Tile: TTile;
begin
UpdateWorld;
if abs(Self.X - X) > 1 then Exit;
if abs(Self.Y - Y) > 1 then Exit;
if Self.Z <> Z then Exit;
Tile := GetTileFromXYZ(X, Y, Z);
if Tile = nil then Exit;
Corpse := GetItemOnTile(ID, Tile);
if Corpse = nil then Exit;
if (Corpse.Properties.Container) and (not Corpse.Properties.Movable) then Corpse.Open;
end;

begin
Loot := [3031, 3492]; //gold = 3031 and worms = 3492
LootCount := 2; //2 loot items
while not Terminated do
begin
ProcessEvents;
Sleep(100);
end;
end;
 

adam9271

New User
Joined
Mar 20, 2010
Messages
5
Reaction score
0
Odp: Problem z zbieraniem lota

ej marcin dasz troche bardziej sczegolowa instrukcje gdzie to mam dac bo wklejilem to do sctripts i nic zabilem cyclopa i nic pls porsze o pomoc!!!!!!!!!!!
 

Marcinoos66

Senior User
Joined
Dec 18, 2008
Messages
1,196
Reaction score
99
Odp: Problem z zbieraniem lota

No dajesz ten skrypt i klikasz "Execute Script" i powinno wszystko dzia?a?, je?eli nie, napisz tutaj.
 

Marcinoos66

Senior User
Joined
Dec 18, 2008
Messages
1,196
Reaction score
99
Odp: Problem z zbieraniem lota

Nie no, ten skrypt na pewno dzia?a, bo sam go sprawdza?em..
Musia?e? albo ?le go skopiowa?, albo ?le go aktywowa?, sprawd? jeszcze raz wszystko.
 

xNordik

Advanced User
Joined
Dec 28, 2010
Messages
338
Reaction score
33
Age
24
Odp: Problem z zbieraniem lota

Je?eli na OTS jest w?asne Tibia.spr nie mo?liwe jest by zbiera? ci loot z niego. Uwierz mi, gra?em na bocie na takim Open Tibia Serverze. Nie b?d? podawa? danych! A ty Marcinoos66 mam pytanie, ?eby zbiera? loot potrzebny jest skrypt? Jak ma ten w?asny SPR to we? spr?buj z Elfem.
 
Status
Not open for further replies.
Top