Forum www.elfngboot.fora.pl Strona Główna
 Strona glówna  •  FAQ  •  Szukaj  •  Użytkownicy  •  Grupy  •  Galerie  •  Rejestracja  •   Profil  •  Zaloguj się, by sprawdzić wiadomości  •  Zaloguj 
Small stones z bp do lewej ręki 
Napisz nowy temat   Odpowiedz do tematu    Forum www.elfngboot.fora.pl Strona Główna -> Bot NG / Skrypty
Zobacz poprzedni temat :: Zobacz następny temat  
Autor
Wiadomość
jabol123
Administrator



Dołączył: 05 Mar 2009
Posty: 26
Przeczytał: 0 tematów

Ostrzeżeń: 0/5

PostWysłany: Czw 20:43, 05 Mar 2009  

wkładamy odpowiednia ilość kamyków do bp. Bot automatycznie przekłada kamyki z backpacka do lewej ręki.

Kod:

Const
SmallID = 1781
SmallAmount = 5

Function GetItemFromOpenBackpack(ID, Index: integer): TItem;
var
  x: integer;
  y: integer;
begin
  Result := nil;
  for x := 0 to Self.Containers.Count - 1 do
  begin
    if x >= Self.Containers.Count then Break;
    if x = Index then Continue;
    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 := Self.Containers.Container[x].Item[y];
        Exit;
      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;

while not terminated do
begin
  UpdateWorld;
 
  SmallStone := GetItemFromOpenBackpack(SmallID, Self.Containers.Count);
    if SmallStone <> nil then SmallStone.MoveToContainer(Self.Containers.Container[0], 0, 0);
    if (Self.LeftHand.ID = SmallID) then
    begin
          if (Self.LeftHand.Amount < 90) then
    begin
      SmallStone := GetItemFromOpenBackpack(SmallID, Self.Containers.Count);
      if SmallStone <> nil then SmallStone.MoveToBody(Self.LeftHand, 0);
    end;
      end else begin
    SmallCount := CountItemAmountFromOpenBackpack(SmallID);
    if SmallCount >= SmallAmount then
    begin
      Self.LeftHand.MoveToBody(Self.Arrow, 0);
      Sleep(500);
      SmallStone := GetItemFromOpenBackpack(SmallID, Self.Containers.Count);
      if SmallStone <> nil then SmallStone.MoveToBody(Self.LeftHand, 0);
    end else if Self.LeftHand.ID = 0 then Self.Arrow.MoveToBody(Self.LeftHand, 0);
  end;

  Sleep(500);
end; 


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum www.elfngboot.fora.pl Strona Główna -> Bot NG / Skrypty Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1
   
 
Opcje 
Zezwolenia Opcje
Kto jest na Forum Możesz pisać nowe tematy
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
Kto jest na Forum
 
Jumpbox
Kto jest na Forum
Skocz do:  


fora.pl - załóż własne forum dyskusyjne za darmo
Theme FrayCan created by spleen & Download
Powered by phpBB © 2001, 2005 phpBB Group
Regulamin