Autor Wiadomość
jabol123
PostWysłany: Czw 21:18, 05 Mar 2009    Temat postu: Wyrzuć loot gdy mało cap..

Skrypt wyrzuca itemki od podanym ID gdy mamy mało Capa

Kod:

Const
  ItemIDs = [3285,3447,3448,3350] // it will try to throw items until you have enuogh cap again in the order from the right to left.
  MinCap = 50
  AlertWhenDrop = 1 // 0 - to disable. 1 - to enable.
 
function GetItemFromOpenBackpack(ID: integer): TItem;
var
  y: integer;
begin
  Result := nil;
  for x := Self.Containers.Count - 1 downto 0 do
  begin
    if x >= Self.Containers.Count then Break;
    for y := Self.Containers.Container[x].Count - 1 downto 0 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;

while not terminated do
begin
  UpdateWorld;
  if Self.Capacity <= MinCap then
  begin
    for i := Low(ItemIDs) to High(ItemIDs) do
    begin
      Item := GetItemFromOpenBackpack(ItemIDs[i]);
      if Item <> nil then
      begin
        Item.MoveToGround(Self.X,Self.Y,Self.Z,0);
        if AlertWhenDrop then
        PlaySound('C:/Windows/Media/Notify.wav');
        break;
      end;
    end;
  end;
  Sleep(1500);
 end;

Powered by phpBB © 2001, 2005 phpBB Group